SA-MP Forums Archive
[Ajuda] random format - 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: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] random format (/showthread.php?tid=603641)



random format - ERICcartmanN - 25.03.2016

como eu deixo essas 2 mensagem em random?

pawn Код:
format(msg2, sizeof(msg2),"lv. %d, nick %s", Level[playerid], Nick(playerid));

format(msg3, sizeof(msg3),"Matou %d Morreu %d", Matou[playerid], Morreu[playerid]);



Re: random format - rhaegartargaryen - 25.03.2016

seria a cor em random ?


Re: random format - ERICcartmanN - 25.03.2016

pawn Код:
format(msg2, sizeof(msg2),"~b~lv. ~w~%d, ~b~nick ~w~%s", Level[playerid], Nick(playerid)); // azul

format(msg2, sizeof(msg2),"~r~lv. ~w~%d, ~r~nick ~w~%s", Level[playerid], Nick(playerid)); // vermelho



Re: random format - SaDaN - 26.03.2016

Код:
new rand = random(2);
if(rand == 1) SendClientMessage(playerid, 0xFF0000FF, string);
else if(rand == 2) SendClientMessage(playerid, 0x0000FFFF, string);
Nгo testei talvez de certo.


Re: random format - LiiPe - 26.03.2016

para criar random vc precisa utiliza ou um GETTIMER ou SETTIMER

https://sampwiki.blast.hk/wiki/Gettime

https://sampwiki.blast.hk/wiki/SetTimer


TUT
https://sampforum.blast.hk/showthread.php?tid=446237


Re: random format - LockedLucas - 26.03.2016

Quote:
Originally Posted by LiiPe
Посмотреть сообщение
Nгo й obrigatуrio usa nгo, cada caso й um caso, e neste caso, nгo й preciso.


Re: random format - LiiPe - 26.03.2016

Quote:
Originally Posted by LockedLucas
Посмотреть сообщение
Nгo й obrigatуrio usa nгo, cada caso й um caso, e neste caso, nгo й preciso.
sim locked ele vai fazer um random de cores sem usar um gettimer ou settimer ex , tu и o bixao mesmo ein doido .-.


Re: random format - ipsLuan - 26.03.2016

Nesse caso, й necessбrio o uso de SetTimer(Ex).