PHP код:
switch(5)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
{
case DIALOG_GANGCHANGE:// Our dialog!
{
if(!response) return 0;
switch(listitem)// Checking which listitem was selected
{
case 0:// The first item listed
{
if(PlayerInfo[playerid] [pTeam] == 0) return SendClientMessage(playerid, -1, "You cannot select the same gang.");
SetPlayerTeam(playerid, 0);
PlayerInfo[playerid][pTeam] = 0;
SetSpawnInfo( playerid, 0,186, 2022.1766,1007.5810,10.8203,270.0330, 0, 0, 0, 0, 0, 0 );
SpawnPlayer(playerid);
SendClientMessage(playerid, -1, "Your new gang is Red Dragon Triad.");
}
case 1: // The second item listed
{
if(PlayerInfo[playerid] [pTeam] == 1) return SendClientMessage(playerid, -1, "You cannot select the same gang.");
SetPlayerTeam(playerid, 1);
PlayerInfo[playerid][pTeam] = 1;
SetSpawnInfo( playerid, 1, 112, 2194.3840,1676.9290,12.3672,88.4035, 0, 0, 0, 0, 0, 0 );
SpawnPlayer(playerid);
SendClientMessage(playerid, -1, "Your new gang is The Corleone Family.");
}
}
}
}
if(dialogid == DIALOG_ORDER6)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
{
case 6:// Our dialog!
{
if(!response) return 0;
switch(listitem)// Checking which listitem was selected
{
case 2:// The first item listed
{
GivePlayerWeapon(playerid, 24, 350);
GivePlayerWeapon(playerid, 31, 350);
GivePlayerWeapon(playerid, 32, 550);
GivePlayerMoney(playerid, -5000);
GameTextForPlayer(playerid, "-5000$", 3000, 1);
}
case 3: // The second item listed
{
GivePlayerWeapon(playerid, 24, 350);
GivePlayerWeapon(playerid, 31, 350);
GivePlayerWeapon(playerid, 32, 550);
GivePlayerWeapon(playerid, 4, 1);
GivePlayerWeapon(playerid, 34, 100);
GivePlayerMoney(playerid, -10000);
GameTextForPlayer(playerid, "-10000$", 3000, 1);
}
}
}
}
return 1;
}
}