Car keys help
#1

Hello, I need help with this function:
PHP код:
if(!GetPVarInt(playerid,"CarKeys")==vehicleid) return SCM(playerid,RED,"You don't have keys from this vehicle!"); 
I've got this error:
PHP код:
warning 213tag mismatch 
Please, tell me what is bad in this code :/
Reply
#2

Do you want to check if CarKeys is equal to 0 or vehicleid? You cannot check both like that.

pawn Код:
if (!GetPVarInt(playerid,"CarKeys")) // CarKeys == 0
// or
if (GetPVarInt(playerid,"CarKeys") == vehicleid) // CarKeys == vehicleid
Reply
#3

I want to check if player's PVarInt is same as vehicleid, but nice, this is working, thank you
Reply
#4

Quote:
Originally Posted by TayFunCZE
Посмотреть сообщение
I want to check if player's PVarInt is same as vehicleid, but nice, this is working, thank you
Try

pawn Код:
if(GetPVarInt(playerid,"CarKeys") != vehicleid) return SCM(playerid,RED,"You don't have keys from this vehicle!");
You can't use an '!' at the beginning of the if statement when you're comparing two variables. It's used in the control structure itself.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)