Quote:
Originally Posted by Peace-Maker
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.0, 0.0, 0.0};
new Float:ExitAng[3];
new vehicle = GetEntPropEnt(client, Prop_Send, "m_hVehicle");
if (IsValidEntity(vehicle))
{
GetEntPropVector(vehicle, Prop_Data, "m_angRotation", ExitAng);
ExitAng[0] = 0.0;
ExitAng[1] += 90.0;
ExitAng[2] = 0.0;
SDKCall(hLeaveVehicle, client, Null, Null);
TeleportEntity(client, NULL_VECTOR, ExitAng, NULL_VECTOR);
SetClientViewEntity(client, client);
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(client, Prop_Send, "m_ArmorValue", armour[client], 1 );
Driving[client] = false;
drivers_car[client] = -1;
}
public ViewToggle(car, client)
{
new t = 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.
__________________