Login issue (Stay within the spawn boundaries)
#1

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?
Reply
#2

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); 
Reply
#3

Where in the script? OnPlayerConnect?
Reply
#4

OnGameModeInit
Reply
#5

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?
Reply
#6

SpawnPlayer(playerid);
https://sampwiki.blast.hk/wiki/SpawnPlayer
Reply
#7

Already tried that. Added it underneath the addplayerclass code but got this error "undefined symbol "playerid" and yeah. Where shall I add that?
Reply
#8

Add that underneath your login code.
Reply
#9

Look, in the OnDialogResponse in the script, in the DIALOG_LOGIN part, add SetSpawnInfo and add SpawnPlayer(playerid);

EDIT: Too Late.
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)