SA-MP Forums Archive
Admin level - 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: Admin level (/showthread.php?tid=633987)



Admin level - Despacito - 11.05.2017

I have this stock to show admin level name when an admin executes a command on a player:

pawn Код:
stock AdminLevelName(playerid)
{
    new szString[64];
    switch (Player[playerid][Level])
    {
        case 1: szString = "[Trial Admin]";
        case 2: szString = "[Moderator]";
        case 3: szString = "[General Admin]";
        case 4: szString = "[Manager]";
        case 5: szString = "[Owner]";
    }
    return szString;
}
But for some reason, this level name doesnt show.

Example command:

pawn Код:
CMD:resetwarns(playerid, params[])
{
    new buf[128];
    format(buf, sizeof(buf), "%s %s (%i) has removed your warning log.", AdminLevelName(playerid),ReturnPlayerName(playerid), playerid);
    SendClientMessage(targetid, COLOR_PINKK, buf);
    format(buf, sizeof(buf), "You have removed %s (%i)'s warning log.", ReturnPlayerName(targetid), targetid);
    SendClientMessage(playerid, COLOR_PINKK, buf);
    return 1;
}
Player gets only "Despacito (0) has removed your warning log" but should be (example): "Owner Despacito (0) has removed your warning log."


Re: Admin level - Toroi - 11.05.2017

PHP код:
Player[playerid][Level
Are you sure this is the right enumerator entry to call?


Re: Admin level - Despacito - 11.05.2017

Yes.


Re: Admin level - Despacito - 11.05.2017

Got this only:

Quote:

[00:08:09] AdminLevelName Got Called:




Re: Admin level - Despacito - 12.05.2017

Same.


Re: Admin level - ShihabSoft - 12.05.2017

btw print out the value in Player[playerid][Level], and make sure that's an int.

And try using strcpy


Re: Admin level - Juvanii - 12.05.2017

Make a new command and name it 'test' to send you a message of your level

PHP код:
CMD:test(playeridparams[])
{
    
format(stringsizeof(string), "Your level is: %i"Player[playerid][Level]);
    
SendClientMessage(playerid, -1string);
    return 
1;




Re: Admin level - Despacito - 12.05.2017

Ok, wait everyone.

I'm a fag. I'm a FUCKIN fag.

You know why im insulting myself?

Because i was level 35.

Thats why the admin level name weren't showing.

I reset it to 5 and it works now.

No comment.