Command Help
#6

Quote:
Originally Posted by Hawky133
Посмотреть сообщение
Hello.

Your variable tmp is any array, or you could call it a string in this case.
To check if a string variable is equal to a value, you need to use the function strcmp.

Here is the SA:MP wiki page on the function.

You basically need to replace the lines:
pawn Код:
if(tmp == "boot"){
...
} else if(tmp == "bonnet"){
...
} else if(tmp == "alarm"){
With:
pawn Код:
if(!strcmp(tmp,"boot",true)){
...
} else if(!strcmp(tmp,"bonnet",true)){
...
} else if(!strcmp(tmp,"alarm",true)){
Hopefully the wiki will answer your questions on how to use strcmp, but if not, feel free to reply here.

Also, I'd recommend researching and learning to use one of these command systems (like ZCMD) that the person above recommended, as they run a lot quicker.
Thanks man, Really helped! +Rep
Reply


Messages In This Thread
Command Help - by TylerJc - 21.05.2013, 18:40
Re: Command Help - by Face9000 - 21.05.2013, 18:59
Re: Command Help - by TylerJc - 21.05.2013, 19:05
Re: Command Help - by TylerJc - 21.05.2013, 22:03
Re: Command Help - by Hawky133 - 22.05.2013, 02:42
Re: Command Help - by TylerJc - 22.05.2013, 08:20

Forum Jump:


Users browsing this thread: 1 Guest(s)