SA-MP Forums Archive
help ASAP please - 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: help ASAP please (/showthread.php?tid=419268)



help ASAP please - Ananisiki - 28.02.2013

^^^^^^^^


Re: help ASAP please - rbush12 - 28.02.2013

Try this

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_WEAPONS)
    {
        if(response)
        {
            if(listitem == 0)
            {
                GivePlayerWeapon(playerid, 9 , 1);
            }
            if(listitem == 1)
            {
                GivePlayerWeapon(playerid, 22, 3000);
            }
            if(listitem == 2)
            {
                GivePlayerWeapon(playerid, 23, 3000);
            }
            if(listitem == 3)
            {
                GivePlayerWeapon(playerid, 24 , 3000);
            }
            if(listitem == 4)
            {
                GivePlayerWeapon(playerid, 25 , 3000);
            }
            if(listitem == 5)
            {
                GivePlayerWeapon(playerid, 26 , 3000);
            }
            if(listitem == 6)
            {
                GivePlayerWeapon(playerid, 27 , 3000);
            }
            if(listitem == 7)
            {
                GivePlayerWeapon(playerid, 28,  3000);
            }
            if(listitem == 8)
            {
                GivePlayerWeapon(playerid, 29 , 3000);
            }
            if(listitem == 9)
            {
                GivePlayerWeapon(playerid, 30,  3000);
            }
            if(listitem == 10)
            {
                GivePlayerWeapon(playerid, 31,  3000);
            }
            if(listitem == 11)
            {
                GivePlayerWeapon(playerid, 32 ,  3000);
            }
            if(listitem == 12)
            {
                GivePlayerWeapon(playerid, 33 , 3000);
            }
            if(listitem == 13)
            {
                GivePlayerWeapon(playerid, 34 , 3000);
            }
        }
    }
    if(dialogid == DIALOG_MUSIC)
    {
        if(response)
        {
            if(listitem == 0)
            {
               PlayAudioStreamForPlayer(playerid, "http://dl.dropbox.com/u/147528710/Montana%20Server%20Music/2Pac%20-%20When%20We%20Ride%20On%20Our%20Enemies.mp3");
            }
            if(listitem == 1)
            {
               PlayAudioStreamForPlayer(playerid, "http://dl.dropbox.com/u/147528710/Montana%20Server%20Music/Meek%20Mill%20-%20Moment%204%20Life.mp3");
            }
            if(listitem == 2)
            {
               PlayAudioStreamForPlayer(playerid, "http://dl.dropbox.com/u/147528710/Montana%20Server%20Music/DMX%20-%20X%20Gonna%20Give%20It%20To%20Ya.mp3");
            }
            if(listitem == 3)
            {
               PlayAudioStreamForPlayer(playerid, "http://dl.dropbox.com/u/147528710/Montana%20Server%20Music/Meek%20Mill%20ft%20Rick%20Ross%20-%20Im%20A%20Boss.mp3");
            }
            if(listitem == 4)
            {
               PlayAudioStreamForPlayer(playerid, "http://dl.dropbox.com/u/147528710/Montana%20Server%20Music/Lights%20(Bassnectar%20Remix).mp3");
            }
            if(listitem == 5)
            {
               PlayAudioStreamForPlayer(playerid, "http://dl.dropbox.com/u/147528710/Montana%20Server%20Music/Drake%20-%20Im%20on%20One.mp3");
            }
            if(listitem == 6)
            {
               PlayAudioStreamForPlayer(playerid, "http://dl.dropbox.com/u/147528710/Montana%20Server%20Music/Biggie%20Smalls%20-%20Who%20Shot%20Ya.mp3");
            }
            if(listitem == 7)
            {
               PlayAudioStreamForPlayer(playerid, "http://dl.dropbox.com/u/147528710/Montana%20Server%20Music/Mann%20Ft.%2050%20Cent%20-%20Buzzin.mp3");
            }
            if(listitem == 8)
            {
               PlayAudioStreamForPlayer(playerid, "http://dl.dropbox.com/u/147528710/Montana%20Server%20Music/Young%20Don%20ft.%20Ratlin%20-%20Go%20Hard.mp3");
            }
            if(listitem == 9)
            {
               PlayAudioStreamForPlayer(playerid, "http://dl.dropbox.com/u/147528710/Montana%20Server%20Music/Meek%20Mill%20-%20Ya%E2%80%99ll%20Don%E2%80%99t%20Hear%20Me.mp3");
            }
            if(listitem == 10)
            {
               PlayAudioStreamForPlayer(playerid, "http://dl.dropbox.com/u/147528710/Montana%20Server%20Music/Birdman%20%20Ft.%20Drake%20%26%20Lil%20Wayne%20-%20Money%20To%20Blow.mp3");
            }
        }
        return 1;
    }
    return 0;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}



Re: help ASAP please - park4bmx - 28.02.2013

Let me shorten this for you
pawn Код:
for(new count=1; <11; count++)
{
      if(listitem == count) return GivePlayerWeapon(playerid, count+21, 3000);
}
This goes inside the switch and after the first listitem
Ps: I'm using my phone so Yh..


Re: help ASAP please - Scenario - 28.02.2013

And... by the way, use switch statements.