Checking the Level of a player using a function. - 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: Checking the Level of a player using a function. (
/showthread.php?tid=411059)
Checking the Level of a player using a function. -
Magic_Time - 27.01.2013
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(string, sizeof(string), "Administrator %s, Level %s has ...", name, Level(playerid);
SendClientMessage(playerid, -1, string);
It gives me errors, and I don't know if it will work.. Sorry I'm newbie, and sorry for my bad english.
Re: Checking the Level of a player using a function. -
Jeffry - 27.01.2013
pawn Код:
format(string, sizeof(string), "Administrator %s, Level %s has ...", name, Level(playerid));
SendClientMessage(playerid, -1, string);
You only forgot the second closing bracket.