SA-MP Forums Archive
You must have 99 score to this command. FOR [99 Score], - 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: You must have 99 score to this command. FOR [99 Score], (/showthread.php?tid=627026)



You must have 99 score to this command. FOR [99 Score], - DerickClark - 22.01.2017

If i have 99 score it don't work if i put in 100 it worked... it must be 99 score or higher to use this command.

Код:
CMD:test(playerid, params[])
{
    if (GetPlayerScore(playerid) > 99)
    {
	        SendClientMessage(playerid, -1, "Worked!");
	    	return 1;
    }
    return SendClientMessage(playerid, COLOUR_RED, "You must have 99 or higher score to this command.");
}



Re: You must have 99 score to this command. FOR [99 Score], - iLearner - 22.01.2017

Quote:
Originally Posted by DerickClark
Посмотреть сообщение
If i have 99 score it don't work if i put in 100 it worked... it must be 99 score or higher to use this command.

Код:
CMD:test(playerid, params[])
{
    if (GetPlayerScore(playerid) > 99)
    {
	        SendClientMessage(playerid, -1, "Worked!");
	    	return 1;
    }
    return SendClientMessage(playerid, COLOUR_RED, "You must have 99 or higher score to this command.");
}
Make
PHP код:
 if (GetPlayerScore(playerid) > 99
>
PHP код:
 if (GetPlayerScore(playerid) >= 99
Your original condition means... if its MORE THAN 99 (so 100+), with the one i gave you it means 99 OR BIGGER


Re: You must have 99 score to this command. FOR [99 Score], - DerickClark - 22.01.2017

Thank you. It worked.


Re: You must have 99 score to this command. FOR [99 Score], - saffierr - 22.01.2017

Or you can do, '> 98' which would be 99 as well.

'> 98' and '>= 99' are basically the same.