Bug with publics - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Bug with publics (
/showthread.php?tid=461170)
Bug with publics -
CloW - 31.08.2013
When i use in public -= 1 or -- for one players,vehicles then take 41 of time,fuel and other.
That is in all publics.In this code take 41 seconds of jailtime.When i use stock then is ok,then can't create timer.
Sry for English.
Код:
public IzlazakT()
{
new string[128];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pJailed] == 2)
{
if(PlayerInfo[i][pJailTime] > 0)
{
PlayerInfo[i][pJailTime] -= 1;
}
if(PlayerInfo[i][pJailTime] == 0)
{
PlayerInfo[i][pJailTime] = 0;
SetPlayerInterior(i, 0);
PlayerInfo[i][pJailed] = 0;
SetPlayerPos(i, 1767.88, -1613.29, 13.52);
return 1;
}
}
if(PlayerInfo[i][pJailed] == 1)
{
if(PlayerInfo[i][pJailTime] > 0)
{
PlayerInfo[i][pJailTime] -= 1;
}
if(PlayerInfo[i][pJailTime] == 0)
{
PlayerInfo[i][pJailTime] = 0;
SetPlayerInterior(i, 0);
PlayerInfo[i][pJailed] = 0;
ClearCrime(i);
SendClientMessage(i, COLOR_WHITE,"Pusteni ste iz zatvora.");
SendClientMessage(i, COLOR_WHITE,"Sledeci put razmislite prije nego sto pocinite zlocin.");
format(string, sizeof(string), "~g~Pusteni ste iz zatvora");
SetPlayerPos(i, 1767.88, -1613.29, 13.52);
return 1;
}
}
}
return 1;
}
Re: Bug with publics -
CloW - 01.09.2013
BUMP!
Re: Bug with publics -
park4bmx - 01.09.2013
cant understand U !!
what ur trying to achieve ??
ur talking about some
fuel when all there is is some
pJailTime
Re: Bug with publics -
CloW - 01.09.2013
Bug with timers,i set timer on 1000 and it take of players 41 seconds(jailtime)
Re: Bug with publics -
park4bmx - 01.09.2013
how u set the timer house u set
pJailed
Re: Bug with publics -
CloW - 01.09.2013
unjailtimer = SetTimer("IzlazakT", 1000, 1);
Re: Bug with publics -
park4bmx - 01.09.2013
and
PlayerInfo[i][pJailed]
Re: Bug with publics -
CloW - 01.09.2013
Код:
public IzlazakT()
{
new string[128];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pJailed] == 2)
{
if(PlayerInfo[i][pJailTime] > 0)
{
PlayerInfo[i][pJailTime] -= 1;
}
if(PlayerInfo[i][pJailTime] == 0)
{
PlayerInfo[i][pJailTime] = 0;
SetPlayerInterior(i, 0);
PlayerInfo[i][pJailed] = 0;
SetPlayerPos(i, 1767.88, -1613.29, 13.52);
return 1;
}
}
if(PlayerInfo[i][pJailed] == 1)
{
if(PlayerInfo[i][pJailTime] > 0)
{
PlayerInfo[i][pJailTime] -= 1;
}
if(PlayerInfo[i][pJailTime] == 0)
{
PlayerInfo[i][pJailTime] = 0;
SetPlayerInterior(i, 0);
PlayerInfo[i][pJailed] = 0;
ClearCrime(i);
SendClientMessage(i, COLOR_WHITE,"Pusteni ste iz zatvora.");
SendClientMessage(i, COLOR_WHITE,"Sledeci put razmislite prije nego sto pocinite zlocin.");
format(string, sizeof(string), "~g~Pusteni ste iz zatvora");
SetPlayerPos(i, 1767.88, -1613.29, 13.52);
return 1;
}
}
}
return 1;
}
public is ok when i use cmd
Код:
if(strcmp(cmd, "/js", true) == 0)
{
IzlazakT();
return 1;
}
then take 1seconds of jailed players
Re: Bug with publics -
park4bmx - 01.09.2013
u don't show full code !
u can be setting the timer inside a loop !
and u still don't show how you add the amount of seconds into
pJailed
Re: Bug with publics -
CloW - 01.09.2013
Fixed,lock this topic.