31.08.2012, 18:00
Hello. I am trying to learn how to script, and I am starting off with a simple roleplay server with factions, jobs and what not. When you spawn, It will give them a choice to change skin with /skin. However, if you go below 0 or above 299 the game crashes, and you can not log in untill the skin is changed manually through the playerfile.
I tried to make a simple fix to that, however it don't seem to be working. It stops if it is below 0, but if it is over 299 it will successfully apply the skin and crash everyone around and bug the playerfile.
Any help is appreciated.
I tried to make a simple fix to that, however it don't seem to be working. It stops if it is below 0, but if it is over 299 it will successfully apply the skin and crash everyone around and bug the playerfile.
pawn Код:
CMD:skin(playerid, params[])
{
new skin = strval(params);
if(skin < 0 || skin > 299)
{
SendClientMessage(playerid, -1, "Valid skin IDs are 0 - 299");
}
if(skinchange[playerid] == 1)
{
PlayerInfo[playerid][pSkin] = strval(params);
SetPlayerSkin(playerid, strval(params));
skinchange[playerid] = 0;
}
else
{
SendClientMessage(playerid, -1, "You don't have a free skin change.");
}
return 1;
}