29.10.2015, 11:08
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.
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!
Код:
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; }