19.02.2012, 14:48
Hey guys I got an wierd problem in my script, when people change their skin or buy a weapon it saves when they login again but it also saves for other people so they also get the skin or wepon.
GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]); SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]); GivePlayerWeapon(playerid, PlayerInfo[playerid][pWeapon], PlayerInfo[playerid][pAmmo]); SendClientMessage(playerid, COLOR_GREEN, "You've succesfully logged in!"); SpawnPlayer(playerid);
public OnPlayerDisconnect(playerid, reason) { new INI:File = INI_Open(UserPath(playerid)); INI_SetTag(File,"data"); INI_WriteInt(File,"Cash",GetPlayerMoney(playerid)); INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]); INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]); INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]); INI_WriteInt(File,"Level",PlayerInfo[playerid][pLevel]); INI_WriteInt(File,"Tattoo",PlayerInfo[playerid][pTattoo]); INI_WriteInt(File,"Weapon",PlayerInfo[playerid][pWeapon]); INI_WriteInt(File,"Ammo",PlayerInfo[playerid][pAmmo]); INI_WriteInt(File,"Warns",PlayerInfo[playerid][pWarns]); INI_WriteInt(File,"Model",PlayerInfo[playerid][pModel]); INI_WriteInt(File,"Dice",PlayerInfo[playerid][pDice]); INI_WriteInt(File,"Spraycan",PlayerInfo[playerid][pSpraycan]); INI_WriteInt(File,"Sandwich",PlayerInfo[playerid][pSandwich]); INI_WriteInt(File,"Fighting",PlayerInfo[playerid][pFightingStyle]); INI_WriteInt(File,"Respect",PlayerInfo[playerid][pRespect]); INI_WriteInt(File,"Soda",PlayerInfo[playerid][pSoda]); INI_WriteInt(File,"Visits",PlayerInfo[playerid][pVisits]); INI_WriteInt(File,"Ciggarettes",PlayerInfo[playerid][pCiggarettes]); INI_WriteFloat( File, "PositionX", PosX[ playerid ] ); INI_WriteFloat( File, "PositionY", PosY[ playerid ] ); INI_WriteFloat( File, "PositionZ", PosZ[ playerid ] ); INI_WriteFloat( File, "Angle", Angle[ playerid ] ); INI_WriteInt( File, "Interior", GetPlayerInterior( playerid ) ); INI_WriteInt( File, "VirtualWorld", GetPlayerVirtualWorld( playerid ) ); INI_Close(File); return 1; }
SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pModel], PlayerInfo[playerid][pPosX],PlayerInfo[playerid][pPosY],PlayerInfo[playerid][pPosZ], PlayerInfo[playerid][pAngel], PlayerInfo[playerid][pWeapon], PlayerInfo[playerid][pAmmo], 0, 0, 0, 0);