SA-MP Forums Archive
DEATH-Arrest not working - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: DEATH-Arrest not working (/showthread.php?tid=667273)



DEATH-Arrest not working - playstores - 16.06.2019

https://pastebin.com/JUKtWN66

Player is not in Jail


Re: DEATH-Arrest not working - Plastikmensch - 16.06.2019

I guess this is supposed to put the player in jail?
Code:
OnPlayerCommandText (playerid, "/ time");
Please show the code in that callback.
- Is the command "/ time"?
- if(!strcmp(cmdtext,"/ time"))?
- It it supposed to be "/time"?

It's better to call a function to put the player in jail than to call a callback or command.


Re: DEATH-Arrest not working - playstores - 17.06.2019

No its just a command that shows you the current time


Re: DEATH-Arrest not working - Plastikmensch - 17.06.2019

Then what is the problem? Players are not getting jailed, because you never put them there.


Re: DEATH-Arrest not working - Jodus - 18.06.2019

You didn't set the jailed player's pos with SetPlayerPos.

PHP Code:
// at OnPlayerDeath
new string [256];
if (
killerid! = INVALID_PLAYER_ID// 
{
    if (
WantedLevel [playerid]> = && PlayerPaintballing [playerid]! = 1)
    {
        new 
price WantedLevel [playerid] * 1200;
        if (
IsPlayerConnected (killerid))
        {
            if (
IsACop (killerid))
            {
                if (
WantedLevel [playerid]> = 1)
                {
                    
GivePlayerMoneySave (playerid, -price);
                    
PlayerInfo [playerid] [pWantedDeaths] + = 1;
                    
PlayerInfo [playerid] [pJailed] = 1;
                    
PlayerInfo [playerid] [pJailTime] = (WantedLevel [playerid] * 60);
                   
// SetPlayerPos(playerid, x, y, z);
                    
format (stringsizeof (string), "You're in jail for% d seconds and have to pay $% d."PlayerInfo [playerid] [pJailTime], price);
                    
SCM (playeridCOLOR_LIGHTREDstring);
                    
WantedPoints [playerid] = 0;
                    
WantedLevel [playerid] = 0;
                    
SCM (playeridCOLOR_LIGHTBLUE"All lawyers were informed!");
                    
OnPlayerCommandText (playerid"/ time");
                    
format (stringsizeof (string), "~ w ~ criminals killed ~ g ~ $% d"price 2);
                    
GameTextForPlayer (killeridstring50001);
                    
GivePlayerMoneySave (killeridprice 2);
                    
// fractional fund [1] + = price / 2;
                    
PlayerPlaySound (killerid10580.00.00.0);
                    
Reset Player Weapons (playerid);
                    
format (stringsizeof (string), "<<% s% s killed the suspect% s >>"GetFrakRang (PlayerInfo [playerid] [pRank], PlayerInfo [playerid] [pMember]), GetName (killerid), GetName (playerid));
                    
OOCNews (COLOR_LIGHTREDstring);
                }
            
            }
        }
    }