Command Help
#1

Hi! I'd like this to work as /car boot (It will open the boot)

Heres what i have so far, the IsBootOpen and that are fine, don't worry about them.

I'm just getting this compiling error
Код HTML:
C:\Users\*****\Desktop\Gear\Games\GTA SA\GTA Server\filterscripts\Tyler.pwn(794) : error 033: array must be indexed (variable "tmp")
C:\Users\*****\Desktop\Gear\Games\GTA SA\GTA Server\filterscripts\Tyler.pwn(798) : error 033: array must be indexed (variable "tmp")
C:\Users\*****\Desktop\Gear\Games\GTA SA\GTA Server\filterscripts\Tyler.pwn(802) : error 033: array must be indexed (variable "tmp")
Reply
#2

Why using strcmp? Go for zcmd.
Reply
#3

Quote:
Originally Posted by Face9000
Посмотреть сообщение
Why using strcmp? Go for zcmd.
I tried that but that still didn't work.
Reply
#4

Bump - anyone?
Reply
#5

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.
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)