08.04.2018, 20:37
PHP код:
public OnPlayerText(playerid, text[])
{
static Str[128];
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
format(Str, sizeof Str, "%s[%d] diz: %s", Name, playerid, text);
SendClientMessageToAll(-1, Str);
return 0;
}
CMD:chatglobal(playerid, chat[])
{
if(isnull(chat))
return SendClientMessage(playerid, -1, "USE: /chatglobal [Texto]");
new
Str[128],
Name[MAX_PLAYER_NAME]
;
GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
format(Str, sizeof Str, "[Chat Global] %s[%d]: %s", Name, playerid, chat);
SendClientMessageToAll(-1, Str);
return 1234;
}
//Caso nгo tenha:
#if !defined isnull
#define isnull(%1) \
((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
#endif