05.09.2009, 16:00
Hi Guys, it's me again, I am having this problem with making an admin command work. It is called /ac, What it is is just an admin chat, for admins to talk with eachother, but my problem that I have is that, if a non-admin types /ac <message>, he doesnt talk in it,because it returns 0;. but if an admin types /ac <message> the non-admins see it, as well as the admins. Is there any way to fix it?
GetPlayerAdmin / ResetPlayerAdmin / GivePlayerAdmin stocks
Any help would be appreciated !
pawn Код:
if(strcmp(cmdtext, "/ac", true, 3)==0) if(Logged[playerid] == 1)
{
if(!GetPlayerAdminz(playerid)) return 0;
{
if(!strlen(cmdtext[4])) return SendClientMessage(playerid, 0xFF0000AA, "[ ! ] USAGE: /ac [message]");
}
new playaname[MAX_PLAYER_NAME];
GetPlayerName(playerid,playaname,sizeof(playaname));
for(new i; i<MAX_PLAYERS; i++){
format(string, 128, "Admin lvl.%i %s : %s",GetPlayerAdminz(i), playaname, cmdtext[4]);
if(IsPlayerConnected(i) && GetPlayerAdminz(i)){ // Is the other admins connected ? Are they admins ?
}
SendClientMessage(i, 0xFF0000FF, string);
}
return 1;
}
pawn Код:
// =============================================================================
stock ResetPlayerAdminz(playerid)
{
Adminz[playerid] = 0;
return Adminz[playerid];
}
// =============================================================================
stock GetPlayerAdminz(playerid)
{
return Adminz[playerid];
}
// =============================================================================
stock GivePlayerAdminz(playerid,lvl)
{
Adminz[playerid] = Adminz[playerid] + lvl;
return Adminz[playerid];
}
// =============================================================================