SA-MP Forums Archive
Linkcar problem - 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: Linkcar problem (/showthread.php?tid=64913)



Linkcar problem - max007 - 08.02.2009

Hi i have this public set on timer 1sec...
pawn Код:
public LinkCar()
{
for(new playerid=0; playerid<MAX_PLAYERS; playerid++)
{

            LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(playerid));
            SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),GetPlayerVirtualWorld(playerid));
}
}
But every 1sec it do itself about 100 times... (i added print) so every second it spammed 100 times... wtf is with it?


Re: Linkcar problem - Finn - 08.02.2009

Quote:
Originally Posted by max007
Hi i have this public set on timer 1sec...
pawn Код:
public LinkCar()
{
for(new playerid=0; playerid<MAX_PLAYERS; playerid++)
{

            LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(playerid));
            SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),GetPlayerVirtualWorld(playerid));
}
}
But every 1sec it do itself about 100 times... (i added print) so every second it spammed 100 times... wtf is with it?
You have a loop in 1 sec timer, so it loops through MAX_PLAYERS every second. It's ok, but IMO that timer is useless as you could set the vehicle to the interior every time the player changes interior.


Re: Linkcar problem - max007 - 08.02.2009

Quote:
Originally Posted by Finn
Quote:
Originally Posted by max007
Hi i have this public set on timer 1sec...
pawn Код:
public LinkCar()
{
for(new playerid=0; playerid<MAX_PLAYERS; playerid++)
{

            LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(playerid));
            SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),GetPlayerVirtualWorld(playerid));
}
}
But every 1sec it do itself about 100 times... (i added print) so every second it spammed 100 times... wtf is with it?
You have a loop in 1 sec timer, so it loops through MAX_PLAYERS every second. It's ok, but IMO that timer is useless as you could set the vehicle to the interior every time the player changes interior.
How? Onplayerchangeinterrior or.. how? Can u pls post here the code?


Re: Linkcar problem - Auto-Sized - 08.02.2009

http://forum.sa-mp.com/index.php?top...seen#msg195086


Re: Linkcar problem - max007 - 08.02.2009

Quote:
Originally Posted by ♦۞pкћп§-шŧųĄ۞♦
Do i have to put there a timer or not?


Re: Linkcar problem - Auto-Sized - 08.02.2009

Quote:
Originally Posted by vkmaster
Auto Link Vehicle To Interior
Never tested this but the concept seems fine.


Re: Linkcar problem - max007 - 08.02.2009

Quote:
Originally Posted by ♦۞pкћп§-шŧųĄ۞♦
Quote:
Originally Posted by vkmaster
Auto Link Vehicle To Interior
oh.. ok got it thx