SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 23/09/2012, 12:04 PM   #1
Mazen771998
Banned
 
Join Date: Oct 2011
Posts: 50
Reputation: 7
Post xWeapon Dialog

Hello,
Today i am Giving You Simple Weapon Dialog..


It's Pretty Easy The Command is /weps


PHP Code:
#include <a_samp>

#define DIALOGID 1337


public OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/weps"cmdtexttrue10) == 0)
    {
        
ShowPlayerDialog(playeridDIALOGIDDIALOG_STYLE_LIST"Weapon Lists""Melee\nPistols\nSub-Machine Guns\nRifle's\nAssault\nShotgun's\nHeavy Weapons\nThrown\nMisc""Select""Cancel");
        return 
1;
    }
    return 
0;
}

public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == DIALOGID)
    {
        if(
response)
        {
            if(
listitem == 0// Meele
            
{
                
ShowPlayerDialog(playeridDIALOGID+1DIALOG_STYLE_LIST"Select a Weapon""Knuckle Dusters\nGolf Club\nNite Stick\nKnife\nBat\nShovel\nPool Cue\nKatana\nDildo\nSpray Can\nCane""Select""Cancel");
            }
            if(
listitem == 1// Pistols
            
{
                
ShowPlayerDialog(playeridDIALOGID+2DIALOG_STYLE_LIST"Select a Weapon""9mm\nSilenced 9mm\nDesert Eagle""Select""Cancel");
            }
            if(
listitem == 2// Sub-Machine Guns
            
{
                
ShowPlayerDialog(playeridDIALOGID+3DIALOG_STYLE_LIST"Select a Weapon""Uzi\nSMG\nTec9""Select""Cancel");
            }
            if(
listitem == 3// Rifles
            
{
                
ShowPlayerDialog(playeridDIALOGID+4DIALOG_STYLE_LIST"Select a Weapon""Country Rifle\nSniper Rifle""Select""Cancel");
            }
            if(
listitem == 4// Assault
            
{
                
ShowPlayerDialog(playeridDIALOGID+5DIALOG_STYLE_LIST"Select a Weapon""AK-47\nM4""Select""Cancel");
            }
            if(
listitem == 5// Shotguns
            
{
                
ShowPlayerDialog(playeridDIALOGID+6DIALOG_STYLE_LIST"Select a Weapon""Standard Shotgun\nSawnoff Shotgun\nCombat Shotgun""Select""Cancel");
            }
   if(
listitem == 6// Heavy Weaponry
            
{
                
ShowPlayerDialog(playeridDIALOGID+7DIALOG_STYLE_LIST"Select a Weapon""Rocket Laucher\nHeat Seaker\nMinigun\nChain Saw""Select""Cancel");
            }
            if(
listitem == 7// Thrown
            
{
                
ShowPlayerDialog(playeridDIALOGID+8DIALOG_STYLE_LIST"Select a Weapon""Granade\nTear Gas""Select""Cancel");
            }
            if(
listitem == 8// Misc
            
{
                
ShowPlayerDialog(playeridDIALOGID+9DIALOG_STYLE_LIST"Select a Weapon""Fire Extinguisher\nSatchel Charge\nParachute\nNightvision Goggles\nFlowers""Select""Cancel");
            }
        }
        return 
1;
    }

    if(
dialogid == DIALOGID+1// Meele
    
{
        if(
response)
        {
            if(
listitem == 0)
            {
                
GivePlayerWeapon(playerid11);
            }
            if(
listitem == 1)
            {
                
GivePlayerWeapon(playerid21);
            }
            if(
listitem == 2)
            {
                
GivePlayerWeapon(playerid31);
            }
            if(
listitem == 3)
            {
                
GivePlayerWeapon(playerid41);
            }
            if(
listitem == 4)
            {
                
GivePlayerWeapon(playerid51);
            }
            if(
listitem == 5)
            {
                
GivePlayerWeapon(playerid61);
            }
            if(
listitem == 6)
            {
                
GivePlayerWeapon(playerid71);
            }
            if(
listitem == 7)
            {
                
GivePlayerWeapon(playerid81);
            }
            if(
listitem == 8)
            {
                
GivePlayerWeapon(playerid101);
            }
            if(
listitem == 9)
            {
                
GivePlayerWeapon(playerid41500);
            }
            if(
listitem == 10)
            {
                
GivePlayerWeapon(playerid151);
            }
        }
        return 
1;
    }

    if(
dialogid == DIALOGID+2// Pistols
    
{
        if(
response)
        {
            if(
listitem == 0)
            {
                
GivePlayerWeapon(playerid22500);
            }
            if(
listitem == 1)
            {
                
GivePlayerWeapon(playerid23500);
            }
            if(
listitem == 2)
            {
                
GivePlayerWeapon(playerid24500);
            }
        }
        return 
1;
    }

    if(
dialogid == DIALOGID+3// Sub's
    
{
        if(
response)
        {
            if(
listitem == 0)
            {
                
GivePlayerWeapon(playerid28500);
            }
            if(
listitem == 1)
            {
                
GivePlayerWeapon(playerid29500);
            }
            if(
listitem == 2)
            {
                
GivePlayerWeapon(playerid32500);
            }
        }
        return 
1;
    }

    if(
dialogid == DIALOGID+4// Rifle's
    
{
        if(
response)
        {
            if(
listitem == 0)
            {
                
GivePlayerWeapon(playerid33500);
            }
            if(
listitem == 1)
            {
                
GivePlayerWeapon(playerid34500);
            }
        }
        return 
1;
    }

    if(
dialogid == DIALOGID+5// Assault
    
{
        if(
response)
        {
            if(
listitem == 0)
            {
                
GivePlayerWeapon(playerid30500);
            }
            if(
listitem == 1)
            {
                
GivePlayerWeapon(playerid31500);
            }
        }
        return 
1;
    }

    if(
dialogid == DIALOGID+6// Shotguns
    
{
        if(
response)
        {
            if(
listitem == 0)
            {
                
GivePlayerWeapon(playerid25500);
            }
            if(
listitem == 1)
            {
                
GivePlayerWeapon(playerid26500);
            }
            if(
listitem == 2)
            {
                  
GivePlayerWeapon(playerid27500);
            }
        }
        return 
1;
    }

    if(
dialogid == DIALOGID+7// Heavy Weapons
    
{
        if(
response)
        {
            if(
listitem == 0)
            {
                
GivePlayerWeapon(playerid35500);
            }
            if(
listitem == 1)
            {
                
GivePlayerWeapon(playerid36500);
            }
            if(
listitem == 2)
            {
                
GivePlayerWeapon(playerid38500);
            }
            if(
listitem == 3)
            {
                
GivePlayerWeapon(playerid9500);
            }
        }
        return 
1;
    }

    if(
dialogid == DIALOGID+8// Thrown
    
{
        if(
response)
        {
            if(
listitem == 0)
            {
                
GivePlayerWeapon(playerid16500);
            }
            if(
listitem == 1)
            {
                
GivePlayerWeapon(playerid17500);
            }
        }
        return 
1;
    }

    if(
dialogid == DIALOGID+9// Misc Fire Extinguisher\nSatchel Charge\nParachute\nNightvision Goggles\nFlowers
    
{
        if(
response)
        {
            if(
listitem == 0)
            {
                
GivePlayerWeapon(playerid42500);
            }
            if(
listitem == 1)
            {
                
GivePlayerWeapon(playerid39500);
                
GivePlayerWeapon(playerid401);
            }
            if(
listitem == 2)
            {
                
GivePlayerWeapon(playerid461);
            }
            if(
listitem == 3)
            {
                
GivePlayerWeapon(playerid441);
            }
            if(
listitem == 4)
            {
                
GivePlayerWeapon(playerid141);
            }
        }
        return 
1;
    }

    return 
0;
 } 

EnJoY
Mazen771998 is offline   Reply With Quote
Old 23/09/2012, 01:52 PM   #2
NoahF
Huge Clucker
 
NoahF's Avatar
 
Join Date: Jul 2012
Location: Connecticut, USA.
Posts: 485
Reputation: 63
Default Re: xWeapon Dialog

Not bad man! Nice and easy to use, good work.
NoahF is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Pedido] ID casas/empresas | [Dialog] Skin ORG | /AlugarCarro [Dialog] Coringa_Vilao Português/Portuguese 13 16/09/2012 04:08 PM
[Dialog] Listing MySQL data inside a List Dialog vIBIENNYx Scripting Help 11 10/09/2012 11:19 PM
[19:58:45] Warning: PlayerDialogResponse PlayerId: 28 dialog ID doesn't match last sent dialog ID, what it means? niels44 Scripting Help 6 13/06/2012 05:53 PM
Dialog response not Sending Message [Input Dialog] Deal-or-die Scripting Help 8 08/05/2012 01:10 PM
[PEDIDO] Dialog em Spawn e Dialog ao Entrar no veículo ViCtOr_Mc Português/Portuguese 8 27/05/2011 05:13 PM


All times are GMT. The time now is 12:18 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.