cage, uncage...
#1

So i got this:
pawn Код:
stock CagePlayer(playerid)
{
      if(IsPlayerConnected(playerid))
      {
      new Float:X, Float:Y, Float:Z;
      GetPlayerPos(playerid, X, Y, Z);
      cage[playerid] = CreateObject(985, X, Y+4, Z, 0.0, 0.0, 0.0);
      cage2[playerid] = CreateObject(985, X+4, Y, Z, 0.0, 0.0, 90.0);
      cage3[playerid] = CreateObject(985, X-4, Y, Z, 0.0, 0.0, 270.0);
      cage4[playerid] = CreateObject(985, X, Y-4, Z, 0.0, 0.0, 180.0);
      caged[playerid] = 1; // Use this in a /cage command to prevent being caged twice and causing the cage to be unremovable.
      PlayerPlaySound(playerid, 1137, X, Y, Z);
      }
}

stock UnCagePlayer(playerid)
{
      cage[playerid] = DestroyObject(cage[playerid]);
      cage2[playerid] = DestroyObject(cage2[playerid]);
      cage3[playerid] = DestroyObject(cage3[playerid]);
      cage4[playerid] = DestroyObject(cage4[playerid]);
      caged[playerid] = 0;
}
pawn Код:
CMD:cage(playerid, params[])
{
    new string[256], id, reason, PlayerName[MAX_PLAYER_NAME];
    if(PVar[playerid][pLevel] < 3) return
                                            SendClientMessage(playerid, COLOR_RED, "ERROR : You need to be administrator level 3 to use this command!");
                                            format(string, sizeof(string), "%s has used the command '/cage'");
                                            SendAdminMessage(COLOR_YELLOW, string);
    if(sscanf(params, "uz", id, reason)) return SCM(playerid, COLOR_RED, "* Usage : /cage [PlayerID/Name] [Reason]");
    CagePlayer(id);
    CageTimer = SetTimer("UnCagePlayer",60000,false);
    GetPlayerName(id, PlayerName, sizeof(PlayerName));
    format(string, sizeof(string), "*** Administrator %s have caged %s for 1 minute | Reason : %d", pName(playerid), PlayerName, reason);
    SCMTA(COLOR_YELLOW, string);
    return true;
}

CMD:uncage(playerid, params[])
{
    new string[256], id, reason, PlayerName[MAX_PLAYER_NAME];
    if(PVar[playerid][pLevel] < 3) return
                                            SendClientMessage(playerid, COLOR_RED, "ERROR : You need to be administrator level 3 to use this command!");
                                            format(string, sizeof(string), "%s has used the command '/uncage'");
                                            SendAdminMessage(COLOR_YELLOW, string);
    if(sscanf(params, "uz", id, reason)) return SCM(playerid, COLOR_RED, "* Usage : /uncage [PlayerID/Name] [Reason]");
    KillTimer(CageTimer);
    UnCagePlayer(id);
    GetPlayerName(id, PlayerName, sizeof(PlayerName));
    format(string, sizeof(string), "*** Administrator %s has UnCaged %s | Reason : %d", pName(playerid), PlayerName, reason);
    SCMTA(COLOR_YELLOW, string);
    return true;
}
I defined SCM (SendClientMessage)
And SCMTA(SendClientMessageToall)

Problems:

The reason isnt working, and the player caged name too, btw i got pName(playerid) stock.
And its not caging the player at all...
HELP!
Reply


Messages In This Thread
cage, uncage... - by Markx - 06.04.2011, 20:12
Re: cage, uncage... - by Rock_Ro - 06.04.2011, 20:49
Re: cage, uncage... - by maramizo - 06.04.2011, 20:58
Re: cage, uncage... - by Markx - 06.04.2011, 21:19
Re: cage, uncage... - by -Rebel Son- - 06.04.2011, 22:17
Re: cage, uncage... - by Markx - 07.04.2011, 06:37

Forum Jump:


Users browsing this thread: 3 Guest(s)