[HELP] Command - 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: [HELP] Command (
/showthread.php?tid=513815)
[HELP] Command -
monster010 - 18.05.2014
I wish when an admin type /freezeall to freeze all payers on server, but not admins. What I did not work. A little help?
pawn Код:
if(strcmp(cmd, "/freezeall", true) == 0 || strcmp(cmd, "/fall", true) == 0)
{
for(new i=0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[playerid][pAdmin] >= 5)
{
if (IsPlayerConnected(i))
{
TogglePlayerControllable(i,0);
new ab[256];
format(ab,sizeof(ab),"[ANTI-ABUSE] %s ussed /freezeall command !",GetName(playerid));
SendToAdmins(COLOR_LIGHTRED,ab);
}
if(PlayerInfo[playerid][pAdmin] > 0)
{
TogglePlayerControllable(i,1);
SendClientMessage(playerid, COLOR_GREY, "INFO: Don't got freezed, because you are an admin !");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Acces denied !");
}
}
return 1;
}
Re: [HELP] Command -
Stinged - 18.05.2014
Move if(PlayerInfo[playerid][pAdmin] > 0) under if(IsPlayerConnected(i)) and replace playerid by i.
Re: [HELP] Command -
Threshold - 18.05.2014
pawn Код:
if(strcmp(cmd, "/freezeall", true) == 0 || strcmp(cmd, "/fall", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_GREY, "Access denied!");
for(new i=0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(PlayerInfo[i][pAdmin]) continue;
TogglePlayerControllable(i,0);
}
new ab[70];
format(ab, sizeof(ab), "[ANTI-ABUSE] %s used /freezeall command !",GetName(playerid));
SendToAdmins(COLOR_LIGHTRED, ab);
return 1;
}