/skin
#1

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.

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;
}
Any help is appreciated.
Reply


Messages In This Thread
/skin - by Why - 31.08.2012, 18:00
Re: /skin - by TaLhA XIV - 31.08.2012, 18:04

Forum Jump:


Users browsing this thread: 2 Guest(s)