/prison(jail)
#1

------
Reply
#2

Set their position and assign a variable, eg. bool:isInPrison. You can use gettime() to see if it is time for the person to be released or not.
Reply
#3

pawn Код:
new IsInJail[MAX_PLYAERS];//you can use it to check if the player is in the jail and stop functions/stuff from happening.
//CMD
{
     ResetPlayerWeapons(playerid);//no need, add what ever functions you want.
     SetPlayerPos(playerid,0,0,0);
     IsInJail[playerid]=1;
     SetTimerEx("EndPlayerJail", 30000, false, "i", playerid);//change the timer(currently is 30sec)
}

forward EndPlayerJail(playerid);
public EndPlayerJail(playerid)
{
     IsInJail[playerid]=0;
     SetPlayerPos(playerid,0,0,0);
     return 1;
}
Reply
#4

------
Reply
#5

https://sampforum.blast.hk/showthread.php?tid=254915

Save the timestamps, then check if(pJailTimeStamp >= xxxxxxxxx) etc.
Reply
#6

PHP код:
CMD:prison(playeridparams[]) {
    if(
PlayerInfo[playerid][pAdmin] >= 3) {
        if(
AdminDuty[playerid] != && PlayerInfo[playerid][pAdmin] < 6)
            return 
SendClientMessage(playerid,COLOR_WHITE"You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");
        new 
string[128], giveplayeridminutesreason[64];
        if(
sscanf(params"uds[64]"giveplayeridminutesreason)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /prison [playerid/partofname] [minutes] [reason]");
        if(
IsPlayerConnected(giveplayerid))
        {
            if(
PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin] && AdminDuty[giveplayerid] == 1)
            {
                
SendClientMessage(playeridCOLOR_WHITE"You can't perform this action on an equal or higher level admin that is on-duty.");
                return 
1;
            }
            
SetPlayerArmedWeapon(giveplayerid0);
            
/*if(GetPVarInt(giveplayerid, "PBM") > 0)
            {
                LeavePaintballArena(giveplayerid, GetPVarInt(giveplayerid, "IsInArena"));
            }*/
            
GameTextForPlayer(giveplayerid"~w~Welcome to ~n~~r~Admin Prison"50003);
            
ResetPlayerWeaponsEx(giveplayerid);
            
format(stringsizeof(string), "AdmCmd: %s has been prisoned by %s, reason: %s"GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
            
Log("logs/admin.log"string);
            
format(stringsizeof(string), "AdmCmd: %s has been prisoned by %s, reason: %s"GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
            
SendClientMessageToAllEx(COLOR_LIGHTREDstring);
            if(
PlayerDraggedBy[giveplayerid] != INVALID_PLAYER_ID) {
                
IsCopDragging[PlayerDraggedBy[giveplayerid]] = INVALID_PLAYER_ID;
                
PlayerDragged[giveplayerid] = 0;
                
PlayerDraggedBy[giveplayerid] = INVALID_PLAYER_ID;
            }
            
PlayerInfo[giveplayerid][pWantedLevel] = 0;
            
SetPlayerWantedLevel(giveplayerid0);
            
PlayerInfo[giveplayerid][pJailed] = 3;
            
PlayerInfo[giveplayerid][pJailTime] = minutes*60;
            if(
IsPlayerAttachedObjectSlotUsed(giveplayerid0))
                
RemovePlayerAttachedObject(giveplayerid0);
            
format(PlayerInfo[giveplayerid][pPrisonReason], 128"%s"reason);
            
format(PlayerInfo[giveplayerid][pPrisonedBy], MAX_PLAYER_NAME"%s"GetPlayerNameEx(playerid));
            
PhoneOnline[giveplayerid] = 1;
            
TogglePlayerControllable(giveplayerid0);
            for(new 
06o++)
            {
                
TextDrawShowForPlayer(giveplayeridObjectsLoadingTD[o]);
            }
            
SetPVarInt(giveplayerid"LoadingObjects"1);
               
SetTimerEx("SafeLoadObjects"30000"d"giveplayerid);
            
SetPlayerInterior(giveplayerid69);
            
PlayerInfo[giveplayerid][pVW] = 696969;
            
PlayerInfo[giveplayerid][pInt] = 69;
            
SetPlayerVirtualWorld(giveplayerid696969);
            new 
rand random(sizeof(AdminPrisonFloat));
            
SetPlayerPos(giveplayeridAdminPrisonFloat[rand][0], AdminPrisonFloat[rand][1], AdminPrisonFloat[rand][2]);
            
SetPlayerSkin(giveplayerid50);
            
SetPlayerColor(giveplayeridTEAM_APRISON_COLOR);
        }
    }
    else
    {
        
SendClientMessage(playeridCOLOR_GRAD1"You're not authorized to use that command!");
    }
    return 
1;

Just change the admin ranks to whatever your ranks are.
Reply
#7

try filterscripts-

__________________________________________________ ____
Come here new special Server, very good you will be
shock when seeing this new RP server...

HostName: [ENG]Future Generation Gaming[0.3x R2]
Address: 75.71.205.53:7777
Players: 4 / 250
Ping: 632
Mode: Roleplay FGG v3.5b
Map: Los Angeles

Really good RP need to try!
Reply
#8

Quote:
Originally Posted by DaniceMcHarley
Посмотреть сообщение
I know how to do that mate, but what if the player logged out?
if you're using user files, save the jailtime into a vari named like "SavedJailTime", when the user spawns if(SavedJailTime[playerid] > 0) put em in jail again?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)