Vip Gun menu
#1

Hi , How to creat weapon menu that vips can buy weapons for this script , can someone give me a Example ?

PHP код:
stock
    bool
:False false
;
#define VipCheck(%0,%1)\
        
do{\
               if(
P_DATA[(%0)][Vip] < (%1)){\
                new 
Str[128];\
                
format(Str128"You don't have acces to use this command!", (%1));\
                return 
GameTextForPlayer((%0), Str30004);\
            }\
        }\
        while(
False
Thanks for help
Reply
#2

I'm gonna be nice, and give you some of my weapons dialog code.

Код:
CMD:weapons(playerid, params[])
{
	if(busy[playerid] == 1)
	{
	    SendClientMessage(playerid, red,"[ERROR]: You can't use this command while you are in Paintball!"); // if you type an invalid or an existing command (while you are busy) it will return this error message.
	    return 1;
	}
	ShowPlayerDialog(playerid, WEAPONS, DIALOG_STYLE_LIST, "{00DE28}Purchase Weapons", "Knife - $500\nKatana - $1500\nSilence Pistol - $7500\nShotgun - $12500\nDesert Eagle - $10000\nSawnoff - $20000\nMP5 - $17500\nM4 - $35000\nSniper - $100000\nRPG - $150000", "Buy", "Cancel");
	return 1;
}
OnDialogResponse:

Код:
if(dialogid == WEAPONS)//Weapons
	{
		if(listitem == 0)
		{
            if(GetPlayerMoney(playerid) >= 500)
            {
				GivePlayerWeapon(playerid, 4, 9999);
				GivePlayerMoney(playerid, -500);
				SendClientMessage(playerid, green, "*You have bought a Knife!");
			}
			else
			{
				SendClientMessage(playerid, red, "[ERROR]: You don't have enough money to purchase this weapon!");
			}
		}
		if(listitem == 1)
		{
			if(GetPlayerMoney(playerid) >= 1500)
			{
				GivePlayerWeapon(playerid, 8, 9999);
				GivePlayerMoney(playerid, -1500);
				SendClientMessage(playerid, green, "*You have bought a Katana!");
			}
			else
			{
				SendClientMessage(playerid, red, "[ERROR]: You don't have enough money to purchase this weapon!");
			}
		}
		if(listitem == 2)
		{
			if(GetPlayerMoney(playerid) >= 7500)
			{
				GivePlayerWeapon(playerid, 23, 125);
				GivePlayerMoney(playerid, -7500);
				SendClientMessage(playerid, green, "*You have bought a Silenced Pistol!");
			}
			else
			{
				SendClientMessage(playerid, red, "[ERROR]: You don't have enough money to purchase this weapon!");
			}
		}
		if(listitem == 3)
		{
			if(GetPlayerMoney(playerid) >= 12500)
			{
				GivePlayerWeapon(playerid, 25, 125);
				GivePlayerMoney(playerid, -12500);
				SendClientMessage(playerid, green, "*You have bought a Shotgun!");
			}
			else
			{
				SendClientMessage(playerid, red, "[ERROR]: You don't have enough money to purchase this weapon!");
			}
		}
 		if(listitem == 4)
		{
			if(GetPlayerMoney(playerid) >= 10000)
			{
				GivePlayerWeapon(playerid, 24, 125);
				GivePlayerMoney(playerid, -10000);
				SendClientMessage(playerid, green, "*You have bought a Desert Eagle!");
			}
			else
			{
				SendClientMessage(playerid, red, "[ERROR]: You don't have enough money to purchase this weapon!");
			}
		}
		if(listitem == 5)
		{
			if(GetPlayerMoney(playerid) >= 20000)
			{
				GivePlayerWeapon(playerid, 26, 125);
				GivePlayerMoney(playerid, -20000);
				SendClientMessage(playerid, green, "*You have bought a Sawnoff Shotgun!");
			}
			else
			{
				SendClientMessage(playerid, red, "[ERROR]: You don't have enough money to purchase this weapon!");
			}
		}
		if(listitem == 6)
		{
			if(GetPlayerMoney(playerid) >= 17500)
			{
				GivePlayerWeapon(playerid, 29, 125);
				GivePlayerMoney(playerid, -17500);
				SendClientMessage(playerid, green, "*You have bought an MP5!");
			}
			else
			{
				SendClientMessage(playerid, red, "[ERROR]: You don't have enough money to purchase this weapon!");
			}
		}
		if(listitem == 7)
		{
			if(GetPlayerMoney(playerid) >= 35000)
			{
				GivePlayerWeapon(playerid, 31, 125);
				GivePlayerMoney(playerid, -35000);
				SendClientMessage(playerid, green, "*You have bought an M4!");
			}
			else
			{
				SendClientMessage(playerid, red, "[ERROR]: You don't have enough money to purchase this weapon!");
			}
		}
		if(listitem == 8)
		{
			if(GetPlayerMoney(playerid) >= 100000)
			{
				GivePlayerWeapon(playerid, 34, 25);
				GivePlayerMoney(playerid, -100000);
				SendClientMessage(playerid, green, "*You have bought a Sniper!");
			}
			else
			{
				SendClientMessage(playerid, red, "[ERROR]: You don't have enough money to purchase this weapon!");
			}
		}
		if(listitem == 9)
		{
			if(GetPlayerMoney(playerid) >= 150000)
			{
				GivePlayerWeapon(playerid, 35, 5);
				GivePlayerMoney(playerid, -150000);
				SendClientMessage(playerid, green, "*You have bought an RPG!");
			}
			else
			{
				SendClientMessage(playerid, red, "[ERROR]: You don't have enough money to purchase this weapon!");
			}
		}
	}
Just add this to your VIP system, and add VIP restrictions.
Reply
#3

Thanks man , i can make only one case
how make another case ? when i try to make another case get some error ,
can u only make me 1 case for example
PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
  new 
Float:XFloat:YFloat:Z;
  
GetPlayerPos(playeridXYZ);
  if(
dialogid == DIALOGCMDS)
  {
    switch(
listitem)
    {
       case 
0:
       {
            if(
PlayerInfo[playerid][pVIP] >= 1)
            {
            if(
GetPlayerMoney(playerid) >= 500)
            {
                
GivePlayerWeapon(playerid49999);
                
GivePlayerMoney(playerid, -500);
                
SendClientMessage(playeridBLUE"You have bought a Knife!");
            }
            else return 
SendClientMessage(playeridRED"[ERROR]: You don't have enough money to purchase this weapon!");
            }
         }
      }
   }
   return 
0;

Reply
#4

np i fix it sorry for double post!
Closed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)