29.07.2010, 12:09
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 :
How can i fix it?
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;
}