[Ajuda] Esperar para realizar comando novamente.
#1

Olб, meu povo. Tф escrevendo um comando estilo /heal [ID] mas nгo tenho experiкncia com programaзгo. Atй agora tб funcionando direitinho, mas nгo consigo colocar um tempo para esperar atй poder usar o comando novamente. Nenhum dos tutoriais e tуpicos com pessoas pedindo a mesma coisa deu certo aqui.

Eis o meu cуdigo:

Код:
CMD:medkit(playerid, params[])
	{
		new targetid;
    	
		if(class[playerid]!=0)
		return SendClientMessage(playerid,COLOR_RED,"[ You must to be ASSAULT to heal players. ]");
		if(sscanf(params, "u", targetid))
		return SendClientMessage(playerid, COLOR_RED, "Syntax: /medkit [id]"); // syntax
  		if(targetid == INVALID_PLAYER_ID)
		return SendClientMessage(playerid, COLOR_RED, "That player is not connected to the server!"); // valid id

		else if(targetid == playerid)
		{
		SendClientMessage(playerid, COLOR_BLUE, "You healed youself!");
		SetPlayerHealth(playerid,100); // yourself
		
		return 1;
		}
		
  		else if(GetDistanceBetweenPlayers(playerid, targetid) > 5.00)
	  	return SendClientMessage(playerid, COLOR_RED, "That player is too far away!"); // in order to check if they are closely
			else
			{
			new Float:hp;
		    	GetPlayerHealth(targetid,hp);
		    	if(hp>=100) return SendClientMessage(playerid,COLOR_RED,"[ The player has full health. ]");
		    	else
		    	{
            	         	SetPlayerHealth(targetid,100);
				SendClientMessage(playerid,COLOR_BLUE,"[ You healed the player. ]");
				SendClientMessage(targetid,COLOR_BLUE,"[ An ASSAULT player has healed you. ]");

				return 1;
				}
			}
   }
Se ainda ficou difнcil para alguйm entender, eu quero que o player realize o comando e tenha que esperar 1 minuto para conseguir fazer de novo.

Obrigado
Reply


Messages In This Thread
Esperar para realizar comando novamente. - by doutorgori - 12.11.2018, 10:48
Re: Esperar para realizar comando novamente. - by ipsLuan - 12.11.2018, 10:56
Re: Esperar para realizar comando novamente. - by doutorgori - 12.11.2018, 11:00
Re: Esperar para realizar comando novamente. - by ipsLuan - 12.11.2018, 11:23
Re: Esperar para realizar comando novamente. - by doutorgori - 12.11.2018, 13:50
Re: Esperar para realizar comando novamente. - by ipsLuan - 12.11.2018, 15:03
Re: Esperar para realizar comando novamente. - by doutorgori - 12.11.2018, 21:52

Forum Jump:


Users browsing this thread: 1 Guest(s)