17.01.2014, 21:48
(
Последний раз редактировалось AnonScripter; 17.01.2014 в 22:21.
)
hey guys maybe i have math problem in this script, somebody tell me what is it please.
i got an /arrest command with some functions...
- i have a textdraw to show how many time remaining till the player release from jail.
- Jail Time for the player is based on how many wanted level he had:
So let's say he had 6 wanted levels, 6/4 = 1.5 ,,,so 1.5 * 60 = 90 so he will stay in jail 1:30 minutes
but this is not working, it always shows "1:00" even his jail time is 90 seconds
maybe the wrong on the clock scipt update, here is it:
Edit: here is the /arrest command script, because maybe the wrong is here
i got an /arrest command with some functions...
- i have a textdraw to show how many time remaining till the player release from jail.
- Jail Time for the player is based on how many wanted level he had:
pawn Код:
PlayerInfo[targetid][pJailTime] = (GetPlayerWantedLevel(targetid)/4)*60;
but this is not working, it always shows "1:00" even his jail time is 90 seconds
maybe the wrong on the clock scipt update, here is it:
pawn Код:
if(PlayerInfo[playerid][pJailTime] > 0)
{
new string[128];
new gseconds;
new gminutes;
gseconds = PlayerInfo[playerid][pJailTime] % 60;
gminutes = (PlayerInfo[playerid][pJailTime] - gseconds) / 60;
PlayerInfo[playerid][pJailTime] --;
format(string, sizeof string, "%d:%02d", gminutes, gseconds);
TextDrawSetString(JailList[playerid], string);
Edit: here is the /arrest command script, because maybe the wrong is here
pawn Код:
CMD:arrest(playerid, params[])
{
PlayerInfo[targetid][pJailTime] = (GetPlayerWantedLevel(targetid)/4)*60;
PutPlayerInJail(targetid);
IncreaseScore(playerid,1);
return 1;
}
public PutPlayerInJail(playerid)
{
new Random = random(sizeof(RandomJail));
SetPlayerInterior(playerid,3);
SetPlayerPos(playerid, RandomJail[Random][0], RandomJail[Random][1], RandomJail[Random][2]);
SetPlayerFacingAngle(playerid, RandomJail[Random][3]);
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid,1);
return 1;
}