[FilterScript] xWeapon Dialog
#1

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


It's Pretty Easy The Command is /weps


PHP код:
#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
Reply
#2

Not bad man! Nice and easy to use, good work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)