freezeall
#1

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
Reply
#2

please post it in [code][ /code] tags.
And tell us which errors are coming and on which lines.
Reply
#3

PHP код:
CMD:freezeall(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playeridCOLOR_GREY"You are not authorized to use this command.");
    foreach(
playeri)
    
TogglePlayerControllable(i0);
    return 
1;

Should be:
PHP код:
CMD:freezeall(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playeridCOLOR_GREY"You are not authorized to use this command.");
    foreach (new 
Player)
    {
        
TogglePlayerControllable(i0);
    }
    return 
1;

No need for that:

PHP код:
else if(PlayerInfo[playerid][pAdmin] >= 1)
{
TogglePlayerControllable(i1);

Reply
#4

i dont want admins 2 be frozen
Reply
#5

Then here:


PHP код:
CMD:freezeall(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playeridCOLOR_GREY"You are not authorized to use this command.");
    foreach (new 
Player)
    {
        if(
PlayerInfo[i][pAdmin] < 1)
        {
            
TogglePlayerControllable(i0);
        }
    }
    return 
1;

And if you want a message saying that admin has frozen everyone then here:

PHP код:
CMD:freezeall(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playeridCOLOR_GREY"You are not authorized to use this command.");
    foreach (new 
Player)
    {
        if(
PlayerInfo[i][pAdmin] < 1))
        {
            
TogglePlayerControllable(i0);
        }
    }
    new 
aname[MAX_PLAYER_NAME];
    
GetPlayerName(playeridaname,sizeof(aname));
    new 
string[60];
    
format(string,sizeof(string), "Admin %s has frozen everyone!"aname);
    
SendClientMessageToAll(-1string);
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)