Advertisement
MasamuneDate

CoD - 3d Manuver - Hook

Jul 29th, 2019
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 18.67 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <fakemeta>
  4. #include <cstrike>
  5. #include <engine>
  6. #include <codmod>
  7. #include <xs>
  8.  
  9. #define PLUGIN "Lina Spidermana"
  10. #define VERSION "1.0"
  11. #define AUTHOR "RPK. Shark"
  12.  
  13. #define message_begin_f(%1,%2,%3,%4) engfunc(EngFunc_MessageBegin, %1, %2, %3, %4)
  14. #define write_coord_f(%1) engfunc(EngFunc_WriteCoord, %1)
  15.  
  16. new nazwa[] = "3D Manuver Gear"
  17. new opis[] = "Press R To use hook, Instant kill with knife"
  18.  
  19. new bool:ma_perk[33];
  20.  
  21. //Cvars
  22. new pThrowSpeed, pSpeed, pWidth, pSound, pColor
  23. new pInterrupt, pHookSky, pOpenDoors, pPlayers
  24. new pUseButtons, pHostage, pWeapons, pInstant, pHookNoise
  25.  
  26. // Sprite
  27. new sprBeam
  28.  
  29. // Players hook entity
  30. new Hook[33]
  31.  
  32. // MaxPlayers
  33. new gMaxPlayers
  34.  
  35. // some booleans
  36. new bool:gHooked[33]
  37. new bool:canThrowHook[33]
  38.  
  39. // Player Spawn
  40. new bool:gRestart[33] = {false, ...}
  41. new bool:gUpdate[33] = {false, ...}
  42.  
  43.  
  44. new VIEW_MODEL[]    = "models/QTM_CodMod/Knife-Mod/v_machete.mdl"
  45.  
  46. public plugin_init()
  47. {
  48.     register_plugin(nazwa, "1.0", "RPK. Shark")
  49.     cod_register_perk(nazwa, opis);
  50.     register_event("HLTV", "round_bstart", "a", "1=0", "2=0")
  51.     register_event("TextMsg", "Restart", "a", "2=#Game_will_restart_in")
  52.     register_clcmd("fullupdate", "Update")
  53.     register_event("ResetHUD", "ResetHUD", "b")
  54.     register_forward(FM_Touch, "fwTouch")
  55.     register_event("CurWeapon", "Event_CurWeapon", "be","1=1")
  56.    
  57.     pThrowSpeed =   register_cvar("sv_hookthrowspeed", "3000")
  58.     pSpeed =    register_cvar("sv_hookspeed", "1000")
  59.     pWidth =    register_cvar("sv_hookwidth", "32")
  60.     pSound =    register_cvar("sv_hooksound", "1")
  61.     pColor =    register_cvar("sv_hookcolor", "1")
  62.     pPlayers =  register_cvar("sv_hookplayers", "1")
  63.     pInterrupt =    register_cvar("sv_hookinterrupt", "0")
  64.     pHookSky =  register_cvar("sv_hooksky", "1")
  65.     pOpenDoors =    register_cvar("sv_hookopendoors", "1")
  66.     pUseButtons =   register_cvar("sv_hookusebuttons", "1")
  67.     pHostage =  register_cvar("sv_hookhostflollow", "1")
  68.     pWeapons =  register_cvar("sv_hookpickweapons", "1")
  69.     pInstant =  register_cvar("sv_hookinstant", "0")
  70.     pHookNoise =    register_cvar("sv_hooknoise", "1")
  71.    
  72.     gMaxPlayers = get_maxplayers()
  73. }
  74.  
  75. public plugin_precache()
  76. {
  77.     engfunc(EngFunc_PrecacheModel, "models/rpgrocket.mdl")
  78.     sprBeam = engfunc(EngFunc_PrecacheModel, "sprites/zbeam4.spr")
  79.     engfunc(EngFunc_PrecacheSound, "weapons/xbow_hit1.wav")
  80.     engfunc(EngFunc_PrecacheSound, "weapons/xbow_hit2.wav")
  81.     engfunc(EngFunc_PrecacheSound, "weapons/xbow_hitbod1.wav")
  82.     engfunc(EngFunc_PrecacheSound, "weapons/xbow_fire1.wav")
  83.     precache_model(VIEW_MODEL)
  84. }
  85.  
  86. public cod_perk_enabled(id)
  87. {
  88.     ma_perk[id] = true;
  89. }
  90.  
  91. public cod_perk_disabled(id)
  92. {
  93.     ma_perk[id] = false;
  94. }
  95.  
  96. public client_PreThink(id)
  97. {
  98.     if(is_user_alive(id))
  99.     {  
  100.         if(ma_perk[id])
  101.         {
  102.             if(pev(id, pev_button) & IN_RELOAD)
  103.             {
  104.                 if(canThrowHook[id] && !gHooked[id])
  105.                 {
  106.                     throw_hook(id)
  107.                    
  108.                 }
  109.                 return PLUGIN_HANDLED
  110.             }
  111.             else
  112.                 del_hook(id)
  113.         }
  114.     }
  115.     return PLUGIN_HANDLED
  116. }
  117.  
  118. public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
  119. {
  120.     if(!is_user_connected(idattacker))
  121.         return PLUGIN_CONTINUE;
  122.    
  123.     if(!ma_perk[idattacker])
  124.         return PLUGIN_CONTINUE;
  125.    
  126.     if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_KNIFE && damagebits & DMG_BULLET && damage > 20)
  127.         cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
  128.    
  129.     return PLUGIN_CONTINUE;
  130. }
  131.  
  132. public Event_CurWeapon(id)
  133. {    
  134.     new weaponID = read_data(2)
  135.  
  136.     if(weaponID != CSW_KNIFE)
  137.         return PLUGIN_CONTINUE
  138.    
  139.     if(ma_perk[id]){
  140.     set_pev(id, pev_viewmodel2, VIEW_MODEL)
  141.    }
  142.    
  143.     return PLUGIN_CONTINUE
  144. }
  145.  
  146. public del_hook(id)
  147. {
  148.     if (!canThrowHook[id])
  149.         remove_hook(id)
  150.    
  151.     return PLUGIN_HANDLED
  152. }
  153.  
  154. public round_bstart()
  155. {
  156.     for (new i = 1; i <= gMaxPlayers; i++)
  157.     {
  158.         if (is_user_connected(i))
  159.         {
  160.             if(!canThrowHook[i])
  161.                 remove_hook(i)
  162.         }
  163.     }
  164. }
  165.  
  166. public Restart()
  167. {
  168.     for (new id = 0; id < gMaxPlayers; id++)
  169.     {
  170.         if (is_user_connected(id))
  171.             gRestart[id] = true
  172.     }
  173. }
  174.  
  175. public Update(id)
  176. {
  177.     if (!gUpdate[id])
  178.         gUpdate[id] = true
  179.    
  180.     return PLUGIN_CONTINUE
  181. }
  182.  
  183. public ResetHUD(id)
  184. {
  185.     if (gRestart[id])
  186.     {
  187.         gRestart[id] = false
  188.         return
  189.     }
  190.     if (gUpdate[id])
  191.     {
  192.         gUpdate[id] = false
  193.         return
  194.     }
  195.     if (gHooked[id])
  196.     {
  197.         remove_hook(id)
  198.     }
  199. }
  200.  
  201. public fwTouch(ptr, ptd)
  202. {
  203.     if (!pev_valid(ptr))
  204.         return FMRES_IGNORED
  205.    
  206.     new id = pev(ptr, pev_owner)
  207.    
  208.     // Get classname
  209.     static szPtrClass[32]  
  210.     pev(ptr, pev_classname, szPtrClass, charsmax(szPtrClass))
  211.    
  212.     if (equali(szPtrClass, "Hook"))
  213.     {      
  214.         static Float:fOrigin[3]
  215.         pev(ptr, pev_origin, fOrigin)
  216.        
  217.         if (pev_valid(ptd))
  218.         {
  219.             static szPtdClass[32]
  220.             pev(ptd, pev_classname, szPtdClass, charsmax(szPtdClass))
  221.                        
  222.             if (!get_pcvar_num(pPlayers) && /*equali(szPtdClass, "player")*/ is_user_alive(ptd))
  223.             {
  224.                 // Hit a player
  225.                 if (get_pcvar_num(pSound))
  226.                     emit_sound(ptr, CHAN_STATIC, "weapons/xbow_hitbod1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
  227.                 remove_hook(id)
  228.                
  229.                 return FMRES_HANDLED
  230.             }
  231.             else if (equali(szPtdClass, "hostage_entity"))
  232.             {
  233.                 // Makes an hostage follow
  234.                 if (get_pcvar_num(pHostage) && get_user_team(id) == 2)
  235.                 {                  
  236.                     //cs_set_hostage_foll(ptd, (cs_get_hostage_foll(ptd) == id) ? 0 : id)
  237.                     // With the use function we have the sounds!
  238.                     dllfunc(DLLFunc_Use, ptd, id)
  239.                 }
  240.                 if (!get_pcvar_num(pPlayers))
  241.                 {
  242.                     if(get_pcvar_num(pSound))
  243.                         emit_sound(ptr, CHAN_STATIC, "weapons/xbow_hitbod1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
  244.                     remove_hook(id)
  245.                 }
  246.                 return FMRES_HANDLED
  247.             }
  248.             else if (get_pcvar_num(pOpenDoors) && equali(szPtdClass, "func_door") || equali(szPtdClass, "func_door_rotating"))
  249.             {
  250.                 // Open doors
  251.                 // Double doors tested in de_nuke and de_wallmart
  252.                 static szTargetName[32]
  253.                 pev(ptd, pev_targetname, szTargetName, charsmax(szTargetName))
  254.                 if (strlen(szTargetName) > 0)
  255.                 {  
  256.                     static ent
  257.                     while ((ent = engfunc(EngFunc_FindEntityByString, ent, "target", szTargetName)) > 0)
  258.                     {
  259.                         static szEntClass[32]
  260.                         pev(ent, pev_classname, szEntClass, charsmax(szEntClass))
  261.                        
  262.                         if (equali(szEntClass, "trigger_multiple"))
  263.                         {
  264.                             dllfunc(DLLFunc_Touch, ent, id)
  265.                             goto stopdoors // No need to touch anymore
  266.                         }
  267.                     }
  268.                 }
  269.                
  270.                 // No double doors.. just touch it
  271.                 dllfunc(DLLFunc_Touch, ptd, id)
  272. stopdoors:            
  273.             }
  274.             else if (get_pcvar_num(pUseButtons) && equali(szPtdClass, "func_button"))
  275.             {
  276.                 if (pev(ptd, pev_spawnflags) & SF_BUTTON_TOUCH_ONLY)
  277.                     dllfunc(DLLFunc_Touch, ptd, id) // Touch only
  278.                 else          
  279.                     dllfunc(DLLFunc_Use, ptd, id) // Use Buttons          
  280.             }
  281.         }
  282.        
  283.         // If cvar sv_hooksky is 0 and hook is in the sky remove it!
  284.         new iContents = engfunc(EngFunc_PointContents, fOrigin)
  285.         if (!get_pcvar_num(pHookSky) && iContents == CONTENTS_SKY)
  286.         {
  287.             if(get_pcvar_num(pSound))
  288.                 emit_sound(ptr, CHAN_STATIC, "weapons/xbow_hit2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
  289.             remove_hook(id)
  290.             return FMRES_HANDLED
  291.         }
  292.        
  293.         // Pick up weapons..
  294.         if (get_pcvar_num(pWeapons))
  295.         {
  296.             static ent
  297.             while ((ent = engfunc(EngFunc_FindEntityInSphere, ent, fOrigin, 15.0)) > 0)
  298.             {
  299.                 static szentClass[32]
  300.                 pev(ent, pev_classname, szentClass, charsmax(szentClass))
  301.                
  302.                 if (equali(szentClass, "weaponbox") || equali(szentClass, "armoury_entity"))
  303.                     dllfunc(DLLFunc_Touch, ent, id)
  304.             }
  305.         }
  306.        
  307.         // Player is now hooked
  308.         gHooked[id] = true
  309.         // Play sound
  310.         if (get_pcvar_num(pSound))
  311.             emit_sound(ptr, CHAN_STATIC, "weapons/xbow_hit1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
  312.        
  313.         // Make some sparks :D
  314.         message_begin_f(MSG_BROADCAST, SVC_TEMPENTITY, fOrigin, 0)
  315.         write_byte(9) // TE_SPARKS
  316.         write_coord_f(fOrigin[0]) // Origin
  317.         write_coord_f(fOrigin[1])
  318.         write_coord_f(fOrigin[2])
  319.         message_end()      
  320.        
  321.         // Stop the hook from moving
  322.         set_pev(ptr, pev_velocity, Float:{0.0, 0.0, 0.0})
  323.         set_pev(ptr, pev_movetype, MOVETYPE_NONE)
  324.        
  325.         //Task
  326.         if (!task_exists(id + 856))
  327.         {
  328.             static TaskData[2]
  329.             TaskData[0] = id
  330.             TaskData[1] = ptr
  331.             gotohook(TaskData)
  332.            
  333.             set_task(0.1, "gotohook", id + 856, TaskData, 2, "b")
  334.         }
  335.     }
  336.     return FMRES_HANDLED
  337. }
  338.  
  339. public hookthink(param[])
  340. {
  341.     new id = param[0]
  342.     new HookEnt = param[1]
  343.    
  344.     if (!is_user_alive(id) || !pev_valid(HookEnt) || !pev_valid(id))
  345.     {
  346.         remove_task(id + 890)
  347.         return PLUGIN_HANDLED
  348.     }
  349.    
  350.    
  351.     static Float:entOrigin[3]
  352.     pev(HookEnt, pev_origin, entOrigin)
  353.    
  354.     // If user is behind a box or something.. remove it
  355.     // only works if sv_interrupt 1 or higher is
  356.     if (get_pcvar_num(pInterrupt))
  357.     {
  358.         static Float:usrOrigin[3]
  359.         pev(id, pev_origin, usrOrigin)
  360.        
  361.         static tr
  362.         engfunc(EngFunc_TraceLine, usrOrigin, entOrigin, 1, -1, tr)
  363.        
  364.         static Float:fFraction
  365.         get_tr2(tr, TR_flFraction, fFraction)
  366.        
  367.         if (fFraction != 1.0)
  368.             remove_hook(id)
  369.     }
  370.    
  371.     // If cvar sv_hooksky is 0 and hook is in the sky remove it!
  372.     new iContents = engfunc(EngFunc_PointContents, entOrigin)
  373.     if (!get_pcvar_num(pHookSky) && iContents == CONTENTS_SKY)
  374.     {
  375.         if(get_pcvar_num(pSound))
  376.             emit_sound(HookEnt, CHAN_STATIC, "weapons/xbow_hit2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
  377.         remove_hook(id)
  378.     }
  379.    
  380.     return PLUGIN_HANDLED
  381. }
  382.  
  383. public gotohook(param[])
  384. {
  385.     new id = param[0]
  386.     new HookEnt = param[1]
  387.  
  388.     if (!is_user_alive(id) || !pev_valid(HookEnt) || !pev_valid(id))
  389.     {
  390.         remove_task(id + 856)
  391.         return PLUGIN_HANDLED
  392.     }
  393.     // If the round isnt started velocity is just 0
  394.     static Float:fVelocity[3]
  395.     fVelocity = Float:{0.0, 0.0, 1.0}
  396.    
  397.     // If the round is started and player is hooked we can set the user velocity!
  398.     if (gHooked[id])
  399.     {
  400.         static Float:fHookOrigin[3], Float:fUsrOrigin[3], Float:fDist
  401.         pev(HookEnt, pev_origin, fHookOrigin)
  402.         pev(id, pev_origin, fUsrOrigin)
  403.        
  404.         fDist = vector_distance(fHookOrigin, fUsrOrigin)
  405.        
  406.         if (fDist >= 30.0)
  407.         {
  408.             new Float:fSpeed = get_pcvar_float(pSpeed)
  409.            
  410.             fSpeed *= 0.52
  411.            
  412.             fVelocity[0] = (fHookOrigin[0] - fUsrOrigin[0]) * (2.0 * fSpeed) / fDist
  413.             fVelocity[1] = (fHookOrigin[1] - fUsrOrigin[1]) * (2.0 * fSpeed) / fDist
  414.             fVelocity[2] = (fHookOrigin[2] - fUsrOrigin[2]) * (2.0 * fSpeed) / fDist
  415.         }
  416.     }
  417.     // Set the velocity
  418.     set_pev(id, pev_velocity, fVelocity)
  419.    
  420.     return PLUGIN_HANDLED
  421. }
  422.        
  423. public throw_hook(id)
  424. {
  425.     // Get origin and angle for the hook
  426.     static Float:fOrigin[3], Float:fAngle[3],Float:fvAngle[3]
  427.     static Float:fStart[3]
  428.     pev(id, pev_origin, fOrigin)
  429.    
  430.     pev(id, pev_angles, fAngle)
  431.     pev(id, pev_v_angle, fvAngle)
  432.    
  433.     if (get_pcvar_num(pInstant))
  434.     {
  435.         get_user_hitpoint(id, fStart)
  436.        
  437.         if (engfunc(EngFunc_PointContents, fStart) != CONTENTS_SKY)
  438.         {
  439.             static Float:fSize[3]
  440.             pev(id, pev_size, fSize)
  441.            
  442.             fOrigin[0] = fStart[0] + floatcos(fvAngle[1], degrees) * (-10.0 + fSize[0])
  443.             fOrigin[1] = fStart[1] + floatsin(fvAngle[1], degrees) * (-10.0 + fSize[1])
  444.             fOrigin[2] = fStart[2]
  445.         }
  446.         else
  447.             xs_vec_copy(fStart, fOrigin)
  448.     }
  449.  
  450.    
  451.     // Make the hook!
  452.     Hook[id] = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
  453.        
  454.     if (Hook[id])
  455.     {
  456.         // Player cant throw hook now
  457.         canThrowHook[id] = false
  458.        
  459.         static const Float:fMins[3] = {-2.840000, -14.180000, -2.840000}
  460.         static const Float:fMaxs[3] = {2.840000, 0.020000, 2.840000}
  461.        
  462.         //Set some Data
  463.         set_pev(Hook[id], pev_classname, "Hook")
  464.        
  465.         engfunc(EngFunc_SetModel, Hook[id], "models/rpgrocket.mdl")
  466.         engfunc(EngFunc_SetOrigin, Hook[id], fOrigin)
  467.         engfunc(EngFunc_SetSize, Hook[id], fMins, fMaxs)      
  468.        
  469.         //set_pev(Hook[id], pev_mins, fMins)
  470.         //set_pev(Hook[id], pev_maxs, fMaxs)
  471.        
  472.         set_pev(Hook[id], pev_angles, fAngle)
  473.        
  474.         set_pev(Hook[id], pev_solid, 2)
  475.         set_pev(Hook[id], pev_movetype, 5)
  476.         set_pev(Hook[id], pev_owner, id)
  477.        
  478.         //Set hook velocity
  479.         static Float:fForward[3], Float:Velocity[3]
  480.         new Float:fSpeed = get_pcvar_float(pThrowSpeed)
  481.        
  482.         engfunc(EngFunc_MakeVectors, fvAngle)
  483.         global_get(glb_v_forward, fForward)
  484.        
  485.         Velocity[0] = fForward[0] * fSpeed
  486.         Velocity[1] = fForward[1] * fSpeed
  487.         Velocity[2] = fForward[2] * fSpeed
  488.        
  489.         set_pev(Hook[id], pev_velocity, Velocity)
  490.  
  491.         // Make the line between Hook and Player
  492.         message_begin_f(MSG_BROADCAST, SVC_TEMPENTITY, Float:{0.0, 0.0, 0.0}, 0)
  493.         if (get_pcvar_num(pInstant))
  494.         {
  495.             write_byte(1) // TE_BEAMPOINT
  496.             write_short(id) // Startent
  497.             write_coord_f(fStart[0]) // End pos
  498.             write_coord_f(fStart[1])
  499.             write_coord_f(fStart[2])
  500.         }
  501.         else
  502.         {
  503.             write_byte(8) // TE_BEAMENTS
  504.             write_short(id) // Start Ent
  505.             write_short(Hook[id]) // End Ent
  506.         }
  507.         write_short(sprBeam) // Sprite
  508.         write_byte(1) // StartFrame
  509.         write_byte(1) // FrameRate
  510.         write_byte(600) // Life
  511.         write_byte(get_pcvar_num(pWidth)) // Width
  512.         write_byte(get_pcvar_num(pHookNoise)) // Noise
  513.         // Colors now
  514.         if (get_pcvar_num(pColor))
  515.         {
  516.             if (get_user_team(id) == 1) // Terrorist
  517.             {
  518.                 write_byte(255) // R
  519.                 write_byte(0)   // G
  520.                 write_byte(0)   // B
  521.             }
  522.             #if defined _cstrike_included
  523.             else if(cs_get_user_vip(id)) // vip for cstrike
  524.             {
  525.                 write_byte(0)   // R
  526.                 write_byte(255) // G
  527.                 write_byte(0)   // B
  528.             }
  529.             #endif // _cstrike_included
  530.             else if(get_user_team(id) == 2) // CT
  531.             {
  532.                 write_byte(0)   // R
  533.                 write_byte(0)   // G
  534.                 write_byte(255) // B
  535.             }
  536.             else
  537.             {
  538.                 write_byte(255) // R
  539.                 write_byte(255) // G
  540.                 write_byte(255) // B
  541.             }
  542.         }
  543.         else
  544.         {
  545.             write_byte(255) // R
  546.             write_byte(255) // G
  547.             write_byte(255) // B
  548.         }
  549.         write_byte(192) // Brightness
  550.         write_byte(0) // Scroll speed
  551.         message_end()
  552.        
  553.         if (get_pcvar_num(pSound) && !get_pcvar_num(pInstant))
  554.             emit_sound(id, CHAN_BODY, "weapons/xbow_fire1.wav", VOL_NORM, ATTN_NORM, 0, PITCH_HIGH)
  555.        
  556.         static TaskData[2]
  557.         TaskData[0] = id
  558.         TaskData[1] = Hook[id]
  559.        
  560.         set_task(0.1, "hookthink", id + 890, TaskData, 2, "b")
  561.     }
  562.     else
  563.         client_print(id, print_chat, "Can't create hook")
  564. }
  565.  
  566. public remove_hook(id)
  567. {
  568.     //Player can now throw hooks
  569.     canThrowHook[id] = true
  570.    
  571.     // Remove the hook if it is valid
  572.     if (pev_valid(Hook[id]))
  573.         engfunc(EngFunc_RemoveEntity, Hook[id])
  574.     Hook[id] = 0
  575.    
  576.     // Remove the line between user and hook
  577.     if (is_user_connected(id))
  578.     {
  579.         message_begin(MSG_BROADCAST, SVC_TEMPENTITY, {0,0,0}, id)
  580.         write_byte(99) // TE_KILLBEAM
  581.         write_short(id) // entity
  582.         message_end()
  583.     }
  584.    
  585.     // Player is not hooked anymore
  586.     gHooked[id] = false
  587.     return 1
  588. }
  589.  
  590. // Stock by Chaosphere
  591. stock get_user_hitpoint(id, Float:hOrigin[3])
  592. {
  593.     if (!is_user_alive(id))
  594.         return 0
  595.    
  596.     static Float:fOrigin[3], Float:fvAngle[3], Float:fvOffset[3], Float:fvOrigin[3], Float:feOrigin[3]
  597.     static Float:fTemp[3]
  598.    
  599.     pev(id, pev_origin, fOrigin)
  600.     pev(id, pev_v_angle, fvAngle)
  601.     pev(id, pev_view_ofs, fvOffset)
  602.    
  603.     xs_vec_add(fOrigin, fvOffset, fvOrigin)
  604.    
  605.     engfunc(EngFunc_AngleVectors, fvAngle, feOrigin, fTemp, fTemp)
  606.    
  607.     xs_vec_mul_scalar(feOrigin, 8192.0, feOrigin)
  608.     xs_vec_add(fvOrigin, feOrigin, feOrigin)
  609.    
  610.     static tr
  611.     engfunc(EngFunc_TraceLine, fvOrigin, feOrigin, 0, id, tr)
  612.     get_tr2(tr, TR_vecEndPos, hOrigin)
  613.     //global_get(glb_trace_endpos, hOrigin)
  614.    
  615.     return 1
  616. }
  617.  
  618. stock statusMsg(id, szMsg[], {Float,_}:...)
  619. {
  620.     static iStatusText
  621.     if (!iStatusText)
  622.         iStatusText = get_user_msgid("StatusText")
  623.    
  624.     static szBuffer[512]
  625.     vformat(szBuffer, charsmax(szBuffer), szMsg, 3)
  626.    
  627.     message_begin((id == 0) ? MSG_ALL : MSG_ONE, iStatusText, _, id)
  628.     write_byte(0) // Unknown
  629.     write_string(szBuffer) // Message
  630.     message_end()
  631.    
  632.     return 1
  633. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement