Sex/Age system - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Sex/Age system (
/showthread.php?tid=386257)
Sex/Age system -
dino_d_carter - 19.10.2012
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!
Re: Sex/Age system -
Glad2BeHere - 19.10.2012
PHP код:
#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.
}
Above i just defined the dialog and showed u how to make the dialog to show the play
Then pSex = 1 male pSex = 2 female now we can
playerinfo or w/e ur saving system is
PHP код:
//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;
}
Theere is a command version
PHP код:
if(PlayerInfo[playerid][pSex] == 1)
{
SendClientMessage(playerid, -1, "You Are Male");
}
else if(PlayerInfo[playerid][pSex] == 2)
{
SendClientMessage(playerid, -1, "You Are Female");
}
u can put that
or u can add that do ur /stats cmd or sumthing
PHP код:
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;
}
and a final cmd
Sorry for the wait i was trying to make to make them i figure out a simple way, REP ME IF i helped you
Re: Sex/Age system -
dino_d_carter - 20.10.2012
But how can i do so it saves i have login system with Y_INI