Jump to content

[Ajutor] Timer comanda


Vladd

Recommended Posts

Salut,

Undeva pe la inceputul GM-ului adauga asta:

new TimerComanda[MAX_PLAYERS];

Si la comanda adauga asta:

if((GetTickCount()-TimerComanda[playerid])>5000) return SendClientMessage(playerid,Rosu,"Eroare: Pentru a folosi comanda iar trebuie sa astepti 5 secunde.");

Succes !

Ofer servicii de web designer/developer(contact me pentru portofoliu etc)

Metode de plata: Paysafecard,Skrill,PayPal,Bitcoin

Ofer si servicii de Penetration Testing.

Vand si VPN-uri. 5 euro pe luna

Skype: live:mrtunne.tkcode

Discord: https://mrtunne.info/discord

Link to comment
Share on other sites

Faci in felul urmator :D

forward	ComandaTimer();

//--------- Comanda Exepmlu
CMD:comanda(playerid, params[]) 
{
	if(IsPlayerConnected(playerid))
	{
		SendClientMessage(playerid, -1, "Comanda va fi executata in 5 secunde");
		SetTimer("ComandaTimer", 500 * 10, 0);
	}
	return 1;
}
//-- Si dupa adaugi

public ComandaTimer()
{
	//Comanda....
	}
	return 1;
}

 

  • Upvote 1

j3V8Znq.png

5IGyOAw.png

Link to comment
Share on other sites

CMD:comandamea(playerid,params[])
{
    SetTimerEx("ComandaintarziataCareNuIiVadRostul",5000, false, "i", playerid);//setezi un timer de 5 secunde
    SendClientMessage(playerid,-1,"Comanda va fi executata in 5 secunde");//trimiti un mesaj
    return 1;
}
forward ComandaintarziataCareNuIiVadRostul(playerid);//declari funtia
public ComandaintarziataCareNuIiVadRostul(playerid)//publicul funtiei
{
    SendClientMessage(playerid,-1,"Au trecut 5 secunde de cand ai tastat comanda");//trimiti un mesaj
    SendClientMessage(playerid,-1,"Acum vei primi kick");//trimiti alt mesaj
    kick(playerid);// dai kick la player
}

 

EDIT: Nu am vazut ca a postat si Equinox in acelasi timp.

Edited by Mister
  • Upvote 1

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • WopsS locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.