Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Action Command_Vehicle(client, iArgs){
- float vecEyePosition[3];
- GetGazingPosition(client, vecEyePosition);
- g_iVehicle = CreateEntityByName("prop_vehicle_driveable");
- DispatchKeyValue(g_iVehicle, "vehiclescript", "scripts/vehicles/natalyas_mustang.txt");
- DispatchKeyValue(g_iVehicle, "model", VEHICLE_PATH);
- DispatchKeyValue(g_iVehicle, "targetname", "VEHICLEEEEEEEEEEEEEEEEEEEEEEEEEEe");
- DispatchKeyValue(g_iVehicle, "solid","6");
- DispatchKeyValue(g_iVehicle, "skin", "0");
- DispatchKeyValue(g_iVehicle, "actionScale","1");
- DispatchKeyValue(g_iVehicle, "EnableGun","0");
- DispatchKeyValue(g_iVehicle, "ignorenormals","0");
- DispatchKeyValue(g_iVehicle, "fadescale","1");
- DispatchKeyValue(g_iVehicle, "fademindist","-1");
- DispatchKeyValue(g_iVehicle, "VehicleLocked","0");
- DispatchKeyValue(g_iVehicle, "screenspacefade","0");
- DispatchKeyValue(g_iVehicle, "spawnflags", "256" );
- // SetEntProp(g_iVehicle, Prop_Send, "m_nSolidType", 6);
- DispatchSpawn(g_iVehicle);
- AcceptEntityInput(g_iVehicle, "TurnOn");
- ActivateEntity(g_iVehicle);
- AcceptEntityInput(g_iVehicle, "HandBrakeOff");
- AcceptEntityInput(g_iVehicle, "TurnOn");
- SetEntProp(g_iVehicle, Prop_Data, "m_nNextThinkTick", -1);
- SDKHook(g_iVehicle, SDKHook_Think, OnVehicleThink);
- SetEntProp(g_iVehicle, Prop_Send, "m_nSolidType", 2);
- // SetEntProp(g_iVehicle, Prop_Send, "m_nSolidType", 6);
- TeleportEntity(g_iVehicle, vecEyePosition, NULL_VECTOR, NULL_VECTOR);
- }
- public OnVehicleThink(iEntity){
- int iDriver = GetEntPropEnt(iEntity, Prop_Send, "m_hPlayer");
- if(iDriver > 0 && IsPlayerAlive(iDriver)){
- SetEntProp(iEntity, Prop_Data, "m_nNextThinkTick", 1);
- SetEntPropFloat(iEntity, Prop_Data, "m_flTurnOffKeepUpright", 1.0);
- AcceptEntityInput(iEntity, "TurnOn");
- AcceptEntityInput(iEntity, "HandBrakeOff");
- }
- }
- bool LeaveVehicle(client){
- int iVehicleIndex = GetEntPropEnt(client, Prop_Send, "m_hVehicle");
- if(!iVehicleIndex || !IsValidEntity(iVehicleIndex))
- return false;
- SetVariantString("VEHICLEEEEEEEEEEEEEEEEEEEEEEEEEEe");
- AcceptEntityInput(client, "SetParent");
- SetVariantString("vehicle_driver_exit");
- AcceptEntityInput(client, "SetParentAttachment");
- AcceptEntityInput(client, "ClearParent");
- SetEntProp(client, Prop_Send, "m_CollisionGroup", COLLISION_GROUP_PLAYER);
- // client
- SetEntityMoveType(client, MOVETYPE_WALK);
- SetEntPropEnt(client, Prop_Send, "m_hVehicle", -1);
- // vehicles
- SetEntProp(iVehicleIndex, Prop_Send, "m_nSpeed", 0);
- SetEntPropEnt(iVehicleIndex, Prop_Send, "m_hPlayer", -1);
- SetEntPropFloat(iVehicleIndex, Prop_Send, "m_flThrottle", 0.0);
- AcceptEntityInput(iVehicleIndex, "TurnOff");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement