19.12.2013, 13:26
All Other Things are saving except player score Help Me with that plx
Код:
forward LoadUser_data(playerid,name[],value[]); public LoadUser_data(playerid,name[],value[]) { INI_Int("Password",Player[playerid][pPass]); INI_Int("Cash",Player[playerid][pCash]); INI_Int("Admin",Player[playerid][pAdmin]); INI_Int("Kills",Player[playerid][pKills]); INI_Int("Deaths",Player[playerid][pDeaths]); INI_Int("Score",Player[playerid][pScore]); INI_Int("Skin",Player[playerid][Skin]); INI_Int("Color",Player[playerid][pcolor]); INI_Int("Ban",Player[playerid][pBan]); INI_Int("Team",gTeam[playerid]); INI_Int("Ninja",Player[playerid][pninja]); INI_Int("clothes",Player[playerid][pclothes]); INI_Int("ninjaskin",Player[playerid][pskin]); return 1; } public OnPlayerDeath(playerid, killerid, reason) { SendDeathMessage(killerid, playerid, reason); if(killerid != INVALID_PLAYER_ID) { SetPlayerScore (killerid, GetPlayerScore (killerid) + 1); } Player[killerid][pScore]++; Player[killerid][pKills]++; Player[playerid][pDeaths]++; GivePlayerMoney(killerid,2); return 1; } stock SavePlayerData(playerid) { new INI:File = INI_Open(UserPath(playerid)); INI_SetTag(File,"data"); INI_WriteInt(File,"Cash",GetPlayerMoney(playerid)); INI_WriteInt(File,"Admin",Player[playerid][pAdmin]); INI_WriteInt(File,"Kills",Player[playerid][pKills]); INI_WriteInt(File,"Deaths",Player[playerid][pDeaths]); INI_WriteInt(File,"Score",GetPlayerScore(playerid)); INI_WriteInt(File,"Skin",Player[playerid][Skin]); INI_WriteInt(File,"Ban",Player[playerid][pBan]); INI_WriteInt(File,"Color",GetPlayerColor(playerid)); INI_WriteInt(File,"Team",gTeam[playerid]); INI_WriteInt(File,"Ninja",Player[playerid][pninja]); INI_WriteInt(File,"clothes",Player[playerid][pclothes]); INI_WriteInt(File,"ninjaskin",Player[playerid][pskin]); INI_Close(File); return 1; } public OnPlayerDisconnect(playerid, reason) { SendDeathMessage(INVALID_PLAYER_ID,playerid,201); SavePlayerData(playerid); return 1; }