11.11.2018, 17:35
PHP код:
case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registering...","You have entered an invalid password.\nType your password below to register a new account.","Register","Quit");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_Close(File);
new stringl[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(stringl, sizeof(stringl), "Porsh: {FFFFFF}You've successfully registered the name ({F2D82C}%s{FFFFFF}) with the password ({F2D82C}%s{FFFFFF})", name, inputtext);
SendClientMessage(playerid, COLOR_GREEN, stringl);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,"Success!","Great, now please relog to save your stats!","Ok","");
}
}
Now this code:
PHP код:
SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
If you want any messages to show before kicking, add a timer to kick the player after they've been shown the message.
Example:
PHP код:
SetTimerEx("KickTimer", 500, false, "i", playerid); //Add this after showing a player a message.
PHP код:
forward KickTimer(playerid);
public KickTimer(playerid)
{
Kick(playerid);
return 1;
}