Jail Textdraw
#1

Anyone help me fix jail time, if the player jailed for 00:234422
why don't go 01:24?
else // The wanted player didn't pull over, now the police player has the right to send him to jail and double the fine
Код:
{
	    // Set jailtime
	    JailTime = DefaultJailTime;
		// Calculate the fine (double the normal fine)
		Fine = GetPlayerWantedLevel(PlayerToFine) * DefaultFinePerStar * 2;
		// Reward the police player (give cash and points)
		RewardPlayer(playerid, Fine, GetPlayerWantedLevel(PlayerToFine));
		// Let the police player know that he jailed the wanted player
		format(PoliceMsg, 200, TXT_PoliceJailedPlayerReward, FinedPlayerName, Fine);
		SendClientMessage(playerid, 0xFFFFFFFF, PoliceMsg);
		// Let the wanted player pay a double fine
		RewardPlayer(PlayerToFine, -Fine, 0);
		// Let the player know he's been jailed and for how long
		format(PlayerMsg, 200, TXT_PlayerGotJailedByPolice, PoliceName, (JailTime/(60*60))%24);
		SendClientMessage(PlayerToFine, 0xFFFFFFFF, PlayerMsg);
		// Let the other players know that the police player has jailed the wanted player
		format(PoliceMsg, 200, TXT_PoliceJailedPlayer, PoliceName, FinedPlayerName, (JailTime / 60));
		SendClientMessageToAll(0xFFFFFFFF, PoliceMsg);
		// Teleport the player to jail
		Police_JailPlayer(PlayerToFine, JailTime);
		// Increase the stats for jailing a player
		APlayerData[playerid][StatsPoliceJailed]++;
	}

Код:
// This is the timer that runs for every player who's in jail
public UnjailPlayer(playerid)
{
	new JailMsg[20];
	new Msg[30];

	// Check if the player is allowed to leave yet
	if (APlayerData[playerid][PlayerJailed] == 0)
	{
		// Set the player in the normal world
		SetPlayerVirtualWorld(playerid, 0);
		// Set player interior to the outside
		SetPlayerInterior(playerid, 0);
		// Put the player outside the jail (he should spawn at the location where he spawned after login or after choosing a rescue-point)
		SpawnPlayer(playerid);
		// Also, kill the jailtimer
		KillTimer(APlayerData[playerid][PlayerJailedTimer]);
		//
        SendClientMessage(playerid, 0xFFFFFFFF, Msg);
	}
	else
	{
		// Show the remaining jailtime (only if the remaining time is below 60 seconds)
		if (APlayerData[playerid][PlayerJailed])
		{
			new RouteText[50];
            format(RouteText, 50, "Jail: 0%i:~r~%i~w~", JailMsg, APlayerData[playerid][PlayerJailed]);
			TextDrawSetString(APlayerData[playerid][MissionText], RouteText);
		}
 	    // Decrease the jailtime by 1 second
        APlayerData[playerid][PlayerJailed] = APlayerData[playerid][PlayerJailed] -1;
	}
}
Код:
CMD:jail(playerid, params[])
{
 new PlayerToJail, JailTime, Reason[128], Msg[128], Name[24], AdminName[24];
 SendAdminText(playerid, "/jail", params);
 if (APlayerData[playerid][LoggedIn] == true)
 {
  if (APlayerData[playerid][PlayerAdmin] >= 1)
  {
   if (sscanf(params, "uis[128]", PlayerToJail, JailTime, Reason)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /jail [id] [time] [reason]\"");
   else
    if (IsPlayerConnected(PlayerToJail))
    {
     Police_JailPlayer(PlayerToJail, JailTime);
     GetPlayerName(playerid, AdminName, sizeof(AdminName));
     GetPlayerName(PlayerToJail, Name, sizeof(Name));
     format(Msg, 128, "You have been jailed by an Admin for %i seconds  Reason: %s",  APlayerData[playerid][PlayerJailed], Reason);
     SendClientMessage(PlayerToJail, 0xFF0000FF, Msg);
    }
    else
        SendClientMessage(playerid, 0xFF0000FF, "That player is not online");
  }
  else
      return 0;
 }
 else
     return 0;

 return 1;
}
Reply
#2

At the timer textdraw text try
pawn Код:
//instead of
Jail: "0%i:~r~%i~w~"
//try
Jail: "0%f:~r~%f~w~"
Not sure if this will work but good luck !
Reply
#3

I try it don't work, showing 0:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)