13.12.2010, 21:54
pawn Код:
if(RegistrationStep[playerid] == 2)
{
new tmp[4];
if(!strlen(text)) //Check to make sure there is at least 1 character input
{
SendClientMessage(playerid,LIGHTBLUE,"What is your Sex?");
SendClientMessage(playerid,WHITE,"Hint: Enter male or female");
return 0;
}
if(!strcmp("male", tmp, true, 4))
{//Checks to see if the input matches "female" and if it does continues
PlayerInfo[playerid][pSex] = strval(text);
PlayerInfo[playerid][pSex] = 2;
SendClientMessage(playerid,LIGHTBLUE,"Ok, so you are a male.");
SendClientMessage(playerid,WHITE,"Thank you for filling in the information");
RegistrationStep[playerid] = 3;
TogglePlayerControllable(playerid,1);//Unfreezes the player and play resumes
return 0;
}
else if(!strcmp("female", tmp, true, 6))
{//Checks to see if the input matches "female" and if it does continues
PlayerInfo[playerid][pSex] = strval(text);
PlayerInfo[playerid][pSex] = 2;
SendClientMessage(playerid,LIGHTBLUE,"Ok, so you are a Female.");
SendClientMessage(playerid,WHITE,"Thank you for filling in the information");
RegistrationStep[playerid] = 3;
TogglePlayerControllable(playerid,1);//Unfreezes the player and play resumes
return 0;
}
else
{ SendClientMessage(playerid,WHITE,"Please answer your Gender!"); return 0; }
}
pawn Код:
public MyDialogStatsSystem(playerid)
{
new String[128], Name[MAX_PLAYER_NAME], Cash = GetPlayerMoney(playerid), Score = GetPlayerScore(playerid), Gender = PlayerInfo[playerid][pSex], Age = PlayerInfo[playerid][pAge]; // String, Name, Geld, und Score angelegt.
GetPlayerName(playerid,Name,sizeof Name);
format(String, sizeof(String), "[Stats of %s]\n[Nickname]: %s [Level]: %d [Money]: %d [Gender]: %d [Age]: %d", Name, Name, Score, Cash, Gender, Age); // Unsere (New's) die wir oben neu angelegt haben - immer mit einem , trennen :5
ShowPlayerDialog(playerid, DIALOG_STATS, 0, "My stats", String, "Close", " "); // Цffne das Dialog fenster beim Spieler
return 1;
}