11.01.2017, 15:45
PHP код:
CMD:duvida(playerid, params[])
{
new targetid, TextoDuvida[128], NomeDuvida[24];
GetPlayerName(playerid, NomeDuvida, 24);
if(isnull(params)) return SendClientMessage(playerid, -1, "Use: /duvida [Texto]");
SendClientMessage(playerid, YELLOW, "Sua mensagem foi enviada aos administradores");
format(TextoDuvida, sizeof(TextoDuvida), "[AJUDA] de %s[ID %d]: %s", NomeDuvida, playerid, params);
for(new i; i < GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerAdminLevel(i) >= 1)
{
SendClientMessage(i, YELLOW, TextoDuvida);
}
}
}
return true;
}
CMD:responder(playerid, params[])
{
if(GetPlayerAdminLevel(playerid) >= 1)
{
if(!strlen(params)) return SendClientMessage(playerid, -1,"Uso: /responder <id> <mensagem>");
new tmp[128], Index, player;
tmp = strtok(params,Index);
player = strval(tmp);
new PosString = strlen(tmp) + 1;
if(!IsNumeric(tmp)) return SendClientMessage(playerid,-1,"[ERRO]: ID Invбlida");
if(!IsPlayerConnected(player)) return SendClientMessage(playerid,-1,"[ERROR] Payer nгo conectado");
if(!strlen(params[PosString])) return SendClientMessage(playerid, -1,"[ERRO]: Mensagem nгo definida");
new string[140], string2[140], pname[MAX_PLAYER_NAME], pname2[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
GetPlayerName(player, pname2, sizeof(pname));
format(string, sizeof(string), "[Resposta da Administraзгo] %s", params[PosString]);
SendClientMessage(player, COLOUR_AVISO, string);
} else return SendClientMessage(playerid,-1,"[ERRO]: Vocк nгo tem permissгo para isso");
return true;
}