SA-MP Forums Archive
(simple command) /buy - 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: (simple command) /buy (/showthread.php?tid=503318)



(simple command) /buy - vegaltasendai - 29.03.2014

I need a simple command
/buy flowers 300 and bouquet to use me flowers


Re: (simple command) /buy - RenovanZ - 29.03.2014

pawn Код:
CMD:buy(playerid, params[])
{
     GivePlayerWeapon(playerid, idweapon);
     GivePlayerMoney(playerid, -money);
     return 1;
}



Re: (simple command) /buy - vegaltasendai - 29.03.2014

If it worked, but I forgot to say I wanted to add thanks cordenates where that command is used, for example in an indoor


Re: (simple command) /buy - RenovanZ - 29.03.2014

IsPlayerInRangeOfPoint


Re: (simple command) /buy - vegaltasendai - 29.03.2014

but as I put this command about "IsPlayerInRangeOfPoint"
I want to work only in a cordinate.


Re: (simple command) /buy - Mriss - 29.03.2014

CMD:buyflowers(playerid, params[])
{
GivePlayerWeapon(playerid, 14, 300);
GivePlayerMoney(playerid, -money);
return 1;
}


Re: (simple command) /buy - vegaltasendai - 29.03.2014

but as you put it cordinate to that command?


Re: (simple command) /buy - DarkLored - 29.03.2014

here read it and don't say i already read it. Because it doesn't seem you even tried.
next time try to script it by yourself and not ask for it.

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint


Re: (simple command) /buy - Stanford - 29.03.2014

pawn Код:
CMD:buy(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 3.0, x, y, z) // Change the range and the x, y, z to the position that you desire!
    {
        GivePlayerWeapon(playerid, 14, 300);
        GivePlayerMoney(playerid, -money);
        SendClientMessage(playerid, -1, "You've successfully purchased the flowers!.");
    }
    return 1;
}
I hope I helped!.


Re: (simple command) /buy - vegaltasendai - 29.03.2014

Quote:
Originally Posted by Stanford
Посмотреть сообщение
pawn Код:
CMD:buy(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 3.0, x, y, z) // Change the range and the x, y, z to the position that you desire!
    {
        GivePlayerWeapon(playerid, 14, 300);
        GivePlayerMoney(playerid, -money);
        SendClientMessage(playerid, -1, "You've successfully purchased the flowers!.");
    }
    return 1;
}
I hope I helped!.





I put it through and gives me 1 error

Код:
futura.pwn(24179) : error 001: expected token: ")", but found "{"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.


put it) and gives me this error

Код:
ggamemodes\ultra.pwn(24184) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.

Код:
if(IsPlayerInRangeOfPoint(playerid, 3.0, x, y, z) // Change the range and the x, y, z to the position that you desire!
	{   ←  this gives me error