27.01.2013, 17:54
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".
I tried to see what the console prints. And this is what appears.
That's what I have under "OnPlayerConnect":
The help will be appreciated.
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;
}
Код:
[14:07:11] Player Drake, Level: @Drake has joined in the server
Код:
printf("Player %s, Level: %s has joined in the server", Name(playerid), GetLevel(playerid));