/cage (id) (reason)
#1

I need to add a reason to the /cage cmd.
Ex: /cage (id) (reason)
Ex2: /cage 1 hacking
Ex3: ** ADMIN CAGE: Noobster (2) has been caged - hacking

pawn Code:
dcmd_cage(playerid,params[])
{
    if(AccInfo[playerid][Level] < 4)
    return ErrorMessages(playerid, 5);

    new Index;
    new tmp[256];  tmp  = strtok(params, Index);
    new tmp2[256]; tmp2 = strtok(params, Index);
    new player1 = ReturnUser(tmp);
    new time = strval(tmp2);

    if(!strlen(tmp)) return
    SendClientMessage(playerid, LIGHTBLUE2, "Usage: /cage [PlayerID] [Time]") &&
    SendClientMessage(playerid, orange, "Function: Will hold player in a Cage by specified Time");

    if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (AccInfo[player1][Level] != ServerInfo[MaxAdminLevel]))
    {

    if(!strlen(tmp2))
    return SendClientMessage(playerid, red, "ERROR: Not specified Time!");

    if(time < 10)
    return SendClientMessage(playerid, red, "ERROR: Time must be greater than 10 Seconds!");

    if(AccInfo[player1][pCaged] == 1)
    return SendClientMessage(playerid, red, "ERROR: Player is already in Cage!");

    new string[128];
    new playername[MAX_PLAYER_NAME];
    new adminname [MAX_PLAYER_NAME];
    SendCommandToAdmins(playerid,"Cage");
    GetPlayerName(player1, playername, sizeof(playername));
    GetPlayerName(playerid, adminname, sizeof(adminname));
    format(string, sizeof(string), "** ADMIN CAGE: %s Has Been Caged", playername);
    SendClientMessageToAll(adminpink, string);
    TogglePlayerControllable(player1, 0);
    AccInfo[player1][pCageTime] = time;
    AccInfo[player1][pCaged] = 1;
    GetPlayerPos(playerid, LPosX[player1], LPosY[player1], LPosZ[player1]);
    SetTimerEx("CagePlayer", 1000, 0, "i", player1);
    SetTimerEx("UnCagePlayer", AccInfo[player1][pCageTime]*1000, 0, "i", player1);
    }
    else return ErrorMessages(playerid, 3);
    return 1;
    }
Reply


Messages In This Thread
/cage (id) (reason) - by SnG.Scot_MisCuDI - 15.12.2011, 02:19
Re: /cage (id) (reason) - by Ballu Miaa - 15.12.2011, 02:56
Re: /cage (id) (reason) - by SnG.Scot_MisCuDI - 15.12.2011, 03:23
Re: /cage (id) (reason) - by SnG.Scot_MisCuDI - 15.12.2011, 04:01
Re: /cage (id) (reason) - by suhrab_mujeeb - 15.12.2011, 06:48
Re: /cage (id) (reason) - by Scenario - 15.12.2011, 10:55
Re: /cage (id) (reason) - by vassilis - 15.12.2011, 14:19
Re: /cage (id) (reason) - by SnG.Scot_MisCuDI - 15.12.2011, 21:09
Re: /cage (id) (reason) - by Scenario - 15.12.2011, 21:17
Re: /cage (id) (reason) - by SnG.Scot_MisCuDI - 15.12.2011, 21:18

Forum Jump:


Users browsing this thread: 1 Guest(s)