Admin level
#1

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."
Reply
#2

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

Yes.
Reply
#4

Got this only:

Quote:

[00:08:09] AdminLevelName Got Called:

Reply
#5

Same.
Reply
#6

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

And try using strcpy
Reply
#7

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;

Reply
#8

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)