if(dialogid == 5)
{
new name[MAX_PLAYER_NAME], file[256], string[128];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
SetPlayerInterior(playerid,1);
SetPlayerPos(playerid, 1.3173,29.7461,1199.6012);
SpawnPlayer(playerid);
if(!strlen(inputtext))
{
SendClientMessage(playerid, 0xFFFFFFFF, "Your Firstname Cannot Contain Numbers or be Blank Text Only");
ShowPlayerDialog(playerid,5,DIALOG_STYLE_INPUT,"Firstname","What is your firstname?","Submit","Cancel");
return 1;
}
if(!response){ Kick(playerid); PlayerInfo[playerid][pReg] = 1; return 1; }
if(strlen(inputtext) == 0)
{
SendClientMessage(playerid, ORANGE, "Invalid Name Max letters 20.");
ShowPlayerDialog(playerid,5,DIALOG_STYLE_INPUT,"Firstname","What is your firstname?","Submit","Cancel");
return 1;
}
FirstNameSection(playerid, strlen(inputtext));
PlayerPlaySound(playerid, 1132, 0.0, 0.0, 0.0);
TogglePlayerControllable(playerid, 0);
format(string, 128, "Okay So You're First Names is %s ", inputtext);
SendClientMessage(playerid, DARKBLUE, string);
ShowPlayerDialog(playerid,6,DIALOG_STYLE_INPUT,"Lastname","What is your lastname?","Submit","Cancel");
}
public FirstNameSection(playerid, Firstname)
{
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
PlayerInfo[playerid][pFirstname] = Firstname;
dini_Set(file, "Firstname",PlayerInfo[playerid][pFirstname]);
return 1;
}
stock FirstNameSection(playerid, bool:Firstname) //Not sure if this would work :S
{
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
name = Firstname;
dini_Set(file, "Firstname",Firstname);
return 1;
}
new full = strlen(inputtext);
for(new i = 0; i < full; i++)
{
if(IsNumeric(inputtext[i]))
{
SendClientMessage(playerid, 0xFFFFFFFF, "Your Firstname Cannot Contain Numbers or be Blank Text Only");
ShowPlayerDialog(playerid,5,DIALOG_STYLE_INPUT,"Firstname","What is your firstname?","Submit","Cancel");
return 0;
}
}
stock IsNumeric(string[])
{
for (new i = 0, j = strlen(string); i < j; i++)
{
if (string[i] > '9' || string[i] < '0') return 0;
}
return 1;
}
pawn Код:
pawn Код:
|