Help is needed...
#1

How can I make a command not work without the proper amount of score/cash.

Example:
Код:
CMD:test(playerid, params[])
{
       SendClientMessage(playerid, 0xFF00FF, "you need 500 score to use this");
       return 1;
}"
What would I use to make it so you need 500 Score, or even 500 Cash. Both codes would help me out!
Reply
#2

Add this
Код:
if(GetPlayerScore(playerid) < 500)
		{
		SendClientMessage(playerid,-1,"You need 400 score before using this.....");
		return 0;
		}
Reply
#3

Thanks I will try that. would if work better if I add it like this?

Код:
if(GetPlayerScore(playerid) < 500) return SendClientMessage(playerid, -1, "You need 500 score to use this CMD!");
Reply
#4

Your pawno will throw an error at this,i'm not experienced in pawn,but I think it will.
Код:
CMD:test(playerid, params[])
{
       SendClientMessage(playerid, 0xFF00FF, "you need 500 score to use this");
       return 1;
}"
The " should not be there
It should be like this
Код:
CMD:test(playerid, params[])
{
       SendClientMessage(playerid, 0xFF00FF, "you need 500 score to use this");
       return 1;
}
Reply
#5

Yes, I know, that was a mistake since I wrote that cmd in the post not in my gm. Could you read my last post? I edited it since you didn't reply till after I did
Reply
#6

Quote:
Originally Posted by Th3UnKnOwN
Посмотреть сообщение
Thanks I will try that. would if work better if I add it like this?

Код:
if(GetPlayerScore(playerid) < 500) return SendClientMessage(playerid, -1, "You need 500 score to use this CMD!");
Ofcourse it will!
Reply
#7

Thanks :P REP+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)