SA-MP Forums Archive
Pawn error. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Pawn error. (/showthread.php?tid=504038)



Pawn error. - Binx - 01.04.2014

I'm making a /givecar command. However, you can own three vehicles. My /givecar params are: givecar [id] [carid] [slot]

Where "Slot" is, you can enter 1 - 2 - 3. Though, I get this error:
Код:
error 035: argument type mismatch (argument 2)
This is the line:
pawn Код:
if(!strcmp("1", slot))



Re: Pawn error. - PrivatioBoni - 01.04.2014

https://sampwiki.blast.hk/wiki/Strcmp

You're missing parameters.


Re: Pawn error. - Binx - 01.04.2014

I don't really understand strcmp. I've tried to make one here:
Код:
if(!strcmp(slot, "1", true, 1))
But I now get arguement 1 instead of 2.


Re: Pawn error. - Stinged - 01.04.2014

strcmp is for string comparing.
1 is not a string, it's an int.
Use if(slot == 1)