I want to make this cmd for admins only...
#1

I need this command for admin lvl 1337. Pls

pawn Код:
CMD:arefuel(playerid, params[]) {
    if(!IsPlayerAdmin(playerid)) return 0;
   
    new
        vehid = strval(params);
    if(!vehid) {
        SendClientMessage(playerid, -1, "/arefuel [Car ID] (Use /dl)");
        return 1;
    } else

    if(!GetVehicleModel(vehid)) {
        SendClientMessage(playerid, -1, "Invalid vehicle id.");
        return 1;
    }

    new buf[128];
    format(buf, sizeof(buf), "Vehicle %d refuel!", vehid);
    SetVehicleParamsEx(vehid, VEHICLE_PARAMS_ON, 0, 0, 0, 0, 0, 0);
    SendClientMessage(playerid, -1, buf);
    g_vehGas[vehid] = 100.0;
    return 1;
}
Thanks!
Reply
#2

I assume it's a GF Edit..
pawn Код:
CMD:arefuel(playerid, params[]) {
    if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1337) {
        new
            vehid = strval(params);
        if(!vehid) return SendClientMessage(playerid, -1, "/arefuel [Car ID] (Use /dl)");
        if(!GetVehicleModel(vehid)) return SendClientMessage(playerid, -1, "Invalid vehicle id.");
        new buf[128];
        format(buf, sizeof(buf), "Vehicle %d refuel!", vehid);
        SetVehicleParamsEx(vehid, VEHICLE_PARAMS_ON, 0, 0, 0, 0, 0, 0);
        SendClientMessage(playerid, -1, buf);
        g_vehGas[vehid] = 100.0;
    }
    else return SendClientMessage(playerid, -1, #You are not a admin.);
    return 1;
}
Reply
#3

it's already for rcon-admins only, Check if their AdminLevel variable equal 1337, using if
Reply
#4

Thanks.

And no, its not a GF edit.
Reply
#5

4 errors

error 017: undefined symbol "PlayerInfo"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Reply
#6

post your enums.
Reply
#7

CODE: http://pastebin.com/F08E0JZJ its a FS
Reply
#8

Lel dude you can't make this for Admin Level 1337 only if you don't have an admin system.
Anyway, i suppose that in your gamemode an admin system is alive so you have to make this in your gamemode and not as an FS.
Post enums of player/admin system of your GAMEMODE

enums are like:
Код:
enum PlayerInfo{
pID,
pScore,
pAdmin,
}
Reply
#9

Enum pInfo: http://pastebin.com/DPteKPkf
Reply
#10

You have to use IsPlayerAdmin(playerid) // Rcon Admin.
For Filterscripts, otherwise you can't define if their a Admin or not.
There is a way to hook the two together and read data from one anther using Y_Hooks
But it's obvious you're new to scripting so I wouldn't suggest tackling hooking yet.
Not atleast until you have the fundamentals down.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)