Invisble cars problem
#1

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

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

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

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

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

What is a loop?
Reply
#6

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"
Reply
#7

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

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]);
}
Reply
#9

Nobody knows a solution?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)