PROBLEM! [REP+]
#1

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.
Reply
#2

Do you mean people that login in with their ID? Or just everyone?
Reply
#3

Give us the code that you have at OnPlayerDisconnect, the code that saves the Accounts of the Players...
Reply
#4

On login.
Код:
                    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);
On disconnect.
Код:
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;
}
Reply
#5

Try using SetSpawnInfo.

pawn Код:
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);
And delete the GivePlayerWeapon and SetPlayerSkin.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)