Bit of a problem. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Bit of a problem. (
/showthread.php?tid=303633)
Bit of a problem. -
Scarred - 14.12.2011
Well, I'm attempting at creating a logout command (simple, you'd think...)
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;
}
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:
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;
}
^ Probably has nothing to do with it, but I'm sure you guys would ask for another callback..
Re: Bit of a problem. -
Rob_Maate - 14.12.2011
Ya, show us OnDialogResponse for ID DIALOG_LOGIN
Re: Bit of a problem. -
Scarred - 14.12.2011
EDIT: Fixed it, i'm a dipshit. I forgot to write their file as I "logged" them out. DERP.