Код:
public OnPlayerRequestClass(playerid, classid)
{
PlayerPlaySound(playerid, 1068, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pModel] = Peds[classid][0];
if (RegistrationStep[playerid] == 0 && gPlayerLogged[playerid] != 1)
{
ClearChatbox(playerid, 10);
SendClientMessage(playerid, COLOR_YELLOW2, "____________________________________");
SendClientMessage(playerid, COLOR_YELLOW2, " ");
SendClientMessage(playerid, COLOR_YELLOW, " Welcome back to Real life Roleplay");
SendClientMessage(playerid, COLOR_YELLOW2, " ");
SendClientMessage(playerid, COLOR_YELLOW2, "____________________________________");
SendClientMessage(playerid, COLOR_WHITE, "HINT:Type your password in the box below to login.");
if (gPlayerAccount[playerid] != 0)
{
new loginstring[128];
new loginname[64];
GetPlayerName(playerid,loginname,sizeof(loginname));
format(loginstring,sizeof(loginstring),"Welcome %s\nLogin to get back into the game.\n[HINT]:Enter Password Below.",loginname);
ShowPlayerDialog(playerid,12346,DIALOG_STYLE_INPUT,"Login",loginstring,"Login","Exit");
}
else
{
gPlayerAccount[playerid] = 0;
new regstring[128];
new regname[64];
GetPlayerName(playerid,regname,sizeof(regname));
format(regstring,sizeof(regstring),"Welcome, %s\nI see you a new here?\nPlease register\n[HINT]:Enter a password you would use below.",regname);
ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT,"Register",regstring,"Register","Exit");
}
PlayerPlaySound(playerid, 1185, 0.0, 0.0, 0.0);
SetPlayerCameraPos(playerid, 1163.2378,-2037.3778,69.0078);
SetPlayerCameraLookAt(playerid, 1121.9740,-2037.0681,77.3166);
SetPlayerPos(0.0, 0.0, 0.0);
PlayerInfo[playerid][pModel] = Peds[classid][0];
SetPlayerTeamFromClass(playerid,classid);
}
else SpawnPlayer(playerid);
return false;