Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #include <tf2>
- #include <tf2_stocks>
- #include <sdkhooks>
- bool bOnTaunt[MAXPLAYERS];
- ConVar g_CvarSpeed;
- public Plugin myinfo =
- {
- name = "",
- author = "",
- description = "",
- version = "",
- url = ""
- };
- public void OnPluginStart()
- {
- g_CvarSpeed = CreateConVar("sm_taunt_forward_speed", "100.0", "Set the forward speed on taunts");
- }
- public void TF2_OnConditionAdded(int client, TFCond cond)
- {
- if(!bOnTaunt[client] && cond == TFCond_Taunting)
- {
- PrintToChatAll("on taunt");
- bOnTaunt[client] = true;
- SetEntityMoveType(client, MOVETYPE_FLY);
- }
- }
- public void TF2_OnConditionRemoved(int client, TFCond cond)
- {
- if(bOnTaunt[client] && cond == TFCond_Taunting)
- {
- PrintToChatAll("no taunt");
- bOnTaunt[client] = false;
- SetEntityMoveType(client, MOVETYPE_WALK);
- }
- }
- public Action OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
- {
- if(bOnTaunt[client])
- {
- float vAngles[3], fForward[3], vVelocity[3];
- GetClientEyeAngles(client, vAngles);
- vAngles[0] = 0.0;
- GetAngleVectors(vAngles, fForward, NULL_VECTOR, NULL_VECTOR);
- for(int i = 0; i < 3; i++) vVelocity[i] = fForward[i] * g_CvarSpeed.FloatValue;
- TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, vVelocity);
- }
- return Plugin_Continue;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement