Checking the Level of a player using a function.
#1

Hi,
I want to check the player admin with a simple function, I tried it:
PHP код:
stock Level(playerid)
{
    new 
level;
    switch(
level)
    {
        case 
0"Newb";
        case 
1"Operator";
        case 
2"Moderator";
        case 
3"Junior Administrator";
        case 
4"Senior Administrator";
        case 
5"Head Administrator":
        case 
6"Hero Administrator";
        case 
7"Community Owner";
    }    

After that, I might use this function by this way:

PHP код:
format(stringsizeof(string), "Administrator %s, Level %s has ..."nameLevel(playerid);
SendClientMessage(playerid, -1string); 
It gives me errors, and I don't know if it will work.. Sorry I'm newbie, and sorry for my bad english.
Reply
#2

pawn Код:
format(string, sizeof(string), "Administrator %s, Level %s has ...", name, Level(playerid));
SendClientMessage(playerid, -1, string);
You only forgot the second closing bracket.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)