SA-MP Forums Archive
Help with version checking - 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: Help with version checking (/showthread.php?tid=665740)



Help with version checking - Edvukas - 14.04.2019

Hello again, I have script which should kick me when I connect with wrong version but when I connect it doesn't kick me or something like that. My code:
pawn Code:
if(strcmp(version, "0.3.7-R3"))
    {
    SendClientMessage(playerid, -1, "{FF0000}* Your version is wrong!");
    Kick(playerid);
    }
I'm trying to connect with R2


Re: Help with version checking - ElMaestro123 - 14.04.2019

Code:
if(!strcmp(version, "0.3.7-R3"))
add ! in front of the function to change the statement meaning.
strcmp return value is 0 if the string matches another string.