[Ajuda] Ajuda Com Comer Pizza , if , essa bagaзa toda ai
#5

Quote:
Originally Posted by teto27
Посмотреть сообщение
Код:
new Pizza[MAX_PLAYERS];
Code
Код:
if(strcmp(cmdtext, "/Pizza", true) == 0)   // Comando ( Nгo Importa Vamos Usar o F )
{
	if(IsPlayerInRangeOfPoint(playerid, 2.0, 1479.700683, -1723.753173, 13.546875))
	{
		if(Pizza[playerid] <= 7)
		{
			Pizza[playerid] ++;
             		SetPlayerAttachedObject(playerid,1, 2703, 5, 0.1, 0.07, 0.04, 180.0, 0.0, 0.0, 1.0, 1.0, 1.0);
            		ApplyAnimation(playerid, "VENDING", "VEND_Drink2_P", 4.1, 0, 1, 1, 1, 1, 1);
            		GivePlayerMoney(playerid, -500);
            	}
           	if(Pizza[playerid] = 7)
            	{
			SendClientMessage(playerid, -1, " {F28CAA} [INFO] Vocк Ja Comeu o Maximo de Pizzas Permitidas");
            	}
	}
}
Quando vocк tem estб trabalhando com seletivos (condicionais), vocк precisa estar ciente de duas coisas:

- A primeira й que vocк terб o SE (IF);
- A segunda й que vocк poderб (caso necessбrio) ENTГO SE (Else IF);
- e a terceira, vocк terб o ENTГO (Else).

Feito isso, vocк terб a seguinte situaзгo:
Код:
if(Pizza[playerid] < 7) // Condiзгo para a pessoa se ela comeu menos de 7 pizzas
{
	// Aqui dentro todas as funзхes para a pessoar "comer" a pizza.
}
else
{
	// Aqui dentro um texto informando o porque nгo pode comer mais pizzas
}
Acharia legal vocк definir um gettime para que depois de tanto tempo, a pessoa possa comer novamente.
Reply


Messages In This Thread
Ajuda Com Comer Pizza , if , essa bagaзa toda ai - by teto27 - 17.10.2017, 01:59
Re: Ajuda Com Comer Pizza , if , essa bagaзa toda ai - by SammyJ - 17.10.2017, 02:10
Re: Ajuda Com Comer Pizza , if , essa bagaзa toda ai - by Firezl - 17.10.2017, 02:12
Re: Ajuda Com Comer Pizza , if , essa bagaзa toda ai - by teto27 - 17.10.2017, 02:29
Re: Ajuda Com Comer Pizza , if , essa bagaзa toda ai - by pWesley - 17.10.2017, 22:54
Re: Ajuda Com Comer Pizza , if , essa bagaзa toda ai - by Rato22 - 20.10.2017, 18:45

Forum Jump:


Users browsing this thread: 1 Guest(s)