Raised This Month: $ Target: $400
 0% 

[CS:S] Passenger support for Drivable Vehicles


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
NatalyaAF
Senior Member
Join Date: Dec 2008
Old 06-03-2011 , 19:11   Re: [CS:S] Passenger support for Drivable Vehicles
Reply With Quote #3

Quote:
Originally Posted by Peace-Maker View Post
THAT LOOKS AWESOME!
I love how much detail you spent with the fuel and stuff
Currently trying to build a plugin around it. Lot's of stuff is missing, so looks like i'm going to have to read all your arrays and rebuild them myself :/

Would you mind sharing your
  • LeaveVehicle
  • ViewToggle
  • Reset_Car_Selection
  • SetCarOwnership
functions and maybe the Horn_Time timer callback either? I'd love to test this out! Do you've got a server up and running this plugin?

PHP Code:
LeaveVehicle(client)
{
    new 
Float:Null[3] = {0.00.00.0};
    new 
Float:ExitAng[3];
    
    new 
vehicle GetEntPropEnt(clientProp_Send"m_hVehicle");
    if (
IsValidEntity(vehicle))
    {
        
GetEntPropVector(vehicleProp_Data"m_angRotation"ExitAng);
        
ExitAng[0] = 0.0;
        
ExitAng[1] += 90.0;
        
ExitAng[2] = 0.0;
    
        
SDKCall(hLeaveVehicleclientNullNull);
    
        
TeleportEntity(clientNULL_VECTORExitAngNULL_VECTOR);
        
SetClientViewEntity(clientclient);

        new 
car_index g_CarIndex[vehicle];    
        new 
max g_CarLightQuantity[car_index];
        if (
max 0)
        {
            
decl light;
            
light g_CarLights[car_index][0];
            if (
IsValidEntity(light))
            {
                
AcceptEntityInput(light"HideSprite");
            }
            
light g_CarLights[car_index][1];
            if (
IsValidEntity(light))
            {
                
AcceptEntityInput(light"HideSprite");
            }
            if (
max 2)
            {
                
light g_CarLights[car_index][2];
                if (
IsValidEntity(light))
                {
                    
AcceptEntityInput(light"HideSprite");
                }
                
light g_CarLights[car_index][3];
                if (
IsValidEntity(light))
                {
                    
AcceptEntityInput(light"HideSprite");
                }

    
/*            AcceptEntityInput(g_CarLights[car_index][6], "LightOff");
                AcceptEntityInput(g_CarLights[car_index][7], "LightOff"); */
            
}
        }
    }
    if (
vehicle 0)
    {
        if (
IsValidEntity(Cars_Driver_Prop[vehicle]))
        {
            
AcceptEntityInput(Cars_Driver_Prop[vehicle],"Kill");
            
Cars_Driver_Prop[vehicle] = -1;
        }
    }
    
SetEntProp(clientProp_Send"m_ArmorValue"armour[client], );
    
Driving[client] = false;
    
drivers_car[client] = -1;
}
public 
ViewToggle(carclient)
{
    new 
cars_type[car];
    if (!
car_view_enabled[t])
    {
        return;
    }
    if(
CarView[client] == true)
    {
        
CarView[client] = false;
        
SetVariantString("vehicle_driver_eyes");
        
AcceptEntityInput(client"SetParentAttachment");    
        return;
    }
    if(
CarView[client] == false)
    {
        
CarView[client] = true;
        
SetVariantString("vehicle_3rd");
        
AcceptEntityInput(client"SetParentAttachment");    
        return;
    }

Reset_Car_Selection has to do with resetting some of the arrays used when selecting your car and its colour in the car menu. It probably isn't helpful but here it is:

PHP Code:
stock Reset_Car_Selection(client)
{
    
selected_car[client] = -1;
    
selected_car_stowed[client] = -1;
    
selected_car_skin[client] = -1;
    
selected_car_type[client] = -1;
    
selected_car_fuel[client] = -1.0;
    
selected_car_name[client] = "FUCK_YOU";
    
selected_car_index[client] = -1;

SetCarOwnership deals with letting players lock or unlock their car by hitting shift (slow-walk or +speed) while looking at the car, but this is handled by another plugin.

Umm, basically you want to know exactly how the cars will be used on your server before you start to try to add this stuff. For example, Rally Race uses a lot of the features but does not use passenger support because you're racing the other players instead of driving your friends around.
__________________
Talk to me on Steam: natalyaaf
See my website for downloads: www.lady-natalya.info

Natalya: killing someone while they make a plugin
Natalya: perfect analogy
Natalya: for the mayan apocalypse
NatalyaAF is offline
 



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 18:37.


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