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



Invisble cars problem - Ltz-boy - 11.08.2011

Hey everyone!

I have an problem with invisible cars, my server is running 0.3c. It started with a few invisible cars, but after some time, more and more cars and vehicles has been invisible. Can someone help me?

If i set the interior of the car to 0, it becomes visible, but if I restart my server, it's invisible again.

Thanks for your answer !


Re: Invisble cars problem - Sascha - 11.08.2011

check for "LinkVehicleToInterior" in your gamemode and all filterscripts..
they seem to be linked to an interior (as you already figured out by setting them back to 0)


Re: Invisble cars problem - Ltz-boy - 11.08.2011

Thanks for an very fast reply!

Uhm, I only have that text in teleports like these:
Is it these ones you talk about? :S

if (GetPlayerState(playerid) == 2)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, 1749.5895,-2548.6216,13.5469);
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
LinkVehicleToInterior(tmpcar, 0);
SetPlayerVirtualWorld(playerid, 0);
OnPlayerExitFood(playerid);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Teleported Himself to Airport dealership",d,m,y,h,mi,s,sendername);
TelesLog(string);
}

EDIT:
I've checked all my filterscripts now. But there is nothing called "LinkVehicleToInterior" there. Only inside my gamemode, but that is just these teleports as I gave an example of.

Is it possible to set an interior inside the car script?

This is an example of my car script, whitch is one of the one who dissapears:

AddStaticVehicleEx(402,1215.87316895,-1673.98645020,11.73687458,0.00000000,-1,-1,30000); //Buffalo


Re: Invisble cars problem - sleepysnowflake - 11.08.2011

You can also use that within a loop. To link the vehicle to the interior 0


Re: Invisble cars problem - Ltz-boy - 11.08.2011

Hehe, sorry but im not good in scripting. Still learning :P

What is a loop?


Re: Invisble cars problem - Sascha - 11.08.2011

like this:
pawn Код:
public OnGameModeInit()
{
  for(new v=0; v<MAX_VEHICLES; v++)
  {
    LinkVehicleToInterior(v, 0);
  }
  return 1;
}
a loop will repeat itself for a defined amount... there are 3 basic kinds:
"for" "while" and "foreach"


Re: Invisble cars problem - XGh0stz - 11.08.2011

Might be better to link your vehicles to whatever interior (0=Default) with OnVehicleSpawn to ensure they stay spawning in the correct Interior. But of course it's far better to figure out what in your script is causing vehicles being set to other interiors instead which is done by searching for that function suggested earlier...

In this case, starting with what 'GetPlayerState == 2' is exactly used for etc.


Re: Invisble cars problem - Ltz-boy - 11.08.2011

Another thanks for replies

I can't find anything of what you talk about in my gamemode. But, this is the only thing find from OnVehicleSpawn, whitch has an SetVehicleWorld function. Does it looks alright or may that be the problem? Sorry im totally noob in this!

public OnVehicleSpawn(vehicleid)
{
if(IsAnOwnableCar(vehicleid))
{
if(CarInfo[vehicleid][cPaintjob] != 999)
{
ChangeVehiclePaintjob(vehicleid, CarInfo[vehicleid][cPaintjob]);
}
SetVehicleModifications(vehicleid);
SetVehicleVirtualWorld(vehicleid, CarInfo[vehicleid][cVirWorld]);
ChangeVehicleColor(vehicleid, CarInfo[vehicleid][cColorOne],CarInfo[vehicleid][cColorTwo]);
}


Re: Invisble cars problem - Ltz-boy - 12.08.2011

Nobody knows a solution?