Skins loading
#1

Hello, I made a skins saving/loading script for my gamemode, but the script only saves the skins, when I connect second time to server it doesn't loads my skin from user ini file. Maybe someone can help me to fix it?
This is my script:
It saves the file:
Код:
public OnPlayerDisconnect(playerid, reason)
{
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
if(gPlayerLogged[playerid] == 1)
{
dini_IntSet(file, "Score", GetPlayerScore(playerid));
dini_IntSet(file, "Money", GetPlayerMoneyEx(playerid));
dini_IntSet(file, "Clotches",PlayerInfo[playerid][pClotches] = GetPlayerSkin(playerid));
}
gPlayerLogged[playerid] = 0;
gPlayerNewbie[playerid] = 0;
Administrator[playerid] = false;
Moderator[playerid] = false;

return 1;
}
This code have to load the skin but it don't works
Код:
public OnPlayerSpawn(playerid)
{
if(gPlayerNewbie[playerid] == 1)
{
SetPlayerColor(playerid,0x6F6F6FFF);
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,1642.2858,-2332.8455,-2.6797);
GivePlayerMoneyEx(playerid, 5000);
}
else {
SetPlayerSkin(playerid, PlayerInfo[playerid][pClotches]);
SetPlayerColor(playerid,0x6F6F6FFF);
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,1642.2858,-2332.8455,-2.6797);
}
return 1;
}
And I need help doing newbie script, I mean when player connect first time he gets 5000 but when he connect second time he doesn't get 5000 more
Reply


Messages In This Thread
Skins loading - by Yako - 11.07.2011, 16:52
Re: Skins loading - by Hipflop - 11.07.2011, 17:10
Re: Skins loading - by Toreno - 11.07.2011, 17:12
Re: Skins loading - by Yako - 11.07.2011, 18:08
Re: Skins loading - by Toreno - 11.07.2011, 18:14
Re: Skins loading - by Yako - 11.07.2011, 18:16

Forum Jump:


Users browsing this thread: 1 Guest(s)