Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions addons/sourcemod/scripting/Parachute.sp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public Plugin myinfo =
name = "SM Parachute",
author = "SWAT_88",
description = "Adds a parachute with low gravity when you hold the use key",
version = "2.7.0",
version = "2.7.1",
url = "http://www.sourcemod.net/"
};

Expand Down Expand Up @@ -343,7 +343,7 @@ int ParachutesMenuHandler(Menu menu, MenuAction action, int param1, int param2)
g_hCookie.Set(param1, model);
CPrintToChat(param1, "{green}[SM] {default}You have changed your {olive}Parachute model {lightgreen}to %s", model);
if (IsPlayerAlive(param1))
CreateParachute(param1);
UpdateParachuteModelLive(param1);

OpenParachutesMenu(param1);
}
Expand Down Expand Up @@ -458,6 +458,9 @@ void CreateParachute(int client)
if ((g_Para[client].entRef = EntIndexToEntRef(ent)) == INVALID_ENT_REFERENCE)
return;

char sSetModel[256];
FormatEx(sSetModel, sizeof(sSetModel), "!self,SetModel %s,0,-1", info.model);

g_Para[client].z = info.z;
g_Para[client].angles = info.angles;

Expand All @@ -467,6 +470,7 @@ void CreateParachute(int client)
DispatchKeyValue(ent, "targetname", "parachute_prop");
DispatchKeyValue(ent, "OnUser1", "!self,TurnOn,0,-1");
DispatchKeyValue(ent, "OnUser2", "!self,TurnOff,0,-1");
DispatchKeyValue(ent, "OnUser3", sSetModel);
SetEntityMoveType(ent, MOVETYPE_NOCLIP);
DispatchSpawn(ent);
}
Expand Down Expand Up @@ -522,6 +526,15 @@ void HideParachute(int client)
AcceptEntityInput(iEnt, "FireUser2");
}

void UpdateParachuteModelLive(int client)
{
int iEnt = g_Para[client].GetEntity();
if (iEnt == -1)
return;

AcceptEntityInput(iEnt, "FireUser3");
}

void TeleportParachute(int client)
{
int iEnt = g_Para[client].GetEntity();
Expand Down