stock CheckPlayerAdmin(targetid)
{
new adminrank[10];
if(PlayerInfo[targetid][pAdmin] == 0) { adminrank = "None"; }
if(PlayerInfo[targetid][pAdmin] == 1) { adminrank = "Moderator"; }
if(PlayerInfo[targetid][pAdmin] == 2) { adminrank = "Junior"; }
if(PlayerInfo[targetid][pAdmin] == 3) { adminrank = "General"; }
if(PlayerInfo[targetid][pAdmin] == 4) { adminrank = "Senior"; }
if(PlayerInfo[targetid][pAdmin] == 5) { adminrank = "Executive"; }
if(PlayerInfo[targetid][pAdmin] == 6) { adminrank = "Owner"; }
return adminrank;
}
CMD:stats(playerid, params[])
{
new string[128], faction[128];
format(string, sizeof(string), "------------------------------------[%s]-------------------------------", GetName(playerid));
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "|| [Admin]: %s ||", CheckPlayerAdmin(playerid));
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
stock AdminRank(targetid)
{
new adminrank[10];
switch(PlayerInfo[targetid][pAdmin])
{
case 0: { adminrank = "None"; }
case 1: { adminrank = "Moderator"; }
case 2: { adminrank = "Junior"; }
//ETC.
}
return adminrank;
}
new AccountInfo[MAX_PLAYERS]
enum Info
{
AdminLevel // here is made your admin level...
}
// exemple
if (AccountInfo[playerid][AdminLevel] > 0)
{
new lol[40]
format(lol, sizeof lol, "|» You are now logged in as a level %d admin «|",[AdminLevel]);
SendClientMessage(playerid, COLOR_GREEN, lol);
}
}
pawn Код:
|
enum Info
{
AdminLevel
}
new AccountInfo[MAX_PLAYERS][Info];
public OnPlayerConnect(playerid)
{
if (AccountInfo[playerid][AdminLevel] > 0)
{
new string[110];
format(string, sizeof(string), "> You are logged in as level %d Administrator.",[AdminLevel]);
SendClientMessage(playerid, 0xFFFFFFFF, string);
}
}
new lol[40]
About my code, it's right. it's pretty obviously it was to be put in onplayerconnect don't think you?
pawn Код:
|
W:\Users\Magdy\Desktop\Server 3.0e\filterscripts\MyAdmin.pwn(93) : error 029: invalid expression, assumed zero W:\Users\Magdy\Desktop\Server 3.0e\filterscripts\MyAdmin.pwn(93) : error 091: ambiguous constant; tag override is required (symbol "AdminLevel") W:\Users\Magdy\Desktop\Server 3.0e\filterscripts\MyAdmin.pwn(93) : error 029: invalid expression, assumed zero W:\Users\Magdy\Desktop\Server 3.0e\filterscripts\MyAdmin.pwn(93) : fatal error 107: too many error messages on one line
Mecha this might be useful or totally unusful, as your dutch aswell I can help you (in dutch) on teamviewer, but if u dont reply quick, theres a chance that I have to go (school). PM me ur TV details.
edit: got to go, if this problem still occurs tomorrow i'll help ya out. |