// This is the timer that runs for every player who's in jail
public UnjailPlayer(playerid)
{
new JailMsg[20];
// 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]);
}
else
{
// Show the remaining jailtime (only if the remaining time is below 60 seconds)
if (APlayerData[playerid][PlayerJailed] < 60)
{
format(JailMsg, 20, TXT_JailTimer, APlayerData[playerid][PlayerJailed]);
new RouteText[55];
format(RouteText, 55, "%s", JailMsg, " ");
TextDrawSetString(APlayerData[playerid][MissionText], RouteText);
//GameTextForPlayer(playerid, JailMsg, 750, 4);
}
// Decrease the jailtime by 1 second
APlayerData[playerid][PlayerJailed] = APlayerData[playerid][PlayerJailed] - 1;
}
}
#define TXT_JailTimer "~w~Time Remaining: ~r~%i~w~"
// Show the remaining jailtime (only if the remaining time is below 60 seconds) if (APlayerData[playerid][PlayerJailed] < 60)
#define TXT_JailTimer "~w~Time Remaining: ~r~%i~w~"
format(JailMsg, 20, "~w~Time Remaining: ~r~%i~w~", APlayerData[playerid][PlayerJailed]);
|
you can't just define it
Код:
#define TXT_JailTimer "~w~Time Remaining: ~r~%i~w~" pawn Код:
|
public UnjailPlayer(playerid)
{
new JailMsg[20];
if (APlayerData[playerid][PlayerJailed] == 0)
{
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
SpawnPlayer(playerid);
KillTimer(APlayerData[playerid][PlayerJailedTimer]);
}
else
{
if (APlayerData[playerid][PlayerJailed] < 60)
{
format(JailMsg, 20, TXT_JailTimer, APlayerData[playerid][PlayerJailed]);
TextDrawSetString(APlayerData[playerid][MissionText], JailMsg);
}
APlayerData[playerid][PlayerJailed] --;
}
return 1;
}
// This is the timer that runs for every player who's in jail
public UnjailPlayer(playerid)
{
new JailMsg[20];
// 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]);
}
else
{
// Show the remaining jailtime (only if the remaining time is below 60 seconds)
if (APlayerData[playerid][PlayerJailed] < 60)
{
format(JailMsg, 20, "%s~w~Time Remaining:~r~%i~w~", APlayerData[playerid][PlayerJailed]);
new RouteText[255];
format(RouteText, 255, "%s", JailMsg, " ");
TextDrawSetString(APlayerData[playerid][MissionText], RouteText);
//GameTextForPlayer(playerid, JailMsg, 750, 4);
}
// Decrease the jailtime by 1 second
APlayerData[playerid][PlayerJailed] = APlayerData[playerid][PlayerJailed] - 1;
}
}