23.03.2013, 19:19
why does my pawno crash when I try to complies this piece of code.
pawn Код:
function SaveAccountData(playerid)
{
Player[playerid][Skin] = GetPlayerSkin(playerid);
Player[playerid][Money] = GetPlayerCash(playerid);
new
Float:x,
Float:y,
Float:z
;
GetPlayerPos(playerid,x,y,z);
Player[playerid][Posx] = x;
Player[playerid][Posy] = y;
Player[playerid][Posz] = z;
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"Player Data");
INI_SetTag(File,"Player Data");
INI_WriteInt(File,"Money", GetPlayerMoney(playerid));
INI_WriteInt(File,"Admin Level", Player[playerid][ALevel]);
INI_WriteInt(File, "Skin", Player[playerid][Skin]);
INI_WriteInt(File, "Bank Money", Player[playerid][BankMoney]);
INI_WriteInt(File, "V.I.P", Player[playerid][VIP]);
INI_WriteFloat(File, "Posx", Player[playerid][Posx]);
INI_WriteFloat(File, "Posy", Player[playerid][Posy]);
INI_WriteFloat(File, "Posz", Player[playerid][Posz]);
INI_Close(File);
return 1;
}
function SaveAccounts()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
SaveAccountData(i);
}
}
}