SA-MP Forums Archive
Server crash if anyone type /skin higher than 299 - 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: Server crash if anyone type /skin higher than 299 (/showthread.php?tid=282936)



Server crash if anyone type /skin higher than 299 - lamarr007 - 13.09.2011

Plase,can you help me ?
If anyone type /skin ex. 301, my server crash, and i must restart it.
Can you tell me, how to fix it ?
I think, some must exist, to lock skins only 0 to 299
//Edit :
And, if i login in my server as Admin (from /rcon login password).
Its sending some text about vehicle to chat
Pic :



Re: Server crash if anyone type /skin higher than 299 - admantis - 13.09.2011

Please sshow us your skin comand.


Re: Server crash if anyone type /skin higher than 299 - lamarr007 - 13.09.2011

Its in main test_cmds :

if(strcmp(cmd, "/skin", true) == 0) {
new tmp[256];
tmp = strtok(cmdtext,idx);
SetPlayerSkin(playerid,strval(tmp));
return 1;
}


Re: Server crash if anyone type /skin higher than 299 - Pinguinn - 13.09.2011

Skin 301 does not exist


Re: Server crash if anyone type /skin higher than 299 - Jafet_Macario - 13.09.2011

PHP код:
if(strcmp(cmd"/setskin"true) == 0
    {
        new 
tmp[256];
        
tmp strtok(cmdtext,idx);
        if(
strval(tmp) > 299 || strval(tmp) < 0) return SendClientMessage(playerid, -1,"That skin does not exists");
        
SetPlayerSkin(playerid,strval(tmp));
        return 
1;
    } 



Re: Server crash if anyone type /skin higher than 299 - Pinguinn - 13.09.2011

Fixed

pawn Код:
if(strcmp(cmd, "/setskin", true) == 0)
    {
        new tmp[256];
        tmp = strtok(cmdtext,idx);
        if(strval(tmp) >= 0 || strval(tmp) <= 299) return SendClientMessage(playerid, -1,"That skin does not exist");
        SetPlayerSkin(playerid,strval(tmp));
        return 1;
    }
id 0 and id 299 still exists


Re: Server crash if anyone type /skin higher than 299 - Jafet_Macario - 13.09.2011

Quote:
Originally Posted by Pinguinn
Посмотреть сообщение
Fixed

pawn Код:
if(strcmp(cmd, "/setskin", true) == 0)
    {
        new tmp[256];
        tmp = strtok(cmdtext,idx);
        if(strval(tmp) >= 0 || strval(tmp) <= 299) return SendClientMessage(playerid, -1,"That skin does not exist");
        SetPlayerSkin(playerid,strval(tmp));
        return 1;
    }
id 0 and id 299 still exists
Lol yea and you blocked that too.


Re: Server crash if anyone type /skin higher than 299 - lamarr007 - 13.09.2011

Jafet_Macario : Really nice ! Many thanks to you
So, i tested version from Pinguinn, and its always type to chat : "That skin does not exist"
Anyone doesnґt know, why if i login as admin, in chat shows something about VehicleUpdate ?


Re: Server crash if anyone type /skin higher than 299 - Voldemort - 13.09.2011

Dont just copy script, try to understand it :S

pawn Код:
if(strcmp(cmd, "/setskin", true) == 0)
    {
        new tmp[256];
        tmp = strtok(cmdtext,idx);
        if(strval(tmp) < 0 || strval(tmp) > 299) return SendClientMessage(playerid, -1,"That skin does not exist");
        SetPlayerSkin(playerid,strval(tmp));
        return 1;
    }



Re: Server crash if anyone type /skin higher than 299 - lamarr007 - 13.09.2011

Yeah, i know it. But i need help with my 2nd request :

This text shows, if i loged as admin by /rcon login password
Can you help me ?