You can spawn a jetpack and admin commands without admin rights
#1

Hello SA-MP Community, I just managed to fix my wonderful Admin/Login system! The problem is, I made a command, and restricted it for Level 3 admins only. Heres the command:

Код:
CMD:jetpack(playerid,params[])
{
    if(pInfo[playerid][Adminlevel] >=3)
    {
        SetPlayerSpecialAction(playerid, 2);
        SendClientMessage(playerid,-1, "|__Jetpack Spawned__|");
        return 1;
        }
        else return SendClientMessage(playerid, -1, " You are not allowed to use this command");
    }
So I went in-game and I done /jetpack. But you don't need a Admin Level 3 or anything! I didn't have a admin level, and the jetpack still spawned. It was supposed to say "You are not allowed to use this command", and stop the jetpack from spawning. And that also happens with the VIPlevel.

I hope you can help me with this!


Thanks!
Reply
#2

pawn Код:
CMD:jetpack(playerid)
{
    if(pInfo[playerid][Adminlevel] < 3) return SendClientMessage(playerid, -1, " You are not allowed to use this command");

    SetPlayerSpecialAction(playerid, 2);
    SendClientMessage(playerid,-1, "|__Jetpack Spawned__|");
    return true;
}
Reply
#3

Try this:

pawn Код:
CMD:jetpack(playerid,params[])
{
    if(pInfo[playerid][Adminlevel] >=3)
    {
        SetPlayerSpecialAction(playerid, 2);
        SendClientMessage(playerid,-1, "|__Jetpack Spawned__|");
    }
    else{SendClientMessage(playerid, -1, " You are not allowed to use this command");}
    return 1;
}
Reply
#4

Still doesn't work! I changed it to your one, went in-game, and I can still spawn a jetpack!
Reply
#5

1) try check your admin level
2) is pInfo[playerid][Adminlevel] reseted when player dis/connect ?
Reply
#6

pawn Код:
//simple is that?
CMD:jetpack(playerid,params[])
{
    if(pInfo[playerid][Adminlevel] <=3)return SendClientMessage(playerid, -1, " You are not allowed to use this command");
        SetPlayerSpecialAction(playerid, 2);
        SendClientMessage(playerid,-1, "|__Jetpack Spawned__|");
   
    return 1;
}
Reply
#7

OK i'll try
Reply
#8

Nope, still doesn't work!
Reply
#9

Ok, thanks guys I managed to fix it! But one little problem! I changed my AdminLevel to level 3, and it still says I need to be a level 3 to use the command

Please help
Reply
#10

Assuming you used DaRk_RaiN's example
Change

pawn Код:
if(pInfo[playerid][Adminlevel] <=3)return SendClientMessage(playerid, -1, " You are not allowed to use this command");
to

pawn Код:
if(pInfo[playerid][Adminlevel] < 3)return SendClientMessage(playerid, -1, " You are not allowed to use this command");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)