11.04.2012, 01:27
PHP код:
#include a_samp
#include foreach
#include zcmd
#include sscanf
new Text:TextoDraw;
forward DestruirTextoDraw();
CMD:anunciar(playerid, params[])
{
new Anuncio[128];
new String[128];
if(sscanf(params, "s", Anuncio)) return SendClientMessage(playerid, -1, "Use: /anunciar [mensagem]");
if(strlen(Anuncio) > 40) return SendClientMessage(playerid,-1,"O mбximo de caracteres permitido й 40");
new Nome[MAX_PLAYER_NAME];
GetPlayerName(playerid,Nome,sizeof(Nome));
format(String,sizeof(String),"Admin %s: ~y~%s", Nome, Anuncio);
TextoDraw = TextDrawCreate(325.000000, 394.000000, String);
TextDrawAlignment(TextoDraw, 2);
TextDrawBackgroundColor(TextoDraw, 255);
TextDrawFont(TextoDraw, 1);
TextDrawLetterSize(TextoDraw, 0.399999, 3.199999);
TextDrawColor(TextoDraw, 16711935);
TextDrawSetOutline(TextoDraw, 1);
TextDrawSetProportional(TextoDraw, 1);
foreach (new i : Player)
{
TextDrawShowForPlayer(i, TextoDraw);
}
SetTimer("DestruirTextoDraw",5000, false);
return true;
}
public DestruirTextoDraw()
{
TextDrawHideForAll(TextoDraw);
return true;
}