subtracting from a value
#1

Hello guys, how to properly code this?
Код:
CMD:usecoca(playerid, params[])
{
	if(PlayerInfo[playerid][Cocaine] >=2)
	{
	    SendClientMessage(playerid, -1, "you just used 2 grams of cocaine");
	    PlayerInfo[playerid][Cocaine]  // how to take 2 cocaine from him?
 	}
 	else SendClientMessage(playerid, -1, "you dont have enough coca");
}
thanks!
Reply
#2

PlayerInfo[playerid][Cocaine] -= 2;

Код:
variable -= amount; // Will deduct 'amount' from the 'variable'.
Reply
#3

Quote:
Originally Posted by Threshold
Посмотреть сообщение
PlayerInfo[playerid][Cocaine] -= 2;

Код:
variable -= amount; // Will deduct 'amount' from the 'variable'.
thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)