Linkcar problem
#1

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?
Reply
#2

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.
Reply
#3

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?
Reply
#4

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

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)