Repetir funciones. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (
https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: Repetir funciones. (
/showthread.php?tid=458793)
Repetir funciones. -
JaimitoxD - 18.08.2013
Pues bien hola, vengo acб si me dan una ayuda de repetir una funciуn si estar poniendo el comando cada rato me explico. Poner /test y ese comando tenga una funciуn (obvio) y con poner
SOLO UNA VEZ tal funciуn se va a repetir muchas veces sola ejemplo
Comando normal
Код:
CMD:hola(playerid,params[])
{
SendClientMessage(playerid, -1,"Hola forum"); y la funciуn sale solo una vez xD
return 1;
}
Код:
CMD:hola(playerid,params[])
{
SendClientMessage(playerid, -1,"Hola forum repite funciуn"); La funciуn sй repetira varias veces
return 1;
}
Код:
Chat : Hola forum repite funciуn
Chat : Hola forum repite funciуn
Chat : Hola forum repite funciуn
Chat : Hola forum repite funciуn
Chat : Hola forum repite funciуn
Chat : Hola forum repite funciуn
e igual como seria con una tecla
Claro que son ejemplo no sй si me entendieron trate de explicar gracias igual
Respuesta: Repetir funciones. -
[DOG]irinel1996 - 18.08.2013
Usa
SetTimer o
SetTimerEx.
pawn Код:
CMD:hola(playerid,params[])
{
SetTimer("ReenviarMensaje", 1000, true);
SendClientMessage(playerid, -1,"Hola forum");
return 1;
}
forward ReenviarMensaje();
public ReenviarMensaje () {
SendClientMessage(playerid, -1,"Hola forum");
return 1;
}
El
SetTimerEx te permite usas mбs parбmetros y enviar mбs datos.
Respuesta: Repetir funciones. -
JaimitoxD - 18.08.2013
Quote:
Originally Posted by [DOG]irinel1996
Usa SetTimer o SetTimerEx.
pawn Код:
CMD:hola(playerid,params[]) { SetTimer("ReenviarMensaje", 1000, true); SendClientMessage(playerid, -1,"Hola forum"); return 1; }
forward ReenviarMensaje(); public ReenviarMensaje () { SendClientMessage(playerid, -1,"Hola forum"); return 1; }
El SetTimerEx te permite usas mбs parбmetros y enviar mбs datos.
|
Grazie amore mio :P pensй que era otra cosa
Re: Repetir funciones. -
Daniel-92 - 18.08.2013
No se si lo que buscas es un bucle, pero ahi te lo dejo por si acaso.
pawn Код:
CMD:hola(playerid,params[])
{
for(new i=0; i < 10; i++) { //10 veces
SendClientMessage(playerid, -1,"Hola forum");
}
return 1;
}