SA-MP Forums Archive
Weapons buying - 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: Weapons buying (/showthread.php?tid=95622)



Weapons buying - Daslee - 04.09.2009

If u wanna to buy weapon in u server so in your gm add this:

if(strcmp(cmdtext, "/Buyak47", true) == 0)
{
if (GetPlayerMoney(playerid) > 1000)
{
GivePlayerWeapon(playerid, 30, 1000);
GivePlayerMoney(playerid, -1000);
SendClientMessage(playerid,COLOR_YELLOW,"You buyed ak47 for 1.000$.");
PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
}
else
{
SendClientMessage(playerid,COLOR_RED,"Tu neturi tiek pinigu!");
SendClientMessage(playerid,COLOR_RED,"You dont have that money!");
}
return 1;
}

If u wanna to change weapon, so change code in GivePlayerWeapon 30 because 30 is weapon id 1000 is ammo
GivePlayerMoney(playerid, -1000); = takes from player 1000$


Sorry for my bad english


Re: Weapons buying - The_Tough - 04.09.2009

Thanks

but why do you post this ?



Re: Weapons buying - XtremeChio - 04.09.2009

WOW AWESOME !

Dude, stop spamming -.-
It's not like something new, plus only one gun ? Come on


pawn Код:
if(strcmp(cmdtext, "/Buyak47", true) == 0)
  {
    if (GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid,COLOR_RED, "You don't have enough money");

     GivePlayerWeapon(playerid, 30, 1000);
     GivePlayerMoney(playerid, -1000);
     SendClientMessage(playerid,COLOR_YELLOW,"You bought an AK47 for 1.000$.");
     PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
     return 1;
  }
Shortened your code a bit. Also, could you stop spamming -.- ?



Re: Weapons buying - Daslee - 04.09.2009

Quote:
Originally Posted by The_Tough
Thanks

but why do you post this ?
Because i wanna to help for beginers (im too beginer but not very well)


Re: Weapons buying - Daslee - 04.09.2009

The_Though how to add link on words: i have writed lol and how to add link to it?? when i click on lol me open web that what i have inserted link??how? like u added that [MAP/FS]

(Soz for double post)


Re: Weapons buying - ilikepie2221 - 04.09.2009

Quote:
Originally Posted by Daslee
Quote:
Originally Posted by The_Tough
Thanks

but why do you post this ?
Because i wanna to help for beginers (im too beginer but not very well)
Well, maybe you should improve on your scripting first, release an FS or two, THEN start helping. Not one command FS scripts either.


Re: Weapons buying - The_Tough - 04.09.2009

Quote:
Originally Posted by Daslee
The_Though how to add link on words: i have writed lol and how to add link to it?? when i click on lol me open web that what i have inserted link??how? like u added that [MAP/FS]

(Soz for double post)
Check your pms