11.07.2011, 16:52
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:
This code have to load the skin but it don't works
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
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; }
Код:
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; }