13.10.2013, 14:20
Hey, everytime my players crash they lose their weapons and spawn at different locations, what can the cause be? Everything saves and loads well when they logout and log back in later ;S
INI_Int("Weapon",PlayerInfo[playerid][pWeapon][0]);
INI_Int("Ammo",PlayerInfo[playerid][pAmmo][0]);
INI_Int("Weapon1",PlayerInfo[playerid][pWeapon][1]);
INI_Int("Ammo1",PlayerInfo[playerid][pAmmo][1]);
INI_Int("Weapon2",PlayerInfo[playerid][pWeapon][2]);
INI_Int("Ammo2",PlayerInfo[playerid][pAmmo][2]);
INI_Int("Weapon3",PlayerInfo[playerid][pWeapon][3]);
INI_Int("Ammo3",PlayerInfo[playerid][pAmmo][3]);
INI_Int("Weapon4",PlayerInfo[playerid][pWeapon][4]);
INI_Int("Ammo4",PlayerInfo[playerid][pAmmo][4]);
INI_Int("Weapon5",PlayerInfo[playerid][pWeapon][5]);
INI_Int("Ammo5",PlayerInfo[playerid][pAmmo][5]);
INI_Int("Weapon6",PlayerInfo[playerid][pWeapon][6]);
INI_Int("Ammo6",PlayerInfo[playerid][pAmmo][6]);
INI_Int("Weapon7",PlayerInfo[playerid][pWeapon][7]);
INI_Int("Ammo7",PlayerInfo[playerid][pAmmo][7]);
INI_Int("Weapon8",PlayerInfo[playerid][pWeapon][8]);
INI_Int("Ammo8",PlayerInfo[playerid][pAmmo][8]);
INI_Int("Weapon9",PlayerInfo[playerid][pWeapon][9]);
INI_Int("Ammo9",PlayerInfo[playerid][pAmmo][9]);
INI_Int("Weapon10",PlayerInfo[playerid][pWeapon][10]);
INI_Int("Ammo10",PlayerInfo[playerid][pAmmo][10]);
INI_Int("Weapon11",PlayerInfo[playerid][pWeapon][11]);
//POSITONS
INI_Float("X", PlayerInfo[playerid][pPosX]);
INI_Float("Y", PlayerInfo[playerid][pPosY]);
INI_Float("Z", PlayerInfo[playerid][pPosZ]);
GetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
GetPlayerPos(playerid,PlayerInfo[playerid][pPosX],PlayerInfo[playerid][pPosY],PlayerInfo[playerid][pPosZ]);
GetPlayerHealth(playerid,PlayerInfo[playerid][pHealth]);
GetPlayerArmour(playerid,PlayerInfo[playerid][pArmor]);
GetPlayerWeaponData(playerid,0,PlayerInfo[playerid][pWeapon][0],PlayerInfo[playerid][pAmmo][0]);
GetPlayerWeaponData(playerid,1,PlayerInfo[playerid][pWeapon][1],PlayerInfo[playerid][pAmmo][1]);
GetPlayerWeaponData(playerid,2,PlayerInfo[playerid][pWeapon][2],PlayerInfo[playerid][pAmmo][2]);
GetPlayerWeaponData(playerid,3,PlayerInfo[playerid][pWeapon][3],PlayerInfo[playerid][pAmmo][3]);
GetPlayerWeaponData(playerid,4,PlayerInfo[playerid][pWeapon][4],PlayerInfo[playerid][pAmmo][4]);
GetPlayerWeaponData(playerid,5,PlayerInfo[playerid][pWeapon][5],PlayerInfo[playerid][pAmmo][5]);
GetPlayerWeaponData(playerid,6,PlayerInfo[playerid][pWeapon][6],PlayerInfo[playerid][pAmmo][6]);
GetPlayerWeaponData(playerid,7,PlayerInfo[playerid][pWeapon][7],PlayerInfo[playerid][pAmmo][7]);
GetPlayerWeaponData(playerid,8,PlayerInfo[playerid][pWeapon][8],PlayerInfo[playerid][pAmmo][8]);
GetPlayerWeaponData(playerid,9,PlayerInfo[playerid][pWeapon][9],PlayerInfo[playerid][pAmmo][9]);
GetPlayerWeaponData(playerid,10,PlayerInfo[playerid][pWeapon][10],PlayerInfo[playerid][pAmmo][10]);
GetPlayerWeaponData(playerid,11,PlayerInfo[playerid][pWeapon][11],PlayerInfo[playerid][pAmmo][11]);
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Weapon",PlayerInfo[playerid][pWeapon][0]);
INI_WriteInt(File,"Ammo",PlayerInfo[playerid][pAmmo][0]);
INI_WriteInt(File,"Weapon1",PlayerInfo[playerid][pWeapon][1]);
INI_WriteInt(File,"Ammo1",PlayerInfo[playerid][pAmmo][1]);
INI_WriteInt(File,"Weapon2",PlayerInfo[playerid][pWeapon][2]);
INI_WriteInt(File,"Ammo2",PlayerInfo[playerid][pAmmo][2]);
INI_WriteInt(File,"Weapon3",PlayerInfo[playerid][pWeapon][3]);
INI_WriteInt(File,"Ammo3",PlayerInfo[playerid][pAmmo][3]);
INI_WriteInt(File,"Weapon4",PlayerInfo[playerid][pWeapon][4]);
INI_WriteInt(File,"Ammo4",PlayerInfo[playerid][pAmmo][4]);
INI_WriteInt(File,"Weapon5",PlayerInfo[playerid][pWeapon][5]);
INI_WriteInt(File,"Ammo5",PlayerInfo[playerid][pAmmo][5]);
INI_WriteInt(File,"Weapon6",PlayerInfo[playerid][pWeapon][6]);
INI_WriteInt(File,"Ammo6",PlayerInfo[playerid][pAmmo][6]);
INI_WriteInt(File,"Weapon7",PlayerInfo[playerid][pWeapon][7]);
INI_WriteInt(File,"Ammo7",PlayerInfo[playerid][pAmmo][7]);
INI_WriteInt(File,"Weapon8",PlayerInfo[playerid][pWeapon][8]);
INI_WriteInt(File,"Ammo8",PlayerInfo[playerid][pAmmo][8]);
INI_WriteInt(File,"Weapon9",PlayerInfo[playerid][pWeapon][9]);
INI_WriteInt(File,"Ammo9",PlayerInfo[playerid][pAmmo][9]);
INI_WriteInt(File,"Weapon10",PlayerInfo[playerid][pWeapon][10]);
INI_WriteInt(File,"Ammo10",PlayerInfo[playerid][pAmmo][10]);
INI_WriteInt(File,"Weapon11",PlayerInfo[playerid][pWeapon][11]);
INI_WriteInt(File,"Ammo11",PlayerInfo[playerid][pAmmo][11]);
stock SendDisconnectMsg(playerid,reason)
{
new string[128];
switch(reason)
{
case 0:
{
format(string,sizeof(string),"%s has crashed from the server.",RPN(playerid));
ProxDetector(30, playerid, string, COLOR_YELLOW);
}
case 1:
{
format(string,sizeof(string),"%s has left the server.",RPN(playerid));
ProxDetector(30, playerid, string, COLOR_YELLOW);
}
case 2:
{
format(string,sizeof(string),"%s has been kicked..",RPN(playerid));
ProxDetector(30, playerid, string, COLOR_YELLOW);
}
}
}