SA-MP Forums Archive
Dialog System not working - 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: Dialog System not working (/showthread.php?tid=387910)



Dialog System not working - Eminem 2ka9 - 26.10.2012

I have a dialog and it displays which class you wanna spawn as, but when i click the assault class (first on the list)
then i don't get any weapons, but everything else works properly, just not the very first one..
Also, how do I put a thing where players can only choose a class if they have a certain score.. I coded it but It don't seem to be working either.

here is my response

pawn Код:
//============================Dialog System===================================//
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
            if(dialogid == 60)
            {
                if(response)
                    {

                        if(GetPlayerScore(playerid) <= 0)//Private
                        {

                        gPlayerClass[playerid] = ASSAULT_CLASS;
                        PickedClass[playerid] = 1;
                        GivePlayerWeapon(playerid, 24, 200);
                        GivePlayerWeapon(playerid, 31, 500);
                        GivePlayerWeapon(playerid, 17, 5);

                }

            }
    }


                if(listitem == 0)//sniper DONE
{
                        if(GetPlayerScore(playerid) <= 10)//Private
{
                            gPlayerClass[playerid] = SNIPER_CLASS;
                            PickedClass[playerid] = 1;
                            GivePlayerWeapon(playerid, 23, 500);
                            GivePlayerWeapon(playerid, 34, 100);
                            GivePlayerWeapon(playerid, 29, 200);





     }
                }


                if(listitem == 1)//pilot DONE
                    {
                            if(GetPlayerScore(playerid) <= 1150)//Lieutenant Colonel

                            {

                            gPlayerClass[playerid] = AIRMAN_CLASS;
                            PickedClass[playerid] = 1;
                            GivePlayerWeapon(playerid, 22, 50);
                            GivePlayerWeapon(playerid, 29, 500);
                            GivePlayerWeapon(playerid, 16, 5);


                    }
                }
                if(listitem == 2)//Engineer
                    {
                            if(GetPlayerScore(playerid) <= 250)//Sergeant

                            {
                            gPlayerClass[playerid] = ENGINEER_CLASS;
                            PickedClass[playerid] = 1;
                            GivePlayerWeapon(playerid, 22, 100);
                            GivePlayerWeapon(playerid, 32, 500);
                            GivePlayerWeapon(playerid, 35, 5);

                            }
                }

                if(listitem == 3)//FlameThrower
                    {
                            if(GetPlayerScore(playerid) <= 400)//CAPTAIN

                            {


                            gPlayerClass[playerid] = FLAMETHROWER_CLASS;
                            PickedClass[playerid] = 1;
                            GivePlayerWeapon(playerid, 24, 200);
                            GivePlayerWeapon(playerid, 30, 200);
                            GivePlayerWeapon(playerid, 37, 200);
}
        }
        return 1;
    }



Re: Dialog System not working - dr.lozer - 26.10.2012

Use This:

Код:
if(GetPlayerScore(playerid) <= 0) //Private
Should Be
Код:
if(GetPlayerScore(playerid) >= 0) //Private