25.12.2013, 02:12
I am creating weapon shop
Need help please some problem occurs
I want that /buygun CMD work on all amunation and i want to change the dialog name
CHeck this codes
Help me ASAP
Need help please some problem occurs
I want that /buygun CMD work on all amunation and i want to change the dialog name
CHeck this codes
Код:
//Weapon Shop by BodyBoardVEVO
#include <a_samp>
#if defined FILTERSCRIPT
#define DIALOG_WEAPONS 3
#define WEAPON_S 10000
#endif
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_WEAPONS)
{
if(response)
{
if(listitem == 0)
{
GivePlayerMoney(playerid, -100);
SetPlayerHealth(playerid, 100); //Health
}
if(listitem == 1)
{
GivePlayerMoney(playerid, -2000);
SetPlayerArmour(playerid, 100); //Armour
}
if(listitem == 2)
{
GivePlayerMoney(playerid, -250);
GivePlayerWeapon(playerid, 22, 99999); //9mm
}
if(listitem == 3)
{
GivePlayerMoney(playerid, -300);
GivePlayerWeapon(playerid, 23, 99999); //Silence Pistol
}
if(listitem == 4)
{
GivePlayerMoney(playerid, -5500);
GivePlayerWeapon(playerid, 24, 99999); //Desert Eagle
}
if(listitem == 5)
{
GivePlayerMoney(playerid, -3000);
GivePlayerWeapon(playerid, 25, 99999); //Shotgun
}
if(listitem == 6)
{
GivePlayerMoney(playerid, -6500);
GivePlayerWeapon(playerid, 29, 99999); //MP5
}
}
return 1;
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/buygun", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 7, 314.820983,-141.431991,999.601562 ))
{
ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapon Shop", "Health - $100\nArmour - $2000\n9mm - $250\nSilence Pistol - $300\nDesert Eagle - $5500\nShotgun - $3000\nMP5 - $6500", "Purchase", "Cancel");
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "You are not at the gun shop.");
}
return 1;
}
if (strcmp("/buygun", cmdtext, true, 15) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 1 ,286.148986,-40.644397,1001.515625 ))
{
ShowPlayerDialog(playerid, 10000, DIALOG_STYLE_LIST, "Weapon Shop", "Health - $100\nArmour - $2000\n9mm - $250\nSilence Pistol - $300\nDesert Eagle - $5500\nShotgun - $3000\nMP5 - $6500", "Purchase", "Cancel");
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "You are not at the gun shop.");
}
return 1;
}
if (strcmp("/buygun", cmdtext, true, 13) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 4 ,286.800994,-82.547599,1001.515625 ))
{
ShowPlayerDialog(playerid, 10000, DIALOG_STYLE_LIST, "Weapon Shop", "Health - $100\nArmour - $2000\n9mm - $250\nSilence Pistol - $300\nDesert Eagle - $5500\nShotgun - $3000\nMP5 - $6500", "Purchase", "Cancel");
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "You are not at the gun shop.");
}
return 1;
}
if (strcmp("/buygun", cmdtext, true, 12) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 6 ,296.919982,-108.071998,1001.515625))
{
ShowPlayerDialog(playerid, 10000, DIALOG_STYLE_LIST, "Weapon Shop", "Health - $100\nArmour - $2000\n9mm - $250\nSilence Pistol - $300\nDesert Eagle - $5500\nShotgun - $3000\nMP5 - $6500", "Purchase", "Cancel");
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "You are not at the gun shop.");
}
return 1;
}
if (strcmp("/buygun", cmdtext, true, 11) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 6 , 316.524993,-167.706985,999.593750))
{
ShowPlayerDialog(playerid, 10000, DIALOG_STYLE_LIST, "Weapon Shop", "Health - $100\nArmour - $2000\n9mm - $250\nSilence Pistol - $300\nDesert Eagle - $5500\nShotgun - $3000\nMP5 - $6500", "Purchase", "Cancel");
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "You are not at the gun shop.");
}
return 1;
}
return 0;
}

