SA-MP Forums Archive
This Is Weird... Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: This Is Weird... Help (/showthread.php?tid=312133)



This Is Weird... Help - Buzzbomb - 20.01.2012

It works Thats all that matters Now for admins to control it Thats the problem.. I got about 8 admin commands My levels are 1 to 5 And Well Im level 5 Im not Authorized Any help be appreciated I'll +rep I know stupid to ask but What Control struction Would be better For High level admins to control lower Admin Commands and Lower admins to control only there level What ever command is Lower then there level... Thanks Promise to Rep you.. No clue What its for but U get a plus from me..

pawn Код:
CMD:warn(playerid, params[])
{

    new reason[128], id;
    if(PlayerInfo[playerid][pAdminLevel] > 1) SendClientMessage(playerid, ERROR, "Your Not Authorized");
    else {
        if(sscanf(params, "us", id, reason)) SendClientMessage(playerid, WARNING, "Usage : /Warn ID (reason)");
        else {
            if(!IsPlayerConnected(id)) SendClientMessage(playerid, WARNING, "Player Isn't Online");
            else {
                new string[256];
                new sendername[MAX_PLAYER_NAME];
                new giveplayer[MAX_PLAYER_NAME];
                GetPlayerName(playerid, sendername, sizeof(sendername));
                GetPlayerName(id, giveplayer, sizeof(giveplayer));
                format(string, 256, "%s(%i) Has Been Warned By %s(%i) For %s",giveplayer,id,sendername,playerid,reason);
                SendClientMessageToAll(ERROR, string);
            }
        }
    }
    return 1;
}



Re: This Is Weird... Help - Mrki_Drakula - 20.01.2012

Hello,

I don't understand your questiong at all. If everything works just fine, what's the wrong with the code then? Can you precise your question clearly? Well, in that "CMD:warn" command it's supposed to be for level 2 Admins and Level greater than number 2, right? If you want to make the command works for Level 1 Admin too, you should add a little equals sign:
Quote:

if(PlayerInfo[playerid][pAdminLevel] >= 1)

Sorry if this is not the right answer, but i told you before, i don't get it what do you need actually.

Your friend,
Mrki Drakula.


Re: This Is Weird... Help - Buzzbomb - 20.01.2012

Um you just answered it.. I'll Try >= If level 5 cant control it Im make everyone level 1 fuck the levels


Re: This Is Weird... Help - Buzzbomb - 20.01.2012

Quote:
Originally Posted by Mrki_Drakula
Посмотреть сообщение
Hello,

I don't understand your questiong at all. If everything works just fine, what's the wrong with the code then? Can you precise your question clearly? Well, in that "CMD:warn" command it's supposed to be for level 2 Admins and Level greater than number 2, right? If you want to make the command works for Level 1 Admin too, you should add a little equals sign:


Sorry if this is not the right answer, but i told you before, i don't get it what do you need actually.

Your friend,
Mrki Drakula.
Okay Rechanged all the levels and Put 2 3 4 5 and Added >= And Still not Authorized I need higher level admins to control Lower Level Admin Commands... I'm Getting Confused On the Control Structures.. Is it This > >= == != <= <
I think i tried everyone of them in somewhere i cant Control Something i get unauthorized


Re: This Is Weird... Help - Tanush123 - 20.01.2012

Sir, do you mean that lower admin level cannot /warn higher?


Re: This Is Weird... Help - Babul - 20.01.2012

you used
pawn Код:
if(PlayerInfo[playerid][pAdminLevel] > 1)
and thats indeed wrong. try
pawn Код:
if(PlayerInfo[playerid][pAdminLevel] < 2)
each admin lower than level 2 (0, so none, and level 1) cant use the command, but level 2 or higher, can use it. you just made the simple mistake to send the "not authorized" message to admins who are level 1 or higher, so changine the code would have done aswell (the real commands code, swapped with the error message)..