#1

Hello i want a jail with time.

But i want it in dcmd.

I mode the jail with COMMAND:.... but doesent work when player go on jail in second he relase'd by jail and he doesent work.

Can to make for mee a good jail please
Reply
#2

Can to give mee with dcmd_jail

dont have any?
Reply
#3

This is my jail and my Unjail can to add time on it ?

PHP Code:
dcmd_jail(playerid,params[])
{
if(
pInfo[playerid][Adminlevel] < 3) return SendClientMessage(playeridCOLOR_RED""ERROR_MESSAGE"");
new 
idtimeadmin[MAX_PLAYER_NAME], JailTimer[MAX_PLAYERS], Jailed[MAX_PLAYERS];
new 
TargetIDreason[20];
new 
str1[128];
new 
targetname[MAX_PLAYER_NAME];
GetPlayerName(TargetID,targetname,24);
GetPlayerName(TargetID,targetname,24);
GetPlayerName(playeridadminsizeof(admin));
GetPlayerName(idJailedsizeof(Jailed));
if(
sscanf(params,"df",id,time)) return SendClientMessage(playerid0xFF0000AA"USAGE: /jail [playerid] [time] ");
if (!
IsPlayerConnected(id)) return SendClientMessage(playerid0xFF0000AA"ERROR: Player is not connected.");
if(
Jailed[id] == 1) return SendClientMessage(playerid0xFF0000AA"ERROR: Player is already jailed.");
GameTextForPlayer(TargetID,"~r~Jailed By Admin"30003);
format(str1,sizeof(str1),"** JAIL: %s(%d) (ADMIN JAIL) Has Been Jailed By An Admin."targetnameTargetIDreason);
SendClientMessageToAll(COLOR_HOTPINKstr1);
print(
str1);
SetPlayerInterior(id3);
SetPlayerVirtualWorld(id10);
SetPlayerFacingAngle(id360.0);
SetPlayerPos(id197.5662175.48001004.0);
SetPlayerHealth(id9999999999.0);
ResetPlayerWeapons(id);
jail[playerid] =1;
JailTimer[id] = SetTimerEx("unjail"time*60000false"i"id);
return 
1;
}


dcmd_unjail(playerid,params[])
{
new 
idadmin[MAX_PLAYER_NAME], JailTimer[MAX_PLAYERS], Jailed[MAX_PLAYERS] ;
new 
TargetID;
GetPlayerName(playeridadminsizeof(admin));
GetPlayerName(idJailedsizeof(Jailed));
if(
pInfo[playerid][Adminlevel] < 3) return SendClientMessage(playeridCOLOR_RED""ERROR_MESSAGE"");
if(
sscanf(params,"d",id)) return SendClientMessage(playerid0xFF0000AA"USAGE: /unjail <playerid>");
if (!
IsPlayerConnected(id)) return SendClientMessage(playerid0xFF0000AA"ERROR: Player is not connected.");
if(
Jailed[id] == 0) return SendClientMessage(playerid0xFF0000AA"ERROR: Player is not jailed.");
Jailed[id] = 0;
SetPlayerInterior(id0);
SetPlayerVirtualWorld(id0);
SpawnPlayer(id);
SetPlayerHealth(id100);
KillTimer(JailTimer[id]);
jail[playerid] =0;
GameTextForPlayer(TargetID,"~r~Unjailed By Admin"30003);
return 
1;

Reply
#4

I have made it using zcmd, convert it yourself:
pawn Code:
// The functions below are not created by me
new caged[MAX_PLAYERS];
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;
}
^Add this to your script.

pawn Code:
new jailtimer;
// need to be rcon admin for using the command
CMD:jail (playerid, params[])
{
    new giveid, time, str[128];
    if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You can't use this cmd.");
    if (sscanf(params, "ui", giveid, time)) return SendClientMessage(playerid, -1, "USAGE: /jail [ID] [TimeInMilliSeconds]");
    if (giveid == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Invalid player ID!");
    CagePlayer(giveid);
    format(str, sizeof(str), "You are now jailed for %i milliseconds!", time);
    SendClientMessage(giveid, -1, str);
    jailtimer = SetTimerEx("UnJailPlayer", time, false, "i", giveid);
    return 1;
}

forward UnJailPlayer (playerid);
public UnJailPlayer(playerid)
{
    UnCagePlayer(playerid);
    KillTimer(jailtimer);
    SendClientMessage(playerid, -1, "You are now unjailed!");
    return 1;
}
Edit as per your needs.
Reply
#5

Dont work -.- he have verry error's
Reply
#6

Hello
me i use

PHP Code:
dcmd_jail(playerid,params[])
{
    new 
id;
    if(
IsPlayerConnected(id))
    {
        if(
pInfo[playerid][Adminlevel] > 3)
        {
            if(!
sscanf(params"u"id))
            {
                new 
string[64];
                
format(stringsizeof(string), "You have been jailed by %s."PlayerName(playerid));
                
SendClientMessage(id0xD8D8D8FFstring);
                
format(stringsizeof(string), "You jailed %s ."PlayerName(id));
                
SendClientMessage(playerid0xD8D8D8FFstring);
                
SetPlayerPos(id264.5442199707,77.155387878418,1001.0390625);
                
SetPlayerInterior(id6);
                return 
true;
            }
            else return 
SendClientMessage(playerid0xD8D8D8FF"USAGE: /jail [PlayerId/PartOfName]");
        }
        else return 
SendClientMessage(playerid, -1"You are not allowed to use this command.");
    }
    else return 
SendClientMessage(playerid0xD8D8D8FF"Player is not connected.");
}
dcmd_unjail(playerid,params[])
{
    new 
id;
    if(
IsPlayerConnected(id))
    {
        if(
pInfo[playerid][Adminlevel] > 3)
        {
            if(!
sscanf(params"u"id))
            {
                new 
string[64];
                
format(stringsizeof(string), "You have been unjailed by %s."PlayerName(playerid));
                
SendClientMessage(id0xD8D8D8FFstring);
                
format(stringsizeof(string), "You unjailed %s ."PlayerName(id));
                
SendClientMessage(playerid0xD8D8D8FFstring);
                
SetPlayerPos(id1552.1305,-1675.6511,16.1554);
                
SetPlayerInterior(id0);
                return 
true;
               }
            else return 
SendClientMessage(playerid0xD8D8D8FF"USAGE: /unjail [PlayerId/PartOfName]");
        }
        else return 
SendClientMessage(playerid0"You are not allowed to use this command.");
    }
    else return 
SendClientMessage(playerid0xD8D8D8FF"Player is not connected.");
}
stock PlayerName(playerid)
{
    new 
Name[MAX_PLAYER_NAME];
    
GetPlayerName(playeridNamesizeof(Name));
    return 
Name;

you can devloppe it and make your timers ........
regards
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)