Raised This Month: $51 Target: $400
 12% 

c4 Blip Updator


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
sgtbane
Member
Join Date: Feb 2006
Old 04-18-2009 , 03:41   c4 Blip Updator
Reply With Quote #1

I haven't seen this released yet and needed something to do this for our server. If one exists just let me know and I will delete this, otherwise here ya go.

What it does:
By default the c4 blip is displayed at the position of the player who dropped it. they throw it further into a corner, or it falls down a slope, or lands on something that moves and is dragged somewhere, the default blip will still only show the location of the dropper, where this will constantly track and update its location.

I made a few quick changes as recommended below. I tried to use hamsandwich to make the entity think, but it never seemed to work properly. In any matter, updating the location on a think seems to be a little overkill for something like this. If you really want to put it on a think do it yourself, otherwise I will just keep it on the 1 sec task
Attached Files
File Type: sma Get Plugin or Get Source (c4positionupdator.sma - 710 views - 1.7 KB)
__________________
[Add|Community]

~SgtBane

Last edited by sgtbane; 04-18-2009 at 14:59.
sgtbane is offline
Send a message via MSN to sgtbane
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 04-18-2009 , 03:52   Re: c4 Blip Updator
Reply With Quote #2

PHP Code:
for(new id=0id<maxplayersid++) { 
to

PHP Code:
for(new id=1id<=maxplayersid++) { 
After that, add the check to see if its alive.

PHP Code:
public pluginrequired() {
    new 
bombsiteid
    bombsiteid 
fm_find_ent_by_class(maxplayers"func_bomb_target")
    if (
pev_valid(bombsiteid)) return true
    bombsiteid 
fm_find_ent_by_class(maxplayers"info_bomb_target")
    if (
pev_valid(bombsiteid)) return true
    
return false

PHP Code:
public pluginrequired() {
    new 
bombsiteid fm_find_ent_by_class(maxplayers"func_bomb_target")
    if (
pev_valid(bombsiteid)) return true
    
    bombsiteid 
fm_find_ent_by_class(maxplayers"info_bomb_target")
    return (
pev_valid(bombsiteid))
    

PHP Code:
public plugin_init() {
    
register_plugin(PLUG_NAME,    PLUG_VERS,        PLUG_AUTH)

    
gmsgBombDrop   get_user_msgid("BombDrop")
    
maxplayers get_maxplayers()
    
    
set_task(REFRESH_TIME"radar_event"TASKID_REFRESHRADAR__"b")
    if (!
pluginrequired()) pause("ad")
    return 
PLUGIN_CONTINUE

Why pause?

PHP Code:
public plugin_init() {
    
register_plugin(PLUG_NAME,    PLUG_VERS,        PLUG_AUTH)

    if(
pluginrequired())
    {
        
gmsgBombDrop   get_user_msgid("BombDrop")
        
maxplayers get_maxplayers()
   
        
set_task(REFRESH_TIME"radar_event"TASKID_REFRESHRADAR__"b")
    }

Other things to change:

Replace the task with a thinking entity.

Use Ham_Item_Drop to detect the C4 drop (anyone correct me if i'm wrong)
After droping make the entity think.
On round end and/or when someone collects it make it stop thinking.
__________________

Last edited by joaquimandrade; 04-18-2009 at 04:16.
joaquimandrade is offline
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 04-18-2009 , 05:08   Re: c4 Blip Updator
Reply With Quote #3

This is nice. Will it fix the annoying bugs with the 32. player on the server?

For the Ham_Drop_Item: If it doesn't work - hooking SetModel will do it.
__________________
In Flames we trust!
Nextra is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-18-2009 , 16:55   Re: c4 Blip Updator
Reply With Quote #4

1.
Code:
#define fm_find_ent_by_class(%1,%2) engfunc(EngFunc_FindEntityByString, %1, "classname", %2) stock fm_find_ent_by_model(index, const classname[], const model[]) {     new ent = index, mdl[72]     while ((ent = fm_find_ent_by_class(ent, classname))) {         pev(ent, pev_model, mdl, sizeof mdl - 1)         if (equal(mdl, model)) return ent     }     return 0 }

Use the engine natives instead.

2.
Code:
for(new id=1; id<maxplayers; id++) {

Code:
for(new id=1; id<=maxplayers; id++) {

3.
Code:
if (get_user_team(id) == 1) {
Switch to this:
Code:
if (cs_get_user_team(id) == CS_TEAM_T) {
Or remove:
Code:
#include <cstrike>


Unapproved until fixed.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:11.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode