| Blockland Forums > Modification Help |
| The if statment? |
| << < (2/4) > >> |
| Trader:
Why do you want to do that? |
| -=>RR<=-MasterCE:
--- Quote from: Trader on March 07, 2007, 10:04:29 PM ---Actually, the ' == 1' part is not required for a binary answer. A client either is or isn't a Super Admin, making the answer either 1 or 0. So you can really just use the code: if(%client.isSuperAdmin) {    <insert code here> } As for your second question, you'd have to know what you wanted the string to be. You can't just say if(%dudename.isWord), lol. --- End quote --- Still to complicated, you can optimize it even more: --- Code: ---if(%client.isSuperAdmin)  code --- End code --- Ofcourse, this is only if there is 1 line of code for the if....but it's still optimization. Just remember you need 2 spaces before the code so it applies to the if :D |
| Ytud Fo:
--- Quote from: Jookia on March 07, 2007, 10:22:39 PM ---example? I'm making my own chat, --- End quote --- If you're having trouble with IF statments, I can already see how far you will get in making your own chat... --- Quote from: -=>RR<=-MasterCE on March 07, 2007, 11:16:05 PM ---Just remember you need 2 spaces before the code so it applies to the if :D --- End quote --- Ummm... no you don't |
| -=>RR<=-MasterCE:
Well the 2 spaces helps the eye follow the code so you don't get confused.... |
| Ytud Fo:
ok, but it's not necessary, the code can even be on the same line as the IF statment, or 5 lines below it, the code is executed all the way to the semi-colon. |
| Navigation |
| Message Index |
| Next page |
| Previous page |