Cmds not working - 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: Cmds not working (
/showthread.php?tid=416852)
Cmds not working -
Geeboi_Mehdi - 18.02.2013
i use the cmd ingame it says i am not admin here is it;
pawn Код:
if(strcmp(cmd, "/reloadhouses", true) == 0)
{
if(PInfo[playerid][AdminLevel] == 5)
{
for(new i=0;i<MAX_HOUSES;i++)
{
ReloadHouse(i);
}
SendClientMessage(playerid, COLOR_WHITE, "You have reloaded all houses.");
AdminLog(playerid, "/reloadhouses", "Reloaded Houses", "Houses");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_ERROR, "You are not an administrator !");
return 1;
}
}
i Removed This part maybe that will make it work but it didn't
pawn Код:
if(strcmp(cmd, "/reloadhouses", true) == 0)
{
if(PInfo[playerid][AdminLevel] == 2)
{
for(new i=0;i<MAX_HOUSES;i++)
{
ReloadHouse(i);
}
SendClientMessage(playerid, COLOR_WHITE, "You have reloaded all houses.");
AdminLog(playerid, "/reloadhouses", "Reloaded Houses", "Houses");
return 1;
}
}
What did i do wrong?
Re: Cmds not working -
YesYesYes - 18.02.2013
ahmmm.... try return 1; at the end??
and what errors or warning you get?
Re: Cmds not working -
Geeboi_Mehdi - 18.02.2013
i didnt get any warning or Error Weird eh
Re: Cmds not working -
Blast3r - 18.02.2013
It could be because you only set it as if he's level 2 he can use it, not lower or higher, or lvl 5 same..
You need if(PInfo[playerid][AdminLevel] <= 2) or just < 2
Re: Cmds not working -
Geeboi_Mehdi - 18.02.2013
I did Also if you are Level 6 or 5 u can do all the cmds i dont understand
Re: Cmds not working -
Blast3r - 18.02.2013
Well now if you did <= 2 that means that any rank that's 2 or higher can use that command, do the same on the one with level 5, hope you get it.