14.12.2011, 16:53
Well, I'm attempting at creating a logout command (simple, you'd think...)
I've got that, and well, it 'logs' me out, alright, the only problem is, their userinformation is not set correctly. It doesn't set their information correctly because they spawn where they LAST logged in (not where they typed /logout).
Have any idea why this is?
Spawn code:
^ Probably has nothing to do with it, but I'm sure you guys would ask for another callback..
pawn Код:
CMD:logout(playerid, params[])
{
new
Float:Pos[4];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
GetPlayerFacingAngle(playerid, Pos[3]);
UserInfo[playerid][LastX] = Pos[0];
UserInfo[playerid][LastZ] = Pos[1];
UserInfo[playerid][LastY] = Pos[2];
UserInfo[playerid][LastRot] = Pos[3];
//TogglePlayerSpectating(playerid, true);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,""COL_WHITE"Login",""COL_GREEN"You have been logged out.\n"COL_WHITE"Type your password below to login.","Login","Quit");
return 1;
}
Have any idea why this is?
Spawn code:
pawn Код:
public OnPlayerSpawn(playerid)
{
new string[128];
if(FirstSpawn[playerid] == 1) {
TextDrawShowForPlayer(playerid, PointsTD);
TheirPoints[playerid] = UserInfo[playerid][Points];
format(string, sizeof(string), "[[ RP Points: %d ]]", TheirPoints[playerid]);
TextDrawSetString(PointsTD, string);
SetPlayerVirtualWorld(playerid, UserInfo[playerid][LastVW]);
SetPlayerInterior(playerid, UserInfo[playerid][LastInt]);
TogglePlayerSpectating(playerid, false);
Player_UpdateTD[playerid] = SetTimerEx("UpdateTD", 1000, 1, "i", playerid); //Start updating the textdraws!
FirstSpawn[playerid] = -1;
}
return 1;
}

