18.05.2015, 04:32
Hi. I want to make commands display based on their admin level. First code is my current script, second code is my previous script.
I've tried copying the second code into the first but it caused errors at some other areas of the gamemode.
Attempt: http://puu.sh/hRpPf/2fc4c66044.png - http://pastebin.com/KHBFZQ2L
I've tried copying the second code into the first but it caused errors at some other areas of the gamemode.
Код:
CMD:ahelp(playerid, params[]) { if(pInfo[playerid][Adminlevel] < 1)return SendClientMessage(playerid, COLOR_RED, "{ff6347}Error: You are not allowed to use this command!"); SendClientMessage(playerid, COLOR_SERVER, "Age of Revolution {EAEAEA}- Admin Commands"); SendClientMessage(playerid, COLOR_SERVER, "Trial Admin: {EAEAEA}/sp(ecoff), /cp, /(un)freeze, /slap, /warn, /kick, /tpto, /tptome, /(un)mute"); SendClientMessage(playerid, COLOR_SERVER, "Basic Admin: {EAEAEA}/cchat, /burn, /mute, /ban, /ann, /setskin"); SendClientMessage(playerid, COLOR_SERVER, "Senior Admin: {EAEAEA}/bomb, /hna, /settime, /givewep, /setweather, /sethealth, /disarm, /heal, /armour"); SendClientMessage(playerid, COLOR_SERVER, "Head Admin: {EAEAEA}/akill, /resetscore, /resetmoney, /givemoney, /setscore, /makecmd"); SendClientMessage(playerid, COLOR_SERVER, "Owner: {EAEAEA}/setadmin, /plantbomb"); SendClientMessage(playerid, COLOR_RED,"Warning: {E5E5E5}Abuse these commands for unfair advantage you will be removed without question!"); return 1; }
Код:
if(strcmp(cmd, "/acommands", true) == 0 || strcmp(cmd, "/ahelp", true) == 0) { if(IsPlayerConnected(playerid)) { if (PlayerInfo[playerid][pAdmin] >= 2) SendClientMessage(playerid,COLOR_GREY, " "); SendClientMessage(playerid, COLOR_ADMIN,"> ADMIN {E5E5E5}COMMANDS"); SendClientMessage(playerid,COLOR_GREY, "``````````````````````````````````````````````````````````````````"); if (PlayerInfo[playerid][pAdmin] >= 2) { SendClientMessage(playerid, COLOR_WHITE," /ufa - /fa - /ann - /unfreeze - /freeze - /cp - /duty - /cc - /home"); } if (PlayerInfo[playerid][pAdmin] >= 2) { SendClientMessage(playerid, COLOR_WHITE," /goto - /kick - /ban - /fix - /respawn - /tp - /getip - /cg"); } if (PlayerInfo[playerid][pAdmin] >= 4) { SendClientMessage(playerid, COLOR_WHITE," /veh - /sethealth - /setarmour - /setskin - /disarm - /tpall - /jetpack"); } if (PlayerInfo[playerid][pAdmin] >= 5) { SendClientMessage(playerid, COLOR_WHITE," /givecash - /setweather - /gmx - /setadmin - /servername"); } if (PlayerInfo[playerid][pAdmin] >= 2) { SendClientMessage(playerid, COLOR_RED,"Warning: {E5E5E5}Abuse these commands for unfair advantage you will be removed without question!"); } } return 1;