problem with jail
#1

Hello! I haven't scripted anything for long time, right now i decided to made server just for fun to play with friends. I have problem with jail system. I can jail every player on the server, but the textdraw shows only for player with id 0 (when I have jailed player id 0) but if I have jailed player for example ID 2, he get in jail but no textdraws shows to him.

Код:
public JailTest(playerid)
{
        if(GetPVarInt(playerid, "Jail") >= 2)
        {
				format(file, 128, "/Accounts/%s.ini", GetName(playerid));
       			SetPVarInt(playerid, "Jail", GetPVarInt(playerid, "Jail")-1);
       			new jailtext[150];
    			format(jailtext, sizeof(jailtext), "Jail: %i", GetPVarInt(playerid, "Jail"));
    			GameTextForPlayer(playerid, jailtext, 1000, 1);

    			SetPlayerHealth(playerid, 1000);
		}
		else if(GetPVarInt(playerid, "Jail") == 1) // >=0
		{
                format(file, 128, "/Accounts/%s.ini", GetName(playerid));
       			SetPVarInt(playerid, "Jail", GetPVarInt(playerid, "Jail")-1);
       			
       			SetPlayerHealth(playerid, 100);
       			SetPlayerPos(playerid, 621.689453125, -596.9580078125, 16.731489181519);
       			SendClientMessage(playerid, COLOR_GREEN, "Unjailed!");

		}
		return 1;
}
And also when the jail time ends the player don't get unjailed. I think problem is in this code. Anybody can help me? Sorry for my bad English!
Reply
#2

Maybe it's because of this

Quote:

GameTextForPlayer(playerid, jailtext, 1000, 1);

Here the timer is 1000 = 1 sec.. therefore the textdraw would be shown up just for a fraction of sec..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)