Quote:
Originally Posted by Alex_Valde
I got one more question.
I made a dialog when player connects on server.
pawn Код:
if(!fexist(file)) { new playernamesplit[3][MAX_PLAYER_NAME]; split(GetName(playerid), playernamesplit, '_'); format (string, sizeof(string), " Welcome to Razer Roleplay %s,\n\nTo register Your account please write your password bellow.\n\n[HINT]:You will be automatically loged in.",playernamesplit[0]); ShowPlayerDialog(playerid, REG_DIALOG,DIALOG_STYLE_INPUT, "[SYSTEM]: Not Registered!", string, "Register","Cancel"); }
this is when player responds
pawn Код:
if(dialogid ==REG_DIALOG) { if(!response) return SendClientMessage(playerid, COLOR_LIGHTRED, " You Canceled!");
new file[128]; format(file, sizeof(file), "/Accounts/%s.ini", UnderscoreToSpaceName(playerid)); if(!fexist(file)) { if(strlen(inputtext) >= 1) { RegisterPlayer( playerid, inputtext); } else { SendClientMessage(playerid, COLOR_WHITE, "Must be longer than 1 char." ); } } else { SendClientMessage(playerid, COLOR_WHITE, "Your account already exists." ); } }
And this is Register player variable...
pawn Код:
if(!fexist(file)) { MaxRegistered++; dini_Create(file); dini_Set(file, "Password", password); format( Player[playerid][Password], 128, "%s", password); ...... SpawnPlayer(playerid); // and here is the problem
Problem is that player doesn't spawns after registering but I need to press >>Shift<< to spawn player...
Why is that? if you know?
|
Add
pawn Код:
TogglePlayerSpectating(playerid, false);
above "SpawnPlayer(playerid)".