Some Admin Commands?
#2

pawn Код:
CMD:freeze(playerid,params[])
{
    new id;
    if(sscanf(params,"u",id)) return SendClientMessage(playerid,-1,"USAGE: /freeze [playerid]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"ERROR: Invalid playerid");
    TogglePlayerControllable(id,0);
    GameTextForPlayer(id,"~r~frozen",4000,4);
    return 1;
}

CMD:unfreeze(playerid,params[])
{
    new id;
    if(sscanf(params,"u",id)) return SendClientMessage(playerid,-1,"USAGE: /unfreeze [playerid]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"ERROR: Invalid playerid");
    TogglePlayerControllable(id,1);
    GameTextForPlayer(id,"~r~unfrozen",4000,4);
    return 1;
}

CMD:unfreezeall(playerid,params[])
{
    foreach(new i:Player)
    {
        TogglePlayerControllable(i,1);
        GameTextForPlayer(i,"~r~unfrozen",4000,4);
    }
    return 1;
}

CMD:freezeall(playerid,params[])
{
    foreach(new i:Player)
    {
        TogglePlayerControllable(i,0);
        GameTextForPlayer(i,"~r~frozen",4000,4);
    }
    return 1;
}
Don't forget to include foreach and zcmd.
Reply


Messages In This Thread
Some Admin Commands? - by MAFIAWARS - 22.09.2013, 15:18
Re: Some Admin Commands? - by tyler12 - 22.09.2013, 15:22
Re: Some Admin Commands? - by MAFIAWARS - 22.09.2013, 15:33
Re: Some Admin Commands? - by tyler12 - 22.09.2013, 15:34
Re: Some Admin Commands? - by MAFIAWARS - 22.09.2013, 15:35
AW: Some Admin Commands? - by Skimmer - 22.09.2013, 16:03
Re: Some Admin Commands? - by x96664 - 22.09.2013, 16:10
Re: Some Admin Commands? - by MAFIAWARS - 22.09.2013, 18:31

Forum Jump:


Users browsing this thread: 1 Guest(s)