24.06.2012, 19:21
Here alll my dialog responses for the registration
Basically it
pawn Код:
if(dialogid == REGISTRATION1)
{
if(response)
{
PlayerInfo[playerid][pSex] = 1;
SendClientMessage(playerid,COLOR_GRAD3,"You are now a Male");
}
else
{
PlayerInfo[playerid][pSex] = 2;
SendClientMessage(playerid,COLOR_GRAD3,"You are now a Female");
}
ShowPlayerDialog(playerid, REGISTRATION2,DIALOG_STYLE_INPUT,"Government(U.S. Registration) - Account Age Management","Please input your age, make sure you are 17 or older:","Ok","Back");
SavePlayerData(playerid);
}
}
if(dialogid == REGISTRATION2)
{
if (response == 1)
{
if(IsNull(inputtext))
{
SendClientMessage(playerid, COLOR_WHITE, "[ERROR] Type a number in...");
return 1;
}
if(strval(inputtext) <= 16)
{
SendClientMessage(playerid, COLOR_WHITE, "[ERROR] Over 17, please");
return 1;
}
if(strval(inputtext) >= 60)
{
SendClientMessage(playerid, COLOR_WHITE, "[ERROR] Under 60, please");
return 1;
}
PlayerInfo[playerid][pAge] = strval(inputtext);
new string[256], dstring[124];
format(string, sizeof(string), "Your age is now %d ",PlayerInfo[playerid][pAge]);
SendClientMessage(playerid,COLOR_WHITE,string);
SavePlayerData(playerid);
format(dstring, sizeof(dstring), "United States of America\nEurope\nAsia\nAfrica\nRussia");
ShowPlayerDialog(playerid,DACCT6,DIALOG_STYLE_LIST,"Government(U.S. Registration) - Account Origin Management",dstring,"Select","Back");
}
return 0;
}
if (dialogid == REGISTRATION3)
{
if (response == 1)
{
switch (listitem)
{
case 0:
{
PlayerInfo[playerid][pOrigin] = 1;
SendClientMessage(playerid,COLOR_GRAD3,"You are now from United States Of America");
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1642.2334,-2240.4983,13.4952);
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 1);
SavePlayerData(playerid);
}
case 1:
{
PlayerInfo[playerid][pOrigin] = 2;
SendClientMessage(playerid,COLOR_GRAD3,"You are now from Europe");
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1642.2334,-2240.4983,13.4952);
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 1);
SavePlayerData(playerid);
}
case 2:
{
PlayerInfo[playerid][pOrigin] = 3;
SendClientMessage(playerid,COLOR_GRAD3,"You are now from Asia");
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1642.2334,-2240.4983,13.4952);
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 1);
SavePlayerData(playerid);
}
case 3:
{
PlayerInfo[playerid][pOrigin] = 4;
SendClientMessage(playerid,COLOR_GRAD3,"You are now from Africa");
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1642.2334,-2240.4983,13.4952);
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 1);
SavePlayerData(playerid);
}
case 4:
{
PlayerInfo[playerid][pOrigin] = 5;
SendClientMessage(playerid,COLOR_GRAD3,"You are now from Russia");
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1642.2334,-2240.4983,13.4952);
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 1);
SavePlayerData(playerid);
}
}
}
return 0;
}
pawn Код:
#define REGISTRATION1 12348
#define REGISTRATION2 20620
#define REGISTRATION3 20640