14.03.2011, 14:25
pawn Code:
forward CheckLevel(cmd[]);
public CheckLevel (cmd[])
{
printf("%s",cmd);
print("checklevel1");
for(new i;i<216;i++)
{
if(!strcmp(cmd, Cmds[i][Name], true, strlen(cmd)))
{
print("checklevel2");
printf("%s:%i",Cmds[i][Name],Cmds[i][Level]);
return Cmds[i][Level];
}
}
return 6;
}
forward LevelError(playerid,cmd[]);
public LevelError(playerid,cmd[])
{
new str[128];
printf("%s",cmd);
print("LevelError1");
format(str,sizeof(str),"ERROR:You need to be Administrator Level %d to use %s",CheckLevel(cmd),cmd);
print("LevelError2");
return SendClientMessage(playerid,red,str);
}
when i do /god (needs to be lvl 5.) i am lvl one. it just performs it. so it must be a fail in CheckLevel. but what??
help me!