Small Error
#1

pawn Код:
//------------------------------------------------------------------------------
dcmd_freeze(playerid,params[])
{
    #pragma unused params
    new pname[MAX_PLAYER_NAME];
    new string[128];
    new cmdreason[100];
    new id;
    if(sscanf(params,"us[100]",id,cmdreason))
    {
        SendClientMessage(playerid,COLOR_ERROR,"Usage: /freeze (Player Name/ID) (Reason)");
        return 1;
    }
    GetPlayerName(id,pname,sizeof pname);
    if(IsFrozen[id] == 1)
    {
        format(string,sizeof(string),"%s(%d) is already frozen by an Administrator. You cannot freeze them.",pname,id);
        SendClientMessage(playerid,COLOR_ERROR,string);
        TogglePlayerControllable(id,1);
        return 1;
    }
    IsFrozen[id] =1;
    format(string,sizeof(string),"An Administrator has frozen %s(%d).  (Reason: %s.)",pname,id,cmdreason);
    SendClientMessageToAll(COLOR_PINK,string);
    TogglePlayerControllable(id,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;
}
//------------------------------------------------------------------------------
dcmd_unfreeze(playerid,params[])
{
    #pragma unused params
    new pname[MAX_PLAYER_NAME];
    new string[128];
    new id;
    if(sscanf(params,"us[100]",id))
    {
        SendClientMessage(playerid,COLOR_ERROR,"Usage: /unfreeze (Player Name/ID)");
        return 1;
    }
    GetPlayerName(id,pname,sizeof pname);
    if(IsFrozen[id] == 0)
    {
        format(string,sizeof(string),"%s(%d) is already un-frozen by an Administrator.",pname,id);
        SendClientMessage(playerid,COLOR_ERROR,string);
        TogglePlayerControllable(id,0);
        return 1;
    }
    IsFrozen[id] =1;
    format(string,sizeof(string),"An Administrator has un-frozen %s(%d)",pname,id);
    SendClientMessageToAll(COLOR_PINK,string);
    TogglePlayerControllable(id,1);

    /*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;
}
It's freezing the player once ONCE, when I unfreeze, then freeze again.
It says
pawn Код:
%s(%d) is already un-frozen by an Administrator.
Reply
#2

pawn Код:
dcmd_unfreeze(playerid,params[])
{
    #pragma unused params
    new pname[MAX_PLAYER_NAME];
    new string[128];
    new id;
    if(sscanf(params,"us[100]",id))
    {
        SendClientMessage(playerid,COLOR_ERROR,"Usage: /unfreeze (Player Name/ID)");
        return 1;
    }
    GetPlayerName(id,pname,sizeof pname);
    if(IsFrozen[id] == 0)
    {
        format(string,sizeof(string),"%s(%d) is already un-frozen by an Administrator.",pname,id);
        SendClientMessage(playerid,COLOR_ERROR,string);
        TogglePlayerControllable(id,0);
        return 1;
    }
    IsFrozen[id] =0;//Here was IsFrozen[id] =1;
    format(string,sizeof(string),"An Administrator has un-frozen %s(%d)",pname,id);
    SendClientMessageToAll(COLOR_PINK,string);
    TogglePlayerControllable(id,1);

    /*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
#3

Thanks dude!
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)