invisible cars?
#1

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

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

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

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?

Reply
#5

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?

Reply
#6

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

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
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)