[HELP] Dialog
#2

What's the difference between the "else" and other "if" ?

Note that your code DOESN'T match a non-response action.
It matches if the listitem isn't 0, 1, 2, 3, 4 or 5.

Do like that :

PHP код:
if(dialogid == 1)
{
    if(
response)
    {
        switch(
listitem)
        {
            case 
0:
            {
                
GivePlayerMoney(playerid, -150);
                
GivePlayerWeapon(playerid141);
                return 
SendClientMessage(playerid0xFFFFFFC8"{FFFFFF}Ai primit o floare pentru {00FF40}150${FFFFFF}.");
            }
            case 
1:
            {
                
GivePlayerMoney(playerid, -1500);
                
GivePlayerWeapon(playerid2350);
                return 
SendClientMessage(playerid0xFFFFFFC8"{FFFFFF}Ai primit un SILENCED 9MM cu 50 gloante pentru {00FF40}1.500${FFFFFF}.");
            }
            case 
2:
            {
                
GivePlayerMoney(playerid, -2500);
                
GivePlayerWeapon(playerid2460);//deagle
                
return SendClientMessage(playerid0xFFFFFFC8"{FFFFFF}Ai primit un DEAGLE cu 60 gloante pentru {00FF40}2.500${FFFFFF}.");
            }
            case 
3:
            {
                
GivePlayerMoney(playerid, -3500);
                
GivePlayerWeapon(playerid2525);
                return 
SendClientMessage(playerid0xFFFFFFC8"{FFFFFF}Ai primit un Shotgun cu 25 gloante pentru {00FF40}3.500${FFFFFF}.");
            }
            case 
4:
            {
                
GivePlayerMoney(playerid, -4500);
                
GivePlayerWeapon(playerid2950);
                return 
SendClientMessage(playerid0xFFFFFFC8"{FFFFFF}Ai primit un MP5 cu 50 gloante pentru {00FF40}4.500${FFFFFF}.");
            }
            case 
5:
            {
                
GivePlayerMoney(playerid, -5500);
                
GivePlayerWeapon(playerid31100);
                return 
SendClientMessage(playerid0xFFFFFFC8"{FFFFFF}Ai primit un M4 cu 100 gloante pentru {00FF40}5.500${FFFFFF}.");
            }
        }
    }
    else return 
SendClientMessage(playeridCOLOR_GREY"* Ai decis sa nu cumperi arme *");

I repaired the error (normally).
Try, tell us, then if it works, ask you what's different between my code and yours.
Reply


Messages In This Thread
[HELP] Dialog - by monster010 - 17.04.2014, 09:05
Re : [HELP] Dialog - by S4t3K - 17.04.2014, 09:22

Forum Jump:


Users browsing this thread: 1 Guest(s)