command(calar, playerid, params[]) { new Jogadorid, Motivo, Nome[MAX_PLAYER_NAME], Nome2[MAX_PLAYER_NAME], string[128]; if(sscanf(params, "iii", Jogadorid, Motivo)) return SendClientMessage(playerid,-1,"Uso Correto: /calar [ID de Jogador(a)] [Motivo]"); if(!IsPlayerConnected(Jogadorid)) return SendClientMessage(playerid,-1,"Jogador(a) nгo connectado!"); GetPlayerName(playerid, Nome, sizeof(Nome)); GetPlayerName(Jogadorid, Nome2, sizeof(Nome2)); PlayerInfo[Jogadorid][pCalado] = 1; format(string, sizeof(string)," O Administrador(a) %s calou o Jogador(a) %s, Motivo:%s",Nome, Nome2, Motivo); SendClientMessageToAll(-1,string); return 1; }
if(sscanf(params, "us[128]"...
new Jogadorid, Motivo[128], Nome[MAX_PLAYER_NAME], Nome2[MAX_PLAYER_NAME], string[128];
i | Interadores(nъmeros somente) |
s[size] | Strings, textos(use s[tamanho_string]) |
u | Player Nome ou Id |
command(calar, playerid, params[])
{
new
Jogadorid,
Motivo[50]
;
if(sscanf(params, "is[50]", Jogadorid, Motivo)) // Note que "s[50]" й o mesmo tamanho da declaraзгo (new Motivo[50]).
return SendClientMessage(playerid,-1,"Uso Correto: /calar [ID de Jogador(a)] [Motivo]");
if(!IsPlayerConnected(Jogadorid))
return SendClientMessage(playerid,-1,"Jogador(a) nгo connectado!");
new
Nome[MAX_PLAYER_NAME],
Nome2[MAX_PLAYER_NAME],
string[128]
;
GetPlayerName(playerid, Nome, sizeof(Nome));
GetPlayerName(Jogadorid, Nome2, sizeof(Nome2));
PlayerInfo[Jogadorid][pCalado] = 1;
format(string, sizeof(string)," O Administrador(a) %s calou o Jogador(a) %s, Motivo:%s",Nome, Nome2, Motivo);
SendClientMessageToAll(-1,string);
return 1;
}
Exatamente garfield, u = ID ou nome do player. --'
E o cara que pegar o ID do jogador para assim usar o comando nele. |