Invinsible vehicle (interior)
#1

I made a TP command, but now my Rhino's are invincible. Anyone knows what is wrong? I tried to set PlayerVirtualWorld and not working.

pawn Код:
//wardm
   if(strcmp(cmdtext, "/wardm", true) == 0)
   {
     SetPlayerHealth(playerid, 100.0);
     SetPlayerArmour(playerid, 100.0);
     ResetPlayerWeapons(playerid);
     SetPlayerPos(playerid, -1399.1252441406,1037.9338378906,1028.7286376953);
     SetPlayerInterior(playerid, 15);
     return 1;
   }
Reply
#2

The vehicle needs to be linked to the interior, too
Код:
LinkVehicleToInterior(vehicleid, interiorid);
Reply
#3

Quote:
Originally Posted by ♣ Joker ♠
The vehicle needs to be linked to the interior, too
Код:
LinkVehicleToInterior(vehicleid, interiorid);
In my command or under my ''AddStaticVehicle'' line?
Reply
#4

Quote:
Originally Posted by DarkPhoenix
Quote:
Originally Posted by ♣ Joker ♠
The vehicle needs to be linked to the interior, too
Код:
LinkVehicleToInterior(vehicleid, interiorid);
In my command or under my ''AddStaticVehicle'' line?
put it under AddStaticVehicle or just use this macro

pawn Код:
//AddStaticVehicleInInterior(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:angle, color1, color2, interiorid);
#define AddStaticVehicleInInterior(%1,%2,%3,%4,%5,%6,%7,%8) LinkVehicleToInterior(AddStaticVehicle(%1,%2,%3,%4,%5,%6,%7),%8)
Reply
#5

Quote:
Originally Posted by ♣ Joker ♠
The vehicle needs to be linked to the interior, too
Код:
LinkVehicleToInterior(vehicleid, interiorid);
I did
pawn Код:
AddStaticVehicle(432, -1427.0853271484, 975.06860351563, 1024.4071044922, 0.000000, -1, -1);
LinkVehicleToInterior(432, 15);
What am I doing wrong?
Reply
#6

Quote:
Originally Posted by DarkPhoenix
Quote:
Originally Posted by ♣ Joker ♠
The vehicle needs to be linked to the interior, too
Код:
LinkVehicleToInterior(vehicleid, interiorid);
I did
pawn Код:
AddStaticVehicle(432, -1427.0853271484, 975.06860351563, 1024.4071044922, 0.000000, -1, -1);
LinkVehicleToInterior(432, 15);
What am I doing wrong?
vehicleid not modelid !

pawn Код:
new temp;
temp = AddStaticVehicle(432, -1427.0853271484, 975.06860351563, 1024.4071044922, 0.000000, -1, -1);
LinkVehicleToInterior(temp, 15);
Reply
#7

Quote:
Originally Posted by ♣ Joker ♠
Quote:
Originally Posted by DarkPhoenix
Quote:
Originally Posted by ♣ Joker ♠
The vehicle needs to be linked to the interior, too
Код:
LinkVehicleToInterior(vehicleid, interiorid);
I did
pawn Код:
AddStaticVehicle(432, -1427.0853271484, 975.06860351563, 1024.4071044922, 0.000000, -1, -1);
LinkVehicleToInterior(432, 15);
What am I doing wrong?
vehicleid not modelid !

pawn Код:
new temp;
temp = AddStaticVehicle(432, -1427.0853271484, 975.06860351563, 1024.4071044922, 0.000000, -1, -1);
LinkVehicleToInterior(temp, 15);
Thanks, now my vehicles are visible!
Another problem (-.-): My vehicles are acting weird, spawning in the air and un controllable (driving slow or just going to the wrong direction).
Reply
#8

Vehicle Spawning: When a vehicle first appears within someone's client, this mid air spawning effect sometimes occur, only way I found a way around this was to simply respawn the vehicle when the vehicle first spawns for that player etc. But now with 0.3 features, it's alot easier to deal with, but I haven't even gotten around to using new methods, but... IsVehicleStreamedIn is probably the key to fixing faulty vehicle spawns
Reply
#9

Quote:
Originally Posted by XGh0stz
IsVehicleStreamedIn is probably the key to fixing faulty vehicle spawns
Give me an example (never used IsVehicleStreamedIn).
Reply
#10

Never used it either, but uh, ok... An example then

pawn Код:
if(IsVehicleStreamedIn(1,0)&&spawn[1]==0) // 1 is the vehicle ID, 0 is the playerid
{
SetVehicleToRespawn(1);
spawn[1]=1;
}
But of course according to your script, you could put this in a timer to continue checking or something, and spawn is just a varible to use so the vehicle doesnt constantly respawn etc. I'd only check whatever vehicles that dont seem to spawn correctly on thier own though. Then OnVehicleRespawn you could reset the spawn varible back to 0 etc. This is just an example to point you in the right direction on how to go about fixing this problem
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)