Problems with dialogs
#5

Here, I took my time to fix your horrible code:
pawn Код:
if(dialogid == DIALOG_GANGCHANGE)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
{
    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.");
        }
    }
    return 1;
}

else 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.
{
    if(!response) return 0;
    switch(listitem)// Checking which listitem was selected
    {
        case 0:// 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 1: // 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;
}
Reply


Messages In This Thread
Problems with dialogs - by prooftzm - 09.07.2014, 07:37
Re: Problems with dialogs - by Jack_Leslie - 09.07.2014, 07:41
Re: Problems with dialogs - by arlindi - 09.07.2014, 07:57
Re: Problems with dialogs - by Jack_Leslie - 09.07.2014, 08:02
Re: Problems with dialogs - by Jack_Leslie - 09.07.2014, 08:06
Re: Problems with dialogs - by arlindi - 09.07.2014, 08:07

Forum Jump:


Users browsing this thread: 1 Guest(s)