Buy Guns With Score Points
#1

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

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

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

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

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

thanks for the help! It worked!
Reply
#7

No problem.
Have fun.
Reply
#8

Which one worked?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)