Y_Ini help
#6

pawn Код:
CMD:makeadmin(playerid, params[])
{
    new targetid, admin, string[128];
    if(pInfo[playerid][AdminLevel] < 1337) return SendClientMessage(playerid, COLOR_RED, "ERROR: You are not authorized to use this command.");
    if(sscanf(params, "ud", targetid, admin)) return SendClientMessage(playerid, COLOR_WHITE,"Usage: /makeadmin [PlayerID][AdminLevel]");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, "ERROR: That player is not in the server");
    if(pInfo[playerid][AdminLevel] < PlayerInfo[targetid][pAdmin]) return SendClientMessage(playerid, COLOR_WHITE, "ERROR: You cant demote/promote a higher level admin.");
    if(pInfo[playerid][AdminLevel] < admin) return SendClientMessage(playerid, COLOR_WHITE,"ERROR: You can't promote yourself");
    pInfo[targetid][AdminLevel] = admin;

    SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have made someone admin!");
    SendClientMessage(targetid, COLOR_LIGHTBLUE, "You have been made admin!");
    return 1;
}
But with this im using ZCMD and sscanf, also you need to be admin level 1337 to use this command.Wich you can edit by changing the number 1337 at the top
Reply


Messages In This Thread
Y_Ini help - by NoahF - 07.06.2013, 18:54
Re: Y_Ini help - by NoahF - 07.06.2013, 19:06
Re: Y_Ini help - by Facerafter - 07.06.2013, 19:07
Re: Y_Ini help - by NoahF - 07.06.2013, 19:10
Re: Y_Ini help - by gtakillerIV - 07.06.2013, 19:15
Re: Y_Ini help - by Facerafter - 07.06.2013, 19:17
Re: Y_Ini help - by NoahF - 07.06.2013, 19:18
Re: Y_Ini help - by Facerafter - 07.06.2013, 19:20
Re: Y_Ini help - by gtakillerIV - 07.06.2013, 19:20
Re: Y_Ini help - by NoahF - 07.06.2013, 19:22

Forum Jump:


Users browsing this thread: 4 Guest(s)