Help with freezeall command
#1

Hello,
So i want to add to my GM,Freeze all and unfreeze all commands for admins but i get errors
Code:
dcmd_adfreezeall(playerid,params[])
{
new string[128];
new ID;
new cmdreason[100];
for(new i = 0; i < MAX_PLAYERS; i++)
IsFrozen[i] =1;
format(string,sizeof(string),"[ADMIN] %s(%d) has frozen all the players for reason: %s.",PlayerName(playerid),playerid,PlayerName(ID), cmdreason);
SendClientMessageToAll(COLOR_ADMIN,string);
TogglePlayerControllable(i,0);

format(string,sizeof(string),"9[ADMIN] Administrator has frozen %s(%d) for reason: %s.",PlayerName(ID),ID,cmdreason);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
return 1;
}
Reply
#2

Код:
COMMAND:freezeall(playerid, params[])
{
    if(PlayerInfo[playerid][power] < 4) return SendClientError(playerid, CANT_USE_CMD);
    PlayerLoop(i)
    {
        SendClientMSG(i, COLOR_YELLOW, "[Admin] All players have been frozen by Admin %s", RPName(playerid));
        frozen[i] = 1;
        TogglePlayerControllable(i, false);
	}
	return 1;
}
COMMAND:unfreezeall(playerid, params[])
{
    if(PlayerInfo[playerid][power] < 4) return SendClientError(playerid, CANT_USE_CMD);
    PlayerLoop(i)
    {
        SendClientMSG(i, COLOR_YELLOW, "[Admin] All players have been un-frozen by Admin %s", RPName(playerid));
        frozen[i] = 0;
        TogglePlayerControllable(i, true);
		SetPVarInt(i, "Tied", 0);
	}
	return 1;
}
There you go +rep if it helped
Reply
#3

Quote:
Originally Posted by xdarren
Посмотреть сообщение
Код:
COMMAND:freezeall(playerid, params[])
{
    if(PlayerInfo[playerid][power] < 4) return SendClientError(playerid, CANT_USE_CMD);
    PlayerLoop(i)
    {
        SendClientMSG(i, COLOR_YELLOW, "[Admin] All players have been frozen by Admin %s", RPName(playerid));
        frozen[i] = 1;
        TogglePlayerControllable(i, false);
	}
	return 1;
}
COMMAND:unfreezeall(playerid, params[])
{
    if(PlayerInfo[playerid][power] < 4) return SendClientError(playerid, CANT_USE_CMD);
    PlayerLoop(i)
    {
        SendClientMSG(i, COLOR_YELLOW, "[Admin] All players have been un-frozen by Admin %s", RPName(playerid));
        frozen[i] = 0;
        TogglePlayerControllable(i, true);
		SetPVarInt(i, "Tied", 0);
	}
	return 1;
}
There you go +rep if it helped
your code is very different from his code.

Try these
pawn Код:
dcmd_adfreezeall(playerid,params[])
{
    new
        string[ 128 ],
        ID,
        cmdreason[ 100 ]
    ;

    for(new i = 0; i < MAX_PLAYERS; i++) IsFrozen[i] =1, TogglePlayerControllable(i,0);


    format(string,sizeof(string),"[ADMIN] %s(%d) has frozen all the players for reason: %s.",PlayerName(playerid),playerid,PlayerName(ID), cmdreason);
    SendClientMessageToAll(COLOR_ADMIN,string);

    format(string,sizeof(string),"9[ADMIN] Administrator has frozen %s(%d) for reason: %s.",PlayerName(ID),ID,cmdreason);
    IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)