PDA

View Full Version : DEATH-Arrest not working


playstores
16/06/2019, 01:02 PM
https://pastebin.com/JUKtWN66

Player is not in Jail

Plastikmensch
16/06/2019, 02:06 PM
I guess this is supposed to put the player in jail?
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.

playstores
17/06/2019, 05:46 PM
No its just a command that shows you the current time

Plastikmensch
17/06/2019, 07:35 PM
Then what is the problem? Players are not getting jailed, because you never put them there.

Jodus
18/06/2019, 12:40 AM
You didn't set the jailed player's pos with SetPlayerPos.

// at OnPlayerDeath
new string [256];
if (killerid! = INVALID_PLAYER_ID) //
{
if (WantedLevel [playerid]> = 1 && 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 (string, sizeof (string), "You're in jail for% d seconds and have to pay $% d.", PlayerInfo [playerid] [pJailTime], price);
SCM (playerid, COLOR_LIGHTRED, string);
WantedPoints [playerid] = 0;
WantedLevel [playerid] = 0;
SCM (playerid, COLOR_LIGHTBLUE, "All lawyers were informed!");
OnPlayerCommandText (playerid, "/ time");
format (string, sizeof (string), "~ w ~ criminals killed ~ g ~ $% d", price / 2);
GameTextForPlayer (killerid, string, 5000, 1);
GivePlayerMoneySave (killerid, price / 2);
// fractional fund [1] + = price / 2;
PlayerPlaySound (killerid, 1058, 0.0, 0.0, 0.0);
Reset Player Weapons (playerid);
format (string, sizeof (string), "<<% s% s killed the suspect% s >>", GetFrakRang (PlayerInfo [playerid] [pRank], PlayerInfo [playerid] [pMember]), GetName (killerid), GetName (playerid));
OOCNews (COLOR_LIGHTRED, string);
}

}
}
}
}