Vladd Posted September 10, 2015 Posted September 10, 2015 Salut, cum aş putea să fac un timer la o comandă de 5 secunde, gen după ce tastez o comandă, ea să se execute automat după 5 secunde. am incercat eu ceva, dar nu mi-a ieşit.Vă rog ajutor, sau măcar un exemplu de comanda.. Sripting and Mapping .
MrTuNNe Posted September 10, 2015 Posted September 10, 2015 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
Vladd Posted September 10, 2015 Author Posted September 10, 2015 Ai inteles gresit, eu am spus că dupa ce tastez o comanda, ea sa se execute dupa 5 secunde. Sripting and Mapping .
EquiNoxAdv Posted September 10, 2015 Posted September 10, 2015 Faci in felul urmator 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; } 1
Mister Posted September 10, 2015 Posted September 10, 2015 (edited) 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 September 10, 2015 by Mister 1 __ ____ __ / |/ (_)____/ /____ _____ / /|_/ / / ___/ __/ _ \/ ___/ / / / / (__ ) /_/ __/ / /_/ /_/_/____/\__/\___/_/ SERVICII SCRIPTING DE CALITATE Pagina Scripting pawn
Vladd Posted September 10, 2015 Author Posted September 10, 2015 Mulţumesc băieţi. O zi bună vă doresc ! Sripting and Mapping .
Recommended Posts