SA-MP Forums Archive
Weapon Menu - 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: Weapon Menu (/showthread.php?tid=472824)



Weapon Menu - lulo356 - 31.10.2013

YO guys/Girls,

How can you create a Weapon Menu, but there need to be Only VIP weapons in it to, How can you create that ^^


Re: Weapon Menu - Brandon_More - 31.10.2013

Give me Variables..


Re: Weapon Menu - Brandon_More - 31.10.2013

OnPlayerKeyChange: (Optional)

Please change the VIP variable.

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_YES)
	{
		if(PlayerInfo[playerid][vip] < 1)
	    	return SendClientMessage(playerid, COLOR_RED, "You are not allowed to use this command");
		ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "{FF9933}Weapon Menu for {EEEEEE}VIP {FF9933}MEMBERS", "9mm\nSilencer\nDeagle\nShotgun\nSpawn Off\nCombat\nMicro Uzi\nMP5\nAK-47\nM4\nTEC-9\nCountry Rifle\nSniper Rifle\nRPG\nHS Rocket\nFlame Thrower\nMini-Gun\nParachute", "Ok", "Cancel");
	}
	return 1;
}
OnDialogResponse (Needed):

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if (dialogid == 0 && response == 1) //First dialog response /teleports
    {
    	switch (listitem)
     	{
			//"9mm\nSilencer\nDeagle\nShotgun\nSpawn Off\nCombat\nMicro Uzi\nMP5\nAK-47\nM4\nTEC-9\nCountry Rifle\nSniper Rifle\nRPG\nHS Rocket\nFlame Thrower\nMini-Gun\nParachute"
    		case 0: //9mm
     		{
     		    GivePlayerWeapon(playerid, 22, 250);
     		    SendClientMessage(playerid,COLOR_WHITE,"You have been equiped with a 9mm enjoy");
   			}
    		case 1: //Silencer
     		{
     		    GivePlayerWeapon(playerid, 23, 250);
     		    SendClientMessage(playerid,COLOR_WHITE,"You have been equiped with a Silencer enjoy");
   			}
    		case 2: //Deagle
     		{
     		    GivePlayerWeapon(playerid, 24, 250);
     		    SendClientMessage(playerid,COLOR_WHITE,"You have been equiped with a Deagle enjoy");
   			}
    		case 3: //Shotgun
     		{
     		    GivePlayerWeapon(playerid, 25, 250);
     		    SendClientMessage(playerid,COLOR_WHITE,"You have been equiped with a Shotgun enjoy");
   			}
    		case 4: //Spawn Off
     		{
     		    GivePlayerWeapon(playerid, 26, 250);
     		    SendClientMessage(playerid,COLOR_WHITE,"You have been equiped with a Spawn off enjoy");
   			}
       		case 5: //Combat Shotgun
     		{
     		    GivePlayerWeapon(playerid, 27, 250);
     		    SendClientMessage(playerid,COLOR_WHITE,"You have been equiped with a Combat Shotgun enjoy");
   			}
       		case 6: //Micro SMG
     		{
     		    GivePlayerWeapon(playerid, 28, 250);
     		    SendClientMessage(playerid,COLOR_WHITE,"You have been equiped with a Micro UZI enjoy");
   			}
       		case 7: //MP5
     		{
     		    GivePlayerWeapon(playerid, 29, 250);
     		    SendClientMessage(playerid,COLOR_WHITE,"You have been equiped with a mp5 enjoy");
   			}
       		case 8: //AK-47
     		{
     		    GivePlayerWeapon(playerid, 30, 250);
     		    SendClientMessage(playerid,COLOR_WHITE,"You have been equiped with a AK-47 enjoy");
   			}
       		case 9: //m4
     		{
     		    GivePlayerWeapon(playerid, 31, 250);
     		    SendClientMessage(playerid,COLOR_WHITE,"You have been equiped with a m4 enjoy");
   			}
       		case 10: //Tec-9
     		{
     		    GivePlayerWeapon(playerid, 32, 250);
     		    SendClientMessage(playerid,COLOR_WHITE,"You have been equiped with a Tec-9 enjoy");
   			}
       		case 11: //Country Rifle
     		{
     		    GivePlayerWeapon(playerid, 33, 250);
     		    SendClientMessage(playerid,COLOR_WHITE,"You have been equiped with a Country Rifle enjoy");
   			}
       		case 12: //Sniper Rifle
     		{
     		    GivePlayerWeapon(playerid, 34, 250);
     		    SendClientMessage(playerid,COLOR_WHITE,"You have been equiped with a Sniper enjoy");
   			}
       		case 13: //RPG
     		{
     		    GivePlayerWeapon(playerid, 35, 250);
     		    SendClientMessage(playerid,COLOR_WHITE,"You have been equiped with a RPG enjoy");
   			}
       		case 14: //HS Rocket
     		{
     		    GivePlayerWeapon(playerid, 36, 250);
     		    SendClientMessage(playerid,COLOR_WHITE,"You have been equiped with a HS Rocket enjoy");
   			}
    		case 15: //Flame-thrower
     		{
     		    GivePlayerWeapon(playerid, 37, 250);
     		    SendClientMessage(playerid,COLOR_WHITE,"You have been equiped with a Flame Thrower enjoy");
   			}
    		case 16: //Mini Gun
     		{
     		    GivePlayerWeapon(playerid, 38, 250);
     		    SendClientMessage(playerid,COLOR_WHITE,"You have been equiped with a Mini Gun enjoy");
   			}
    		case 17: //Parachute
     		{
     		    GivePlayerWeapon(playerid, 46, 250);
     		    SendClientMessage(playerid,COLOR_WHITE,"You have been equiped with a Parachute enjoy");
   			}
		}
    }
	else if(dialogid == 0 && response == 0) return SendClientMessage(playerid, COLOR_WHITE, "Cancelled.");
	return 1;
}
Command (Needed):

Please change the VIP variable..

Код:
COMMAND:wepmenu(playerid, params[])
{
	if(PlayerInfo[playerid][vip] < 1)
	    return SendClientMessage(playerid, COLOR_RED, "You are not allowed to use this command");
	ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "{FF9933}Weapon Menu for {EEEEEE}VIP {FF9933}MEMBERS", "9mm\nSilencer\nDeagle\nShotgun\nSpawn Off\nCombat\nMicro Uzi\nMP5\nAK-47\nM4\nTEC-9\nCountry Rifle\nSniper Rifle\nRPG\nHS Rocket\nFlame Thrower\nMini-Gun\nParachute", "Ok", "Cancel");
	return 1;
}



Re: Weapon Menu - Keyhead - 31.10.2013

pawn Код:
enum pInfo {

    pDonater,

}

new Player[MAX_PLAYERS][pInfo];

CMD:gunmenu(playerid, params[])
{
    if(Player[playerid][pDonater] == 1)
    {
        ShowPlayerDialog(playerid, 10, DIALOG_STYLE_LIST, "Weapon Menu","Pistols\nShotguns","Continue","Cancel");
    }
    else if(Player[playerid][pDonater] == 0)
    {
        SendClientMessage(playerid, -1, "You're not a donator!");
    }
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 10)
    {
        if(listitem == 0)
        {
            ShowPlayerDialog(playerid, 20, DIALOG_STYLE_LIST, "Pistols","Colt\nSilenced Colt\nDeagle","Spawn","Cancel");
        }
        if(listitem == 1)
        {
            ShowPlayerDialog(playerid, 30, DIALOG_STYLE_LIST, "Shotguns","Pump Shotgun\nSawn-Off Shotgun\nCombat Shotgun","Spawn","Cancel");
        }
    }
    if(dialogid == 20)
    {
        if(listitem == 0)
        {
            SendClientMessage(playerid, -1, "You have spawned a Colt!");
            GivePlayerWeapon(playerid,22,1000);
        }
        if(listitem == 1)
        {
            SendClientMessage(playerid, -1, "You have spawned a Silenced Colt!");
            GivePlayerWeapon(playerid,23,1000);
        }
        if(listitem == 2)
        {
            SendClientMessage(playerid, -1, "You have spawned a Deagle!");
            GivePlayerWeapon(playerid, 24,1000);
        }
    }
    if(dialogid == 30)
    {
        if(listitem == 0)
        {
            SendClientMessage(playerid, -1, "You have spawned a Pump-Shotgun!");
            GivePlayerWeapon(playerid, 25,1000);
        }
        if(listitem == 1)
        {
            SendClientMessage(playerid, -1, "You have spawned a Sawn-Off Shotgun");
            GivePlayerWeapon(playerid, 26,1000);
        }
        if(listitem == 2)
        {
            SendClientMessage(playerid, -1, "You have spawned a Combat Shotgun!");
            GivePlayerWeapon(playerid, 27,1000);
        }
    }
    return 1;
}



Re: Weapon Menu - RayDcosta - 31.10.2013

just take brandon more's code and replace vip with pDonater (as given in your code) and change the variables to suit ur need. he has written the whole code for u what else do u need?
cheers