if(strcmp(cmd, "/avisar", true) == 0 || strcmp(cmd, "/av", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerAdmin(playerid))//Tem que estar logado da RCON :D
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й um Admin!");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "{02EDE}USE: {02EDED}(/av)isar [TEXTO]");
return 1;
}
SendClientMessageToAll(COLOR_DBLUE, "{02EDED}|_____________{FF0037}Aviso Do Admin{02EDED}_____________|");
format(string, sizeof(string), "{046DB3}***{FF0037}Admin: {{02EDED}%s {FF00BF}ID:[{02EDED}%d]: {02EDED}%s", sendername, playerid, result);
SendClientMessageToAll(0x33FF00FF, string);
}
return 1;
}
Valeu bruno, deu uns erros mas arrumei todos, testei e funcionou perfeitamente.
Obrigadъuuuuuuuuu! |
if (PlayerInfo[playerid][pAdmin] >= 1)//Se o seu sistema nao for pAdmin voce coloca o que For xD
if(strcmp(cmd,"/av",true) == 0 || strcmp(cmd,"/avisar",true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(!IsPlayerAdmin(playerid))//BURRO! NГO COLOCOU !IsPlayerAdmin
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й um Admin!");
return 1;
}
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
new result[128];
result = strtok(cmdtext, idx);
if(!strlen(result))
{
SendClientMessage(playerid, 0xFFFFFF, "ERROR: Use /av [Texto]");
return 1;
}
SendClientMessageToAll(COLOR_DBLUE, "{02EDED}|_____________{FF0037}Aviso Do Admin{02EDED}_____________|");
format(string, sizeof(string), "{046DB3}***{FF0037}Admin: {{02EDED}%s {FF00BF}ID:[{02EDED}%d]: {02EDED}%s", sendername, playerid, result);
SendClientMessageToAll(0x33FF00FF, string);
}
return 1;
}
Denada, xD
Se em seu servidor tiver sistema de Admins voce coloca no lugar de if(IsPlayerAdmin(playerid)) voce coloca: pawn Код:
|