bearbear12345

Untitled

Dec 7th, 2013
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <tf2_stocks>
  3. #include <morecolors>
  4. #pragma semicolon 1
  5.  
  6. public Plugin:myinfo =
  7. {
  8. name = "Gunslinger Nerf",
  9. author = "bearbear12345",
  10. description = "Nerfs the gunslinger",
  11. version = "1.0",
  12. url = "
  13. }
  14.  
  15. public OnPluginStart()
  16. {
  17. HookEvent("post_inventory_application", Event_Inventory, EventHookMode_Post);
  18. }
  19.  
  20. public Action:Event_Inventory(Handle:event, const String:name[], bool:dontBroadcast)
  21. {
  22. new client = GetClientOfUserId(GetEventInt(event, "userid"));
  23. if(TF2_GetPlayerClass(client) == TFClass_Engineer) {
  24. new weapon = GetPlayerWeaponSlot(client, TFWeaponSlot_Melee);
  25. if(IsValidEntity(weapon)){
  26. new weaponIndex = GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex");
  27. if(weaponIndex == 142) {
  28. CPrintToChat(client, "{haunted}You cannot use the Gunslinger! Please change weapon to continue");
  29. SetEntPropFloat(client, Prop_Send, "m_flMaxspeed", 1);
  30. }
  31. }
  32. }
  33. }
  34. return Plugin_Continue;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment