Bugged Admin commands
#1

Now this is strange due few of my commands have

pawn Код:
if(PlayerInfo[playerid][Admin] < LEVEL HERE)
so you guys know what that mean but few commands I made decided to not work with it...

and they look completley fine!

/goto command
pawn Код:
CMD:goto(playerid, params[])
{
    new ID;
    if(PlayerInfo[playerid][Admin] < 3)
    if(sscanf(params, "u", ID)) SendClientMessage(playerid, COLOR_GREY, "SYNTAX: /goto [ID]");
    else if(IsPlayerConnected(ID) == 0) SendClientMessage(playerid, COLOR_RED, "[ERROR]:This Player is not online.");
    else
    {
    new Float:x, Float:y, Float:z;
    GetPlayerPos(ID, x, y, z);
    SetPlayerPos(playerid, x+1, y+1, z);
    }
    return 1;
/gethere command

pawn Код:
CMD:gethere(playerid, params[])
{
    new id;
    if(IsPlayerConnected(id))
    {
        if(PlayerInfo[playerid][Admin] < 3)
        {
            if(!sscanf(params, "ui", id))
            {
                new string[64];
                new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
                new Float:x, Float:y, Float:z;  GetPlayerPos(playerid,x,y,z); SetPlayerInterior(id,GetPlayerInterior(playerid));
                GetPlayerName(playerid, name, sizeof(name));
                GetPlayerName(id, PlayerName, sizeof(PlayerName));
                format(string, sizeof(string), "%s teleported yourself to him.", name);
                SendClientMessage(id, COLOR_LEMON, string);
                format(string, sizeof(string), "You teleported %s to you.", PlayerName);
                SendClientMessage(playerid, COLOR_LEMON, string);
                SetPlayerVirtualWorld(id,GetPlayerVirtualWorld(playerid));
                SetPlayerPos(id,x+2,y,z);
                return 1;
            }
            else return SendClientMessage(playerid, COLOR_GREY, "SYNTAX: /gethere[PlayerId/PartOfName]");
        }
        else return SendClientMessage(playerid, COLOR_RED, "[ERROR]:You are not a Public Safety Member! Or your PSM level is too low!");
    }
    else return SendClientMessage(playerid, COLOR_RED, "[ERROR]:This Player is not online.");
}
cage command

pawn Код:
CMD:psmcage(playerid, params[])
{
    new id;
    if(IsPlayerConnected(id))
    {
        if(PlayerInfo[playerid][Admin] < 3)
        {
            if(!sscanf(params, "u", id))
            {
                new string[64];
                new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
                GetPlayerName(playerid, name, sizeof(name));
                GetPlayerName(id, PlayerName, sizeof(PlayerName));
                format(string, sizeof(string), "You have been caged by %s.", name);
                SendClientMessage(id, COLOR_RED, string);
                SendClientMessage(id, COLOR_RED, "If you want to know the reason please do PM the Public Safety Member that caged you.");
                format(string, sizeof(string), "You caged %s .", PlayerName);
                SendClientMessage(playerid, COLOR_LEMON, string);
                SetPlayerPos(id, 264.6288,77.5742,1001.0391);
                SetPlayerInterior(id, 3);
                return 1;
            }
            else return SendClientMessage(playerid, COLOR_GREY, "SYNTAX: /psmcage [PlayerId/PartOfName]");
        }
        else return SendClientMessage(playerid, COLOR_RED, "[ERROR]:You are not a Public Safety Member! Or your PSM level is too low!");
    }
    else return SendClientMessage(playerid, COLOR_RED, "[ERROR]:This Player is not online.");
}
un cage command

pawn Код:
CMD:psmuncage(playerid, params[])
{
    new id;
    if(IsPlayerConnected(id))
    {
        if(PlayerInfo[playerid][Admin] < 3)
        {
            if(!sscanf(params, "u", id))
            {
                new string[64];
                new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
                GetPlayerName(playerid, name, sizeof(name));
                GetPlayerName(id, PlayerName, sizeof(PlayerName));
                format(string, sizeof(string), "You have been uncaged by %s.", name);
                SendClientMessage(id, COLOR_LEMON, string);
                format(string, sizeof(string), "You uncage %s .", PlayerName);
                SendClientMessage(playerid, COLOR_LEMON, string);
                SetPlayerPos(id, 1555.097900, -1675.848754, 16.195312);
                SetPlayerInterior(id, 0);
                return 1;
            }
            else return SendClientMessage(playerid, COLOR_GREY, "SYNTEX: /psmuncaged [PlayerID/PartOfName]");
        }
        else return SendClientMessage(playerid, COLOR_RED, "[ERROR]:You are not a Public Safety Member! Or your PSM level is too low!");
    }
    else return SendClientMessage(playerid, COLOR_RED, "[ERROR]:This Player is not online.");
}
and if you look all of them do have
pawn Код:
if(PlayerInfo[playerid][Admin] < LEVEL HERE)
I tested them in non admin account they work fine but beside that they are suppouse to be only for admins?

Anyone got solutions?

(Wonder if it is possible to do in cage and uncage (%s text by %s) tried and I got errors...)
Reply
#2

worked thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)