Requesting help with this function.
#1

I'm very sorry, if there are errors in the code, I'm just learning.
I hope you can help me.

Without further ado, What I want to do with this function is get the level of some player and it will be printed as the name defined.

Whether a player is level 0, it shall be printed "Newbie".
Whether a player is level 1, it shall be printed "Operator".

PHP код:
stock GetLevel(playerid)
{
        new 
level[21];
    if(
PlayerInfo[playerid][pAdmin] == 0)
    {
    
level "Newbie";
    }
    if(
PlayerInfo[playerid][pAdmin] == 1)
    {
    
level "Operator";
    }
    if(
PlayerInfo[playerid][pAdmin] == 2)
    {
    
level "Moderator";
    }
    if(
PlayerInfo[playerid][pAdmin] == 3)
    {
    
level "Junior Administrator";
    }
    if(
PlayerInfo[playerid][pAdmin] == 4)
    {
    
level  "Senior Administrator";
    }
    if(
PlayerInfo[playerid][pAdmin] == 5)
    {
    
level  "Head Administrator";
    }
    if(
PlayerInfo[playerid][pAdmin] == 6)
    {
    
level "Hero Administrator";
    }
    if(
PlayerInfo[playerid][pAdmin] == 7)
    {
    
level "Community Owner";
    }
    return 
1;

I tried to see what the console prints. And this is what appears.
Код:
[14:07:11] Player Drake, Level: @Drake has joined in the server
That's what I have under "OnPlayerConnect":

Код:
printf("Player %s, Level: %s has joined in the server", Name(playerid), GetLevel(playerid));
The help will be appreciated.
Reply


Messages In This Thread
Requesting help with this function. - by Magic_Time - 27.01.2013, 17:54
Re: Requesting help with this function. - by gtakillerIV - 27.01.2013, 17:56
Re: Requesting help with this function. - by Magic_Time - 27.01.2013, 17:58
Re: Requesting help with this function. - by beastorc3 - 27.01.2013, 18:00
Re: Requesting help with this function. - by Magic_Time - 27.01.2013, 18:03

Forum Jump:


Users browsing this thread: 1 Guest(s)