InRangeOfPoint Problems - 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: InRangeOfPoint Problems (
/showthread.php?tid=435639)
InRangeOfPoint Problems -
yaron0600 - 07.05.2013
Hey I've just made a Dialog of weapons to buy and I want to know where should I define the : InRangeOfPoint - In Ammunation only , Than how to create in that cmd the InRangeOfPoint ? ? ?:
This is the Command Code :
Code:
CMD:buyweapon(playerid, params[])
{
ShowPlayerDialog(playerid, 2812, DIALOG_STYLE_LIST, "Buy Gun", "SDPistol-2,000$\nShotgun-5,000$\nMP5-4,000$\nDeagle-30,000$\nM4[Limited 500 bullets]-60,000$\nAK47[Limited 500 bullets]-50,000$", "Select", "Cancel");
return 1;
}
This is the Dialog Code :
Code:
if(dialogid == BUYWEAPONMENU) // BUYWEAPONMENU
{
if(response)
{
if(listitem == 0)
{
GivePlayerValidWeapon(playerid, 23, 99999);
GivePlayerCash(playerid, -2000);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE," You have purchased a silenced pistol!");
return 1;
}
if(listitem == 1)
{
GivePlayerValidWeapon(playerid, 25, 99999);
GivePlayerCash(playerid, -5000);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE," You have purchased a shotgun!");
}
if(listitem == 2)
{
GivePlayerValidWeapon(playerid, 29, 99999);
GivePlayerCash(playerid, -4000);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE," You have purchased a MP5!");
}
if(listitem == 3)
{
GivePlayerValidWeapon(playerid, 24, 99999);
GivePlayerCash(playerid, -30000);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE," You have purchased a Deagle!");
}
if(listitem == 4)
{
GivePlayerValidWeapon(playerid, 31, 500);
GivePlayerCash(playerid, -60000);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE," You have purchased a M4 - 500 Bullets!");
}
if(listitem == 5)
{
GivePlayerValidWeapon(playerid, 30, 99999);
GivePlayerCash(playerid, -50000);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE," You have purchased a AK/47 - 500 Bullets!");
}
}
}
Re: InRangeOfPoint Problems -
BigGroter - 07.05.2013
pawn Code:
CMD:buyweapon(playerid, params[])
{
if(!IsPlayerInRangeOfPoint(playerid, range, x, y, z)) return SendClientMessage(playerid, -1, "You are not in range of the ammunation!");
ShowPlayerDialog(playerid, 2812, DIALOG_STYLE_LIST, "Buy Gun", "SDPistol-2,000$\nShotgun-5,000$\nMP5-4,000$\nDeagle-30,000$\nM4[Limited 500 bullets]-60,000$\nAK47[Limited 500 bullets]-50,000$", "Select", "Cancel");
return 1;
}