Login issue [SOLVED] -
Hargrave - 05.05.2013
Hello everyone!
I followed this tutorial:
https://sampforum.blast.hk/showthread.php?tid=273088 and everything works perfectly except one thing. When I've made an account and relogging the server - then I login and nothing is happening. After I wrote in the correct password the dialog dissaperars and just the spawn button and the < > buttons are visible on my screen, without the camerapos of course, and yeah if I press spawn it says "Stay within the world boundries". When I login I want the character to automatically spawn at the same spawn some the registering spawn (newbie spawn). What's wrong?
Re: Login issue (Stay within the spawn boundaries) -
bensmart469 - 05.05.2013
You need to add an AddPlayerClass line to your script e.g:
PHP Code:
AddPlayerClass(2,1759.3490,-1895.4958,13.5610,268.6081,0,0,0,0,0,0);
Re: Login issue (Stay within the spawn boundaries) -
Hargrave - 05.05.2013
Where in the script? OnPlayerConnect?
Re: Login issue (Stay within the spawn boundaries) -
bensmart469 - 05.05.2013
OnGameModeInit
Re: Login issue (Stay within the spawn boundaries) -
Hargrave - 05.05.2013
I can press spawn and spawn where I wanted it to, but I still have to press on the spawn button. Possible to do so I automatically spawning there instead of pressing on the spawn button?
Re: Login issue (Stay within the spawn boundaries) -
bensmart469 - 05.05.2013
SpawnPlayer(playerid);
https://sampwiki.blast.hk/wiki/SpawnPlayer
Re: Login issue (Stay within the spawn boundaries) -
Hargrave - 05.05.2013
Already tried that. Added it underneath the addplayerclass code but got this error "undefined symbol "playerid" and yeah. Where shall I add that?
Re: Login issue (Stay within the spawn boundaries) -
bensmart469 - 05.05.2013
Add that underneath your login code.
Re: Login issue (Stay within the spawn boundaries) -
SilverKiller - 05.05.2013
Look, in the OnDialogResponse in the script, in the DIALOG_LOGIN part, add SetSpawnInfo and add SpawnPlayer(playerid);
EDIT: Too Late.
Re: Login issue (Stay within the spawn boundaries) -
Hargrave - 05.05.2013
Quote:
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_GREY"Login",""COL_WHITE"Y ou have entered an incorrect password.\n"COL_GREY"Type your password below to login.","Login","Quit");
}
return 1;
}
}
}
return 1;
}
|
Where shall I place it? Tried nearly everywhere but I'm getting errors. And yeah, it's the login dialog I've problems with not the register dialog so I'm just showing this of.