[HELP] Buygun - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Buygun (
/showthread.php?tid=189256)
[HELP] Buygun -
NotoriousMOB - 10.11.2010
Im making a Black market
now i need a buygun code with a rangepoint that takes money when you buy the gun.
And yes i been looking on the forum but can't really find what im searching for so i hope someone out there has a code they can share.
Okay thanks.
Re: [HELP] Buygun -
Haydz - 10.11.2010
Here sort of what you want, at the top just add in "IsPlayerInRangeOfPoint(playerid, range x y x); and you can edit/add more weapons etc.
http://pastebin.com/txCeESt7
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Re: [HELP] Buygun -
The_Moddler - 10.11.2010
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/buygun", false))
{
if(!IsPlayerInRangeOfPoint(playerid, 3.5, /* your X, Y and Z goes here*/)) return SendClientMessage(playerid, 0xF0F0F0FF, "You are not in the black market!");
{
/* your buy gun code goes here */
}
}
return 0;
}
Re: [HELP] Buygun -
NotoriousMOB - 10.11.2010
Yes thats ViruZZzZ_ChiLLL's right? just tried to put that in the script
it didnt work out
I think its what im looking for do you know how the gun code goes?
Re: [HELP] Buygun -
Haydz - 11.11.2010
Quote:
Originally Posted by NotoriousMOB
Yes thats ViruZZzZ_ChiLLL's right? just tried to put that in the script
it didnt work out
I think its what im looking for do you know how the gun code goes?
|
Yeh it is, post everything under OnPlayercommandText and sombody will add it for you.
Re: [HELP] Buygun -
audifan00 - 11.11.2010
like this..
Quote:
if(!strcmp(cmdtext, "/buyShotgun", false))
{
if(!IsPlayerInRangeOfPoint(playerid, 3.5, /* your X, Y and Z goes here*/)) return SendClientMessage(playerid, 0xF0F0F0FF, "You are not in the black market!");
{
GivePlayerWeapon(playerid, 26, 500); //Give playerid sawnoff shotgun with 500 ammo
return 1;
}
|
You should add this in your gamemode under onplayercommandtext
you can make many command like "/buyshotgun" "/buytec" etc, but i recomend you to make a dialog which will look better and is easier to use.
Here is the full list of weapons:
http://weedarr.wikidot.com/gunlist
Just take the gun id you want and place it instead of "weaponid"
GivePlayerWeapon(playerid, weaponid, 500); //500 is the ammo, you can change it too
Hope i helped
Re: [HELP] Buygun -
NotoriousMOB - 11.11.2010
Appreciate it guys, thank you.