24.04.2014, 17:43
Hello i was making an admin command i made it it compiled but i have 1 problem look:
it compiles as i said but when i wasnt admin it doesnt shows [ADMIN] You are not admin. why ? i think i have wrong with elses
it compiles as i said but when i wasnt admin it doesnt shows [ADMIN] You are not admin. why ? i think i have wrong with elses
Код:
if(strcmp(cmdtext, "/aod", true) == 0)
{
if(IsPlayerLuxAdmin(playerid))
{
if(aaoodd[playerid] == true)
{
aaoodd[playerid] = false;
label[playerid] = Create3DTextLabel(".:ADMINISTRATOR:.", 0xB8FFABFF, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
SetPlayerHealth(playerid, 1000000);
TextDrawShowForPlayer(playerid, aod);
SetPlayerColor(playerid, 0xB8FFABFF);
SendClientMessage(playerid, 0xB8FFABFF, "[ADMIN] {FFFFFF}You've Enabled Your administrator mode!");
new name[MAX_PLAYER_NAME+1], string[50+MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "[ADMIN] {FFFFFF}%s has enabled his administrator mode.", name);
SendClientMessageToAll(0xB8FFABFF, string);
}
else if(aaoodd[playerid] == false)
{
aaoodd[playerid] = true;
Delete3DTextLabel(label[playerid]);
SetPlayerHealth(playerid, 100);
SetPlayerColor(playerid, 0xFFFFFFFF);
TextDrawHideForPlayer(playerid, aod);
SendClientMessage(playerid, 0xB8FFABFF, "[ADMIN] {FFFFFF}You've Disabled Your administrator mode!");
new name[MAX_PLAYER_NAME+1], string[50+MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "[ADMIN] {FFFFFF}%s has disabled his administrator mode.", name);
SendClientMessageToAll(0xB8FFABFF, string);
}
else SendClientMessage(playerid, 0xB8FFABFF, "[ADMIN] {FFFFFF}You are not an admin!");
}
return 1;
}
return 0;
}

