[Help] Racing Cmds
#1

Heey
would appreciate iff someone could help me out here's the problem
im trying to put some commands in so my level 2 admins can abuildrace and use araceadmin and use aloadrace
abuildrace works fine when you are admin and don't respone when you are not admin. Just like it should work but..

araceadmin & aloadrace can still be used no matter iff you are admin or not i want to do so only admins can use these two like abuildrace here's the codes:

aloadrace
pawn Код:
dcmd_aloadrace(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 3)
    Racemode = 0; Racelaps = 1;
    new tmp[128], idx, fback;
    tmp = strtok(params, idx);
    if(!strlen(tmp))
    {
        SendClientMessage(playerid, COLOR_WHITE, "USAGE: /loadrace [name]");
        return 1;
    }
    if(RaceActive == 1)
    {
        SendClientMessage(playerid, COLOR_RED, "A race is already active!");
        return 1;
    }
    fback=LoadRace(tmp);
    if(fback == -1) format(ystring,sizeof(ystring),"Race \'%s\' doesn't exist!",tmp);
    else if (fback == -2) format(ystring,sizeof(ystring),"Race \'%s\' is created with a newer version of YRACE, cannot load.",tmp);
    if(fback < 0)
    {
        SendClientMessage(playerid,COLOR_RED,ystring);
        return 1;
    }
    format(ystring,sizeof(ystring),"Race \'%s\' loaded, /startrace to start it. You can change laps and mode before that.",CRaceName);
    SendClientMessage(playerid,COLOR_GREEN,ystring);
    if(LCurrentCheckpoint<2 && Racemode == 2)
    {
        Racemode = 1; // Racemode 2 doesn't work well with only 2CPs, and mode 1 is just the same when playing with 2 CPs.
    }                 // Setting racemode 2 is prevented from racebuilder so this shouldn't happen anyways.


araceadmin

pawn Код:
#if defined MENUSYSTEM
dcmd_araceadmin(playerid,params[])
{
    #pragma unused params
    if(PlayerInfo[playerid][pAdmin] >= 3)
    if(!IsValidMenu(MAdmin)) CreateRaceMenus();
    TogglePlayerControllable(playerid,0);
    ShowMenuForPlayer(MAdmin,playerid);
    return 1;
}
Reply
#2

pawn Код:
if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid,color,"SERVER: Only admin with lvl can....");
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)