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.