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
CMD:chat(playerid, params[])
{
new String[128], Texto[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(sscanf(params, "s", Texto)) return SendClientMessage(playerid, -1, "Use: /chat [texto]");
format(String, sizeof(String), "Chat Global: %s: %s", name, Texto);
SendClientMessageToAll(-1,String);
return 1;
}
PHP код:
|
No caso de eu estudar, e fazer um comando ussando esse ai, terei que usar o ZCMD neh ?
|
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/chatglobal", true, 11) == 0)
{
if(cmdtext[11] == '\0')
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, cmdtext[11]);
SendClientMessageToAll(-1, Str);
}
return true;
}
No caso de eu estudar, e fazer um comando ussando esse ai, terei que usar o ZCMD neh ?
|