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



invisible cars? - killdahobo99 - 14.06.2009

I added a /kickstart command and interior for my stunt server and

when i spawn cars they are invisible...Any car i add it's invisible but you can drive it, and as soon as you get on your invisible. How do i fix this? please help

Heres my code:

Код:
if (strcmp("/kickstart", cmdtext, true, 10) == 0) //chilliad
	{
	SetPlayerPos(playerid, -1465.268676,1557.868286,1052.531250);
 	SetPlayerInterior(playerid, 14);
	new name[MAX_PLAYER_NAME+1];
	GetPlayerName(playerid, name, sizeof(name));
	format(string, sizeof(string), "%s has joined kickstart, type /kickstart to join", name);
	SendClientMessageToAll(COLOR_LIGHTBLUE,string);
	return 1;
 }
I get no errors on this code.


Re: invisible cars? - Abernethy - 14.06.2009

I'm not sure, maybe..
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (vehicleID == /*CAR ID*/)
    {
    SetPlayerInterior(playerid, /*INTERIOR*/);
    }
    return 1;
}



Re: invisible cars? - killdahobo99 - 14.06.2009

Quote:
Originally Posted by Abernethy
I'm not sure, maybe..
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (vehicleID == /*CAR ID*/)
    {
    SetPlayerInterior(playerid, /*INTERIOR*/);
    }
    return 1;
}
for some reason that crashed my server


Re: invisible cars? - [HiC]TheKiller - 14.06.2009

Quote:
Originally Posted by killdahobo99
Quote:
Originally Posted by Abernethy
I'm not sure, maybe..
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (vehicleID == /*CAR ID*/)
    {
    SetPlayerInterior(playerid, /*INTERIOR*/);
    }
    return 1;
}
for some reason that crashed my server
Did you use the vehicle ID or the model ID?




Re: invisible cars? - killdahobo99 - 14.06.2009

Quote:
Originally Posted by [HiC
TheKiller ]
Quote:
Originally Posted by killdahobo99
Quote:
Originally Posted by Abernethy
I'm not sure, maybe..
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (vehicleID == /*CAR ID*/)
    {
    SetPlayerInterior(playerid, /*INTERIOR*/);
    }
    return 1;
}
I searched for the "turismo" id and got it, then i put it in the "car Id" and it crashed. Also, can you explain how this wil work? because, when i type /kickstart, i want people to be able to chooce vehicles they want, not spawn in one. So how would i make it that only in that place, theres certain type of vehcicles because like i said, they dissapear
for some reason that crashed my server
Did you use the vehicle ID or the model ID?




Re: invisible cars? - lavamike - 14.06.2009

Invisible cars happen when they are in a different interior than you are.

Put players in a different interior: SetPlayerInterior(playerid, interiorid);
Put vehicles in a different interior: LinkVehicleToInterior(vehicleid, interiorid);

https://sampwiki.blast.hk/wiki/SetPlayerInterior
https://sampwiki.blast.hk/wiki/LinkVehicleToInterior


Hope that helps!
-Mike


Re: invisible cars? - killdahobo99 - 14.06.2009

Quote:
Originally Posted by Lavamike
Invisible cars happen when they are in a different interior than you are.

Put players in a different interior: SetPlayerInterior(playerid, interiorid);
Put vehicles in a different interior: LinkVehicleToInterior(vehicleid, interiorid);

https://sampwiki.blast.hk/wiki/SetPlayerInterior
https://sampwiki.blast.hk/wiki/LinkVehicleToInterior


Hope that helps!
-Mike


Thanks a lot i'll try it as soon as i get home