Raised This Month: $12 Target: $400
 3% 

prop_vehicle_driveable issue


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rodrigo286
Veteran Member
Join Date: Sep 2010
Location: Brazil, São Paulo
Old 10-31-2014 , 17:26   prop_vehicle_driveable issue
Reply With Quote #1

When I give spawn the car can only drive alone to force the player into the car.

And if trying to get out is not possible.

I can exit of car using some line of NataliaAF code, but the problem is if KILL or REMOVE car entity, server crash.

I found several people with the same problem, is there any way to fix this?

PHP Code:
#include <sourcemod>
#include <sdktools>    

#define     EF_NODRAW 32
#define        COLLISION_GROUP_PLAYER 5
#define     HIDEHUD_WEAPONSELECTION 1
#define     HIDEHUD_CROSSHAIR 256
#define     HIDEHUD_INVEHICLE 1024

public OnPluginStart()
{    
    
RegAdminCmd("sm_car"Command_CARADMFLAG_ROOT);
    
RegAdminCmd("sm_car2"Command_CAR2ADMFLAG_ROOT);
}

public 
OnMapStart()
{
    
PrecacheModel("models/buggy.mdl");
}

public 
Action:Command_CAR(clientargs)
{
    new 
String:name[255];
    
GetClientName(clientnamesizeof(name));

    
decl Ent;   
    
Ent CreateEntityByName("prop_vehicle_driveable"); 

    
DispatchKeyValue(Ent"vehiclescript""scripts/vehicles/ep1.txt");
    
DispatchKeyValue(Ent"model""models/buggy.mdl");

    
DispatchKeyValueFloat (Ent"MaxPitch"360.00);
    
DispatchKeyValueFloat (Ent"MinPitch", -360.00);
    
DispatchKeyValueFloat (Ent"MaxYaw"90.00);
    
DispatchKeyValue(Ent"solid","6");
    
DispatchKeyValue(Ent"actionScale","1");
    
DispatchKeyValue(Ent"EnableGun","0");
    
DispatchKeyValue(Ent"ignorenormals","0");
    
DispatchKeyValue(Ent"fadescale","1");
    
DispatchKeyValue(Ent"fademindist","-1");
    
DispatchKeyValue(Ent"VehicleLocked","0");
    
DispatchKeyValue(Ent"screenspacefade","0");
    
DispatchKeyValue(Ent"spawnflags""256" );
    
DispatchKeyValue(Ent"setbodygroup""511" );
    
SetEntProp(EntProp_Send"m_nSolidType"2);
    
DispatchSpawn(Ent);
    
ActivateEntity(Ent);

    
DispatchSpawn(Ent);

    
ActivateEntity(Ent);

    
decl Float:FurnitureOrigin[3];
    
decl Float:ClientOrigin[3];
    
decl Float:EyeAngles[3];
    
GetClientEyeAngles(clientEyeAngles);
    
GetClientAbsOrigin(clientClientOrigin);

    
FurnitureOrigin[0] = (ClientOrigin[0] + (50 Cosine(DegToRad(EyeAngles[1]))));
    
FurnitureOrigin[1] = (ClientOrigin[1] + (50 Sine(DegToRad(EyeAngles[1]))));
    
FurnitureOrigin[2] = (ClientOrigin[2]);


    
TeleportEntity(EntFurnitureOriginNULL_VECTORNULL_VECTOR);

    
SetEntProp(EntProp_Data"m_nNextThinkTick", -1);

    
SetEntPropEnt(clientProp_Send"m_hObserverTarget"0);
    
SetEntProp(clientProp_Send"m_iObserverMode"1); 

    
// force players in.
    
if (client != 0)
    {
        
AcceptEntityInput(Ent"use"client);
    }
}  

public 
Action:Command_CAR2(clientargs)
{
    
LeaveVehicle(client);
}  

LeaveVehicle(client)
{
    new 
vehicle GetEntPropEnt(clientProp_Send"m_hVehicle");
    if (
IsValidEntity(vehicle))
    {
        
AcceptEntityInput(client"SetParent");
        
SetVariantString("vehicle_driver_exit");
        
AcceptEntityInput(client"SetParentAttachment");        

        new 
Float:ExitAng[3];
        
GetEntPropVector(vehicleProp_Data"m_angRotation"ExitAng);
        
ExitAng[0] = 0.0;
        
ExitAng[1] += 90.0;
        
ExitAng[2] = 0.0;
        
    
        
AcceptEntityInput(client"ClearParent");    
        
        
SetEntPropEnt(clientProp_Send"m_hVehicle", -1);
    
        
SetEntPropEnt(vehicleProp_Send"m_hPlayer", -1);
    
        
SetEntityMoveType(clientMOVETYPE_WALK);
    
        
SetEntProp(clientProp_Send"m_CollisionGroup"COLLISION_GROUP_PLAYER);        
        
        new 
hud GetEntProp(clientProp_Send"m_iHideHUD");
        
hud &= ~HIDEHUD_WEAPONSELECTION;
        
hud &= ~HIDEHUD_CROSSHAIR;
        
hud &= ~HIDEHUD_INVEHICLE;
        
SetEntProp(clientProp_Send"m_iHideHUD"hud);
        
        new 
EntEffects GetEntProp(clientProp_Send"m_fEffects");
        
EntEffects &= ~EF_NODRAW;
        
SetEntProp(clientProp_Send"m_fEffects"EntEffects);

        
SetEntProp(vehicleProp_Send"m_nSpeed"0);
        
SetEntPropFloat(vehicleProp_Send"m_flThrottle"0.0);
        
AcceptEntityInput(vehicle"TurnOff");

        
SetEntPropFloat(vehicleProp_Data"m_flTurnOffKeepUpright"0.0);
    
        
SetEntProp(vehicleProp_Send"m_iTeamNum"0);
        
        
TeleportEntity(clientNULL_VECTORExitAngNULL_VECTOR);
        
SetClientViewEntity(clientclient);
    }

    new 
index = -1;
    while ((
index FindEntityByClassname(index"prop_vehicle_driveable")) != -1)
        
RemoveEdict(index);

    new 
plyr_gun2 GetPlayerWeaponSlot(client2);
    if (
IsValidEntity(plyr_gun2))
    {
        
RemovePlayerItem(clientplyr_gun2);
        
RemoveEdict(plyr_gun2);
        
GivePlayerItem(client"weapon_knife"0);
    }    
    
SetClientViewEntity(clientclient);

Regards.
__________________
My Plugins | VIEW HERE | I accept private requests, send me a PM.
Buy respawn | Uber Recall | Grenade drop | Damage Supperssor
Meet the Medic | Disguise Expert | Crazy Jet

CZSBrasil TEAM

Last edited by rodrigo286; 10-31-2014 at 20:55.
rodrigo286 is offline
rodrigo286
Veteran Member
Join Date: Sep 2010
Location: Brazil, São Paulo
Old 11-07-2014 , 09:25   Re: prop_vehicle_driveable issue
Reply With Quote #2

Anyone have a solution?

I searched several places and nothing works.

Please does anyone know how you can resolve?

I tried to contact a server that has this kind of plugin without success.

Thanks.
__________________
My Plugins | VIEW HERE | I accept private requests, send me a PM.
Buy respawn | Uber Recall | Grenade drop | Damage Supperssor
Meet the Medic | Disguise Expert | Crazy Jet

CZSBrasil TEAM
rodrigo286 is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 11-07-2014 , 16:14   Re: prop_vehicle_driveable issue
Reply With Quote #3

natalias code was just copied from an earlier version of my vehiclemod. if you remove a vehicle entity while a players is inside it will crash the server as players are parented to the vehicle and become a part of its hierarchy, so when you remove the vehicle entity you're removing the client entity which is a big no.
blodia is offline
rodrigo286
Veteran Member
Join Date: Sep 2010
Location: Brazil, São Paulo
Old 11-07-2014 , 17:12   Re: prop_vehicle_driveable issue
Reply With Quote #4

I using the same code of the player leave the car that created the Natalia.

The server crash when deleting the car has something else to do?

Thanks.
__________________
My Plugins | VIEW HERE | I accept private requests, send me a PM.
Buy respawn | Uber Recall | Grenade drop | Damage Supperssor
Meet the Medic | Disguise Expert | Crazy Jet

CZSBrasil TEAM
rodrigo286 is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 11-08-2014 , 06:33   Re: prop_vehicle_driveable issue
Reply With Quote #5

Onentitydestroyed clearparent
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
rodrigo286
Veteran Member
Join Date: Sep 2010
Location: Brazil, São Paulo
Old 11-08-2014 , 08:01   Re: prop_vehicle_driveable issue
Reply With Quote #6

Now my problem is other, the car dont work anymore, i'm using same code if i posted and ep1.txt script.

Thanks.
__________________
My Plugins | VIEW HERE | I accept private requests, send me a PM.
Buy respawn | Uber Recall | Grenade drop | Damage Supperssor
Meet the Medic | Disguise Expert | Crazy Jet

CZSBrasil TEAM
rodrigo286 is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 11-10-2014 , 08:36   Re: prop_vehicle_driveable issue
Reply With Quote #7

maybe it wasn't clear but i posted a link to my plugin so you could try using code from that instead or just use to whole plugin assuming it still works
blodia is offline
rodrigo286
Veteran Member
Join Date: Sep 2010
Location: Brazil, São Paulo
Old 11-11-2014 , 05:52   Re: prop_vehicle_driveable issue
Reply With Quote #8

I'm use you plugin code, works but now, dont work anymore, Natalia's code also and other code if i found on forum threads.

I dont know, sourcemod update make this?

Thanks.
__________________
My Plugins | VIEW HERE | I accept private requests, send me a PM.
Buy respawn | Uber Recall | Grenade drop | Damage Supperssor
Meet the Medic | Disguise Expert | Crazy Jet

CZSBrasil TEAM
rodrigo286 is offline
rodrigo286
Veteran Member
Join Date: Sep 2010
Location: Brazil, São Paulo
Old 11-14-2014 , 08:03   Re: prop_vehicle_driveable issue
Reply With Quote #9

Any have a idea how this dont work anymore?

Thanks.
__________________
My Plugins | VIEW HERE | I accept private requests, send me a PM.
Buy respawn | Uber Recall | Grenade drop | Damage Supperssor
Meet the Medic | Disguise Expert | Crazy Jet

CZSBrasil TEAM
rodrigo286 is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 11-17-2014 , 13:06   Re: prop_vehicle_driveable issue
Reply With Quote #10

i gave up on the plugin as game updates kept breaking it and i couldn't get it working on my own pc even though others could, did it stop working after a game update or sourcemod update? what exactly is broken? just getting out of vehicles?
blodia is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:03.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode