SA-MP Forums Archive
Any ideas? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Any ideas? (/showthread.php?tid=186791)



Any ideas? - Gh0sT_ - 30.10.2010

Hello all.. Im created a timer, with 1ms interval.. Its looping all players, and checking are some player are in vehicle, and are veh hp < 750.. If < 750 - freezing player.. But.. its flOOOding. :/

And here is da script:

SetTimer("PagrindinisTimer", 1000, true);

and than..
pawn Код:
public PagrindinisTimer()
{
foreach(Player, ID)
{
/// another shit
/////////////////////////////// VARIKLIS
if(IsPlayerInAnyVehicle(ID))
{
if(MasinosGyvybes < 700)
{
TogglePlayerControllable(ID, false);
SendClientMessage(ID, BALTA,"Jыsш maрinos variklis uюgeso. Kreipkities pas Mechanikus.");
SetPVarInt(ID, "Variklis", 1);
}
....

Any ideas?!


Re: Any ideas? - Matthew_Johnston - 30.10.2010

WEll it should be flooding :P its every 1 second, try making a timeout thing. i dunno how to do it xD but thats what I would think


Re: Any ideas? - pater - 30.10.2010

pawn Код:
new FrozePlayerBecauseTooLowHealth[MAX_PLAYERS];

if(IsPlayerInAnyVehicle(ID))
{
    if(MasinosGyvybes < 700)
    {
        if(FrozePlayerBecauseTooLowHealth[playerid] == 0)
        {
            TogglePlayerControllable(ID, false);
            SendClientMessage(ID, BALTA,"Jыsш maрinos variklis uюgeso. Kreipkities pas Mechanikus.");
            SetPVarInt(ID, "Variklis", 1);
            FrozePlayerBecauseTooLowHealth[playerid] = 1;
        }
    }
}



Re: Any ideas? - Gh0sT_ - 30.10.2010

Quote:
Originally Posted by pater
Посмотреть сообщение
pawn Код:
new FrozePlayerBecauseTooLowHealth[MAX_PLAYERS];

if(IsPlayerInAnyVehicle(ID))
{
    if(MasinosGyvybes < 700)
    {
        if(FrozePlayerBecauseTooLowHealth[playerid] == 0)
        {
            TogglePlayerControllable(ID, false);
            SendClientMessage(ID, BALTA,"Jыsш maрinos variklis uюgeso. Kreipkities pas Mechanikus.");
            SetPVarInt(ID, "Variklis", 1);
            FrozePlayerBecauseTooLowHealth[playerid] = 1;
        }
    }
}
Dude thanks.