24.05.2013, 21:52
Queria um comandos sу para admins tipo /a [texto] ai fala-se * Admin Tal diz: blablablalbla
Uso o dcmd!
Uso o dcmd!
dcmd_a(playerid,params[])
{
static Nome[MAX_PLAYER_NAME], _var[150];
GetPlayerName(playerid, Nome, sizeof(Nome));
if(PlayerInfo[playerid][pAdmin] != 1) return 1;
if(sscanf(params,"s", Frase))return SendClientMessage(playerid, -1 ,"/a frase");
format(_var,sizeof(_var),"%s:%s", Nome, Frase);
SendClientMessageToAll(-1,_var);
return 1;
}
dcmd_a(playerid,params[])
{
new Texto[128];
new AdminNivel[50];
if((PlayerInfo[playerid][admin] < 2) && (PlayerInfo[playerid][helper] < 1)) return SendClientMessage(playerid, BRANCO, "Vocк precisa ser admin para usar este comando!");
if(sscanf(params, "s[128]", Texto)) return SendClientMessage(playerid, CINZA, "Use /a [texto]"), SendClientMessage(playerid, CINZA, "Use o comando para mandar mensagens para os admins online");
if(PlayerInfo[playerid][helper] == 1) AdminNivel = "Helper";
if(PlayerInfo[playerid][admin] == 2) AdminNivel = "Moderador";
if(PlayerInfo[playerid][admin] == 3) AdminNivel = "Admin 1";
if(PlayerInfo[playerid][admin] == 4) AdminNivel = "Admin 2";
if(PlayerInfo[playerid][admin] == 5) AdminNivel = "Sub Dono";
if(PlayerInfo[playerid][admin] == 6) AdminNivel = "Dono";
format(String, sizeof(String), "%s %s: %s", AdminNivel, Nome(playerid), Texto);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if((PlayerInfo[i][admin] > 0) || (PlayerInfo[i][helper]))
{
SendClientMessage(i, AZUL_CLARO, String);
}
}
return 1;
}
dcmd_a(playerid, params[]) // (ANNOUNCE) AN
{
if(IsPlayerAdmin(playerid))
{
new string[256];
new nomeadmin[MAX_PLAYER_NAME];
if(isnull(params)) return SendClientMessage(playerid, INFO, "[ USO: ] /announce [texto]");
GetPlayerName(playerid, nomeadmin, sizeof(nomeadmin));
format(string, sizeof(string), "[ Administrador %s: ] %s", nomeadmin, params);
SendClientMessageToAll(INFO2, string);
}
else
{
SendClientMessage(playerid, FAIL, "[ ERRO: ] Tu nгo йs Administrador.");
}
return 1;
}
pawn Код:
|
C:\Users\usuario\Desktop\Brasil Racing\gamemodes\BrasilBeta.pwn(1181) : error 033: array must be indexed (variable "params")
pawn Код:
|