Checking Syntax
Could someone show me a more efiicient way to write the following conditional statement?
Code:
|
Reason I ask is because Im trying to block certain commands through amx_rcon and it seems to be blocking everything even if its not one of the items here.
|
if(!equali(a,b)) means if it's not this command.
Remove the ! There's not much you can do to make it shorter. Maybe make a stock for it, but I don't think it's worth simplifying a few characters shorter. |
well you could do something like:
Code:
|
While we're on the subject, those || between the statements mean 'or' right?
|
Quote:
|
Quote:
Just for the record, Im listing the commands Im allowing, not trying to block. I decided that trying to block every possible rcon command would take much more time/space than just listing a few commands. |
Ok, this is what Im using and it does not see to be working. It seems to be blocking every command.
Code:
I have just realised there is no OR (||) conditions using this. So basically if the argument isnt changelevel it stops there. This is not what I want. I may have a solution to this by counting the total number of commands here and checking to see if any of them matched by checking totals, kinda like a tally system. For example since I have 5 possible commands here I can do a check at the end of the "for" loop to see if it counted 5 mismatches and if so, then to stop there. Heres my question: To do what I mentioned above I was wondering if there was a way to count how many items are in my array and replacing the 5 with that variable. |
What about something like this.
Code:
|
your supposed to use it like so:
Code:
|
| All times are GMT -4. The time now is 14:27. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.