Help me with my /jail command
#1

Okay here's my command:
pawn Код:
if(strcmp(cmd, "/ajail", true) == 0) if(ShitInfo[playerid][pMuted] == 0)
    {
      if(IsPlayerConnected(playerid))
      {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /jail [playerid/PartOfName] [time(minutes)]");
                return 1;
            }
            new playa;
            new money;
            playa = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            money = strval(tmp);
            if (GetPlayerAdminz(playerid) >= 1)
            {
              if(IsPlayerConnected(playa))
              {
                if(playa != INVALID_PLAYER_ID)
                {
                    GetPlayerName(playa, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "%s has been Jailed for %d seconds by Admin %s", giveplayer,money,sendername);
                        SendClientMessage(playerid, AC_COLOR, string);
                        ShitInfo[playa][pJailed] = 1;
                        ShitInfo[playa][pJailTime] = money*1;
                        SetPlayerInterior(playa, 6);
                        TogglePlayerControllable(giveplayerid,0);
                        SetPlayerPos(playa, 264.6288,77.5742,1001.0391);
                        }
                        if(ShitInfo[playa][pJailTime] == 0)
                        {
                        SendClientMessage(playa,COLOR_GREEN,"Jail time is over, you are free!");
                    ShitInfo[playa][pJailTime] = 0;
                        ShitInfo[playa][pJailed] = 0;
                    SetPlayerInterior(playa,0);
                    SetPlayerFacingAngle(playa,90.00);
                    SetPlayerPos(playa,1552.6807,-1674.8497,16.1953);
                        SetPlayerFacingAngle(playa,177.0350);
                    SetCameraBehindPlayer(playa);
                    TogglePlayerControllable(playa,1);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
            }
        }
        return 1;
    }
But even when i jail some1 for 1 second they NEVER leave jail! how do i make it so after the jail time is over they leave jail? As you can see i have attempted this can somebody just fix that part?
Reply


Messages In This Thread
Help me with my /jail command - by coole210 - 01.07.2009, 04:04
Re: Help me with my /jail command - by Grim_ - 01.07.2009, 04:09
Re: Help me with my /jail command - by coole210 - 01.07.2009, 04:13
Re: Help me with my /jail command - by Grim_ - 01.07.2009, 04:19

Forum Jump:


Users browsing this thread: 1 Guest(s)