freezeall - 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: freezeall (
/showthread.php?tid=384850)
freezeall -
T-Raw - 13.10.2012
CMD:freezeall(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
foreach(player, i)
TogglePlayerControllable(i, 0);
else if(PlayerInfo[playerid][pAdmin] >= 1)
{
TogglePlayerControllable(i, 1);
}
return 1;
}
i need help if anyone see's any errors
Re: freezeall -
[HK]Ryder[AN] - 13.10.2012
please post it in [code][ /code] tags.
And tell us which errors are coming and on which lines.
Re: freezeall -
gtakillerIV - 13.10.2012
PHP код:
CMD:freezeall(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
foreach(player, i)
TogglePlayerControllable(i, 0);
return 1;
}
Should be:
PHP код:
CMD:freezeall(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
foreach (new i : Player)
{
TogglePlayerControllable(i, 0);
}
return 1;
}
No need for that:
PHP код:
else if(PlayerInfo[playerid][pAdmin] >= 1)
{
TogglePlayerControllable(i, 1);
}
Re: freezeall -
T-Raw - 13.10.2012
i dont want admins 2 be frozen
Re: freezeall -
gtakillerIV - 13.10.2012
Then here:
PHP код:
CMD:freezeall(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
foreach (new i : Player)
{
if(PlayerInfo[i][pAdmin] < 1)
{
TogglePlayerControllable(i, 0);
}
}
return 1;
}
And if you want a message saying that admin has frozen everyone then here:
PHP код:
CMD:freezeall(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
foreach (new i : Player)
{
if(PlayerInfo[i][pAdmin] < 1))
{
TogglePlayerControllable(i, 0);
}
}
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname,sizeof(aname));
new string[60];
format(string,sizeof(string), "Admin %s has frozen everyone!", aname);
SendClientMessageToAll(-1, string);
return 1;
}