SA-MP Forums Archive
Buy Guns With Score Points - 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: Buy Guns With Score Points (/showthread.php?tid=186522)



Buy Guns With Score Points - lewismichaelbbc - 29.10.2010

Hello, i am trying to make it so that players can buy guns with score points...

Quote:

SetPlayerScore(playerid,GetPlayerScore(playerid)-10)

The above line will take the players score, but i dont want them to buy the gun if they dont have enough score points.

Example.

A gun costs 10 score points and the player has 3 points, it then takes them into minus score.

how can i get the script to check if he has enough points before it takes the points?

Thanks


Re: Buy Guns With Score Points - Rafa - 29.10.2010

i dont know now cause am in school when ill get home ill help u... i HOPE
Good Luck )


Re: Buy Guns With Score Points - Jeffry - 29.10.2010

pawn Код:
if(GetPlayerScore(playerid)<10) return SendClientMessage(playerid, COLOR_RED, "ERROR: You need 10 scorepoints to buy this gun!");
Add this to your script. ^^
Hope this helps.


Re: Buy Guns With Score Points - SampStunta - 29.10.2010

pawn Код:
if (GetPlayerScore(playerid)>0)
{
SendClientMessage(playerid, COLOR_YOURCOLOR, "[ERROR] You do not have enough score");



Re: Buy Guns With Score Points - i514x - 29.10.2010

you forgot } at the end, otherwise lewismichaelbbc will have errors


Re: Buy Guns With Score Points - lewismichaelbbc - 29.10.2010

thanks for the help! It worked!


Re: Buy Guns With Score Points - Jeffry - 30.10.2010

No problem.
Have fun.


Re: Buy Guns With Score Points - SampStunta - 30.10.2010

Which one worked?