[HELP]Saving skin and spawning
#1

Hai,

There are 300 skins (0 to 299) as i know, and i created a skin saving system. I mean, players will register, and it will create a "Skin=300" (id 300 for skins = nothing) into his skin file and will save it. In-game, players will type /skinsave, and it will save his/her current skin. After he re-joined, it will not teleport him to class selection (if skin id is not 300), game will spawn him automaticly. i tried it, but game crashes everytime :

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    new PlayerFile[50], ppName[50];
   
    GetPlayerName(playerid, ppName, sizeof(ppName));
    format(PlayerFile, sizeof(PlayerFile), "/users/%s.ini", ppName);
   
    PlayerInfo[playerid][Skin] = dini_Int(PlayerFile, "Skin");
   
    iSpawnSet[playerid] = 0;
    TextDrawShowForPlayer(playerid,Textdraw2);
    TextDrawShowForPlayer(playerid,Textdraw3);
    SetPlayerColor(playerid,playerColors[playerid]);
    if(PlayerInfo[playerid][Skin] != 300)
    {
        SetupPlayerForClassSelection(playerid);
    }
    else
    {
        SetPlayerSkin(playerid,PlayerInfo[playerid][Skin]);
        SpawnPlayer(playerid);
    }
    return 1;
}
How can i fix it?
Reply
#2

Here you can try to set player skin 300 which doesnt exist.
pawn Код:
if(PlayerInfo[playerid][Skin] != 300)
    {
        SetupPlayerForClassSelection(playerid);
    }
    else
    {
        SetPlayerSkin(playerid,PlayerInfo[playerid][Skin]);  //atm here is 300s skin ID
        SpawnPlayer(playerid);
    }
Reply
#3

can you tell me, how can i cancel class selection?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)