30.05.2013, 16:29
(
Последний раз редактировалось Ananisiki; 15.12.2013 в 18:41.
)
^^^^^^^^
CMD:announce(playerid, params[])
{
new message[126];
format(message,sizeof(message), "%s", params);
for(new i = 0; i < MAX_PLAYERS; i++)
{
GameTextForPlayer(i, message, 5000, 6);
}
}
GameTextForAll( "~w~test", 5000, 0 );
#include <zcmd>
CMD:announce(playerid, params[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
GameTextForPlayer(i, "~w~test", 5000, 6);
}
}
/*
This is how to do it with a textdraw but using GameTextForPlayer is more recommended
ZCMD - Zeex
(SSCANF)SSCANF2 - ******
*/
new Text:ann;
forward HideAnn();
public OnGameModeInit()
{
ann = TextDrawCreate(320.000000, 240.000000, "_");
TextDrawAlignment(ann, 2);
TextDrawBackgroundColor(ann, 255);
TextDrawFont(ann, 3);
TextDrawLetterSize(ann, 1.0, 1.400003);
TextDrawColor(ann, -1);
TextDrawSetOutline(ann, 1);
TextDrawSetProportional(ann, 1);
return 1;
}
CMD:announce(playerid, params[])
{
new string[256];
if(sscanf(params, "s[256]", params)) return SendClientMessage(playerid, -1, "/announce [message]");
format(string, sizeof(string), "%s", params);
TextDrawSetString(ann, string);
TextDrawShowForAll(ann);
SetTimer("HideAnn", 10000, false);
return 1;
}
public HideAnn()
{
TextDrawHideForAll(ann);
return 1;
}
new Text:ann;
forward HideAnn();
public OnGameModeInit()
{
ann = TextDrawCreate(320.000000, 240.000000, "_");
TextDrawAlignment(ann, 2);
TextDrawBackgroundColor(ann, 255);
TextDrawFont(ann, 3);
TextDrawLetterSize(ann, 1.0, 1.400003);
TextDrawColor(ann, -1);
TextDrawSetOutline(ann, 1);
TextDrawSetProportional(ann, 1);
}
public OnPlayerConnect(playerid)
{
TextDrawShowForPlayer(ann, playerid);
}
CMD:announce(playerid, params[])
{
if(isnull(params)) SendClientMessage(playerid, -1, "/announce [message]");
else
{
TextDrawSetString(ann, params);
SetTimer("HideAnn", 10000, false);
}
return 1;
}
public HideAnn()
{
TextDrawSetString(ann, "_");
}