[HELP] Buygun
#1

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.
Reply
#2

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
Reply
#3

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;
}
Reply
#4

Quote:

Here sort of what you want, at the top just add in "IsPlayerInRangeOfPoint(playerid, x y x);
http://pastebin.com/txCeESt7
Yes thats ViruZZzZ_ChiLLL's right? just tried to put that in the script
it didnt work out

Quote:

The_Moddler

I think its what im looking for do you know how the gun code goes?
Reply
#5

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.
Reply
#6

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
Reply
#7

Appreciate it guys, thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)