03.02.2015, 16:12
I made a command called /makeadmin and made another command called /admin to show you your admin level.
and made a simple command called /goto. /makeadmin says that I was promoted to level 1 for example, but /admin shows 0 and /goto isn't working.
tl;dr, what's wrong in these commands
and made a simple command called /goto. /makeadmin says that I was promoted to level 1 for example, but /admin shows 0 and /goto isn't working.
tl;dr, what's wrong in these commands
Код:
CMD:makeadmin(playerid, params[]) { if(IsPlayerAdmin(playerid)) { new targetid, level, string[70]; if(sscanf(params, "ui", targetid, level)) return SendClientMessage(playerid, 0xFFFFFF, "You aren't an admin"); if(level > 10 || level < 0) return SendClientMessage(playerid, 0xFFFFFF, "You can't do that"); if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFFFFFF, "Invalid Name/ID"); level = admin[targetid]; format(string, sizeof(string), "You have been promoted to level [%i] administration", level); SendClientMessage(playerid, 0xFFFFFF, string); return 1; } else { SendClientMessage(playerid, 0xFFFFFF, "You aren't an admin"); return 1; } }
Код:
CMD:goto(playerid, params[]) { if(IsPlayerAdmin(playerid) || admin[playerid] >= 1) // mhe kant kda mn el 2wl 5als, dumb-.- la2a kant admin(playerid) noob. not admin[playerid] ehda ba2a we bye { new targetid; new Float:x, Float:y, Float:z; if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /goto <ID/Name>"); if(targetid == playerid) return SendClientMessage(playerid, COLOR_YELLOW, "You can't go to yourself"); if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_BLACK, "Invalid ID/Name"); GetPlayerPos(targetid, x, y, z); SetPlayerPos(playerid, x+1, y, z); SendClientMessage(playerid, COLOR_PINK, "You have been TelePorted"); return 1; } else { SendClientMessage(playerid, COLOR_BLACK, "you aren't an admin"); } return 1; }