19.10.2012, 22:06
hey guys i have a server and i have login system bla..bla.. and now i want to make sex system (male, female) and age if u can help me +rep!
#define GLAD2BEHERE 1
// In some command
ShowPlayerDialog(playerid, GLAD2BEHERE, DIALOG_STYLE_MSGBOX, "Gender?", "Are you male or female?", "Male", "Female");
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_WELCOME)
{
if(response) // If they clicked 'Yes' or pressed enter
{
PlayerInfo[playerid][pSex] == 1;
}
else // Pressed ESC or clicked cancel
{
PlayerInfo[playerid][pSex] == 2;
}
return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
}
return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}
//example
CMD:Sex(playerid, params[])
{
if(PlayerInfo[playerid][pSex] == 1)
{
SendClientMessage(playerid, -1, "You Are Male");
}
else if(PlayerInfo[playerid][pSex] == 2)
{
SendClientMessage(playerid, -1, "You Are Female");
}
return 1;
}
if(PlayerInfo[playerid][pSex] == 1)
{
SendClientMessage(playerid, -1, "You Are Male");
}
else if(PlayerInfo[playerid][pSex] == 2)
{
SendClientMessage(playerid, -1, "You Are Female");
}
CMD:getsex(playerid, params[])
{
new playerb, string[128];
if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /getsex [playerid] ");
{
if(PlayerInfo[playerb][pSex] == 1)
{
SendClientMessage(playerid, -1, "You Are Male");
}
else if(PlayerInfo[playerb][pSex] == 2)
{
SendClientMessage(playerid, -1, "You Are Female");
}
}
return 1;
}