07.06.2012, 11:52
Hello!
I tried following, googling the problem and found no solutions. The tutorials on the forums didnt help me
The problem is it wont save the coordinates correctly.
OnPlayerDisconnect:
I know its very messy, but help meh!
I tried following, googling the problem and found no solutions. The tutorials on the forums didnt help me
The problem is it wont save the coordinates correctly.
OnPlayerDisconnect:
pawn Code:
public OnPlayerDisconnect(playerid, reason)
{
new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
switch(reason)
{
case 0: format(string, sizeof(string), "%s crashis serverist. (Timeout)", pname);
case 1: format(string, sizeof(string), "%s lahkus serverist.", pname);
case 2: format(string, sizeof(string), "%s kickiti/banniti serverist.", pname);
}
SendClientMessageToAll(COLOR_GREY, string);
new name[MAX_PLAYER_NAME], reasonMsg[8];
switch(reason)
{
case 0: reasonMsg = "Timeout";
case 1: reasonMsg = "Leaving";
case 2: reasonMsg = "Kicked";
}
GetPlayerName(playerid, name, sizeof(name));
GetPlayerFacingAngle(playerid, PlayerInfo[playerid][Angle]);
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Kills",PlayerInfo[playerid][Kills]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][Deaths]);
INI_WriteInt(File,"Adminlevel",PlayerInfo[playerid][Adminlevel]);
INI_WriteInt(File,"Skin",PlayerInfo[playerid][Skin]);
INI_SetTag( File, "position" );
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
INI_WriteFloat(File, "PosX", X);
INI_WriteFloat(File, "PosY", Y);
INI_WriteFloat(File, "PosZ", Z);
//INI_WriteFloat(File, "Angle", GetPlayerFacingAngle(playerid, A);
INI_WriteInt( File, "Interior", GetPlayerInterior( playerid ) );
INI_WriteInt( File, "VirtualWorld", GetPlayerVirtualWorld( playerid ) );
INI_Close(File);
return 1;
}