05.12.2009, 17:27
Alright, first, the GameText thingy. You'll need a function to handle the GameText showing, you could use something like this:
It's not very hard to understand, basicly we are just creating another function that will be doing the same as GameTextForPlayer, but it is public, which means that can be called with a timer. Once we have this, we will have to use SetTimerEx to call a function and pass parameters to it.
First read what SetTimerEx is here forward https://sampwiki.blast.hk/wiki/SetTimerEx .
So would need to add a line like:
But right before that, you will need to format the 'string' variable to include the jail time left. You can do it with something like this:
Changing JailLeft to whatever is the variable holding the jail time left.
Regarding file saving, dini is a good file saving handler, I used it a lot of times and is very easy and makes your code easy to read. Search for it.
[/pawn]
pawn Код:
forward DelayedGameText(playerid, string[], time, style);
public DelayedGameText(playerid, string[], time, style)
{
GameTextForPlayer(playerid, string[], time, style);
}
First read what SetTimerEx is here forward https://sampwiki.blast.hk/wiki/SetTimerEx .
So would need to add a line like:
pawn Код:
SetTimerEx("DelayedGameText", "isii", playerid, string, 5000, 3);
pawn Код:
new string[128];
format(string, sizeof(string), "You have %d time left in jail", JailLeft);
Regarding file saving, dini is a good file saving handler, I used it a lot of times and is very easy and makes your code easy to read. Search for it.
[/pawn]