Raised This Month: $ Target: $400
 0% 

Problems making bomb transfer..


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 12-12-2006 , 23:37   Problems making bomb transfer..
Reply With Quote #1

Well I am using part of VEN's plugin, but it wont transfer the bomb.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <fakemeta>

#define    FL_ONGROUND (1<<9)

new index,cvar1,cvar2,cvar3,cvar4,cvar5,cvar6;
new 
Float:startFloat:endFloat:burytime;
new 
origin[3];

public 
plugin_init()
{
    
register_plugin("Bomb Drop Slay","0.5","SweatyBanana");

    
register_dictionary("bombdict.txt")

    
// bomb status
    // 1 - plugin on
    // 0 - plugin off
    
cvar1 register_cvar("bomb_status","1");
    
cvar2 register_cvar("bomb_time","10.0");
    
cvar3 register_cvar("bomb_punish","1");
    
cvar4 register_cvar("bomb_slaphealth","50");
    
cvar5 register_cvar("bomb_burytime","10.0");
    
cvar6 register_cvar("bomb_transfer","1");


    if(
engfunc(EngFunc_FindEntityByString, -1"classname""func_bomb_target") > 0)
    {
        
register_logevent("f_spawned"3"2=Spawned_With_The_Bomb")
        
register_logevent("f_dropped"3"2=Dropped_The_Bomb")
    }
}

public 
f_spawned()
{
    if(
get_pcvar_num(cvar1)==0)
        return 
PLUGIN_HANDLED;

    
index get_loguser_index();
    
start get_gametime();

    return 
PLUGIN_CONTINUE;
}

public 
f_dropped()
{
    new 
user get_loguser_index();
    if(
get_pcvar_num(cvar1)==|| !is_user_alive(user))
        return 
PLUGIN_HANDLED;

    
end get_gametime();
    if(
user==index && end-start<=get_pcvar_float(cvar2))
    {
        
f_punishuser(index);
    }

    return 
PLUGIN_CONTINUE;
}

public 
f_punishuser(index)
{
    new 
punishment get_pcvar_num(cvar3);
    new 
starthealth get_user_health(index);
    new 
slaphealth get_pcvar_num(cvar4);
    new 
transfer get_pcvar_num(cvar6);
    
burytime get_pcvar_float(cvar5);

    if(
slaphealth<|| burytime<0.0)
    {
        
slaphealth 50;
        
burytime 10.0;
    }

    new 
Name[33];
    
get_user_name(index,Name,32);
    
set_hudmessage(25500, -1.00.006.012.0);

    switch(
punishment)
    {
        case 
1:
        {
            
user_kill(index,0);
            
show_hudmessage(0,"%L",LANG_SERVER,"SLAY",Name);
        }
        case 
2:
        {
            
user_slap(index,slaphealth);
            
show_hudmessage(0,"%L",LANG_SERVER,"SLAP",Name,starthealth-slaphealth);
        }
        case 
3:
        {
            
set_task(0.1,"f_bury",index);
            
show_hudmessage(0,"%L",LANG_SERVER,"BURY",Name,floatround(burytime,floatround_floor));
        }
    }

    if(
transfer == 1)
    {
        new 
user[32],num,x;
        
get_players(user,num,"ae","TERRORIST")

        
get_user_origin(index,origin)
        new 
min_dist 999999,dist,recipient,origin2[3];
        for(new 
0;num;++i)
        {
            
user[i]

            
get_user_origin(x,origin2)
            
dist get_distance(origin,origin2)
            if(
dist min_dist)
            {
                
min_dist dist
                recipient 
x
            
}
        }

        if(
num<2)
        {
            return 
PLUGIN_HANDLED;
        }

        new 
c4 engfunc(EngFunc_FindEntityByString,-1,"classname","weapon_c4"// find weapon_c4 entity
        
if(!c4)
            return 
PLUGIN_HANDLED;

        new 
backpack pev(c4,pev_owner// get backpack entity
        
if(backpack <= get_maxplayers())
            return 
PLUGIN_HANDLED;

        
set_pev(backpack,pev_flags,pev(backpack,pev_flags)|FL_ONGROUND)
        
dllfunc(DLLFunc_Touch,backpack,recipient)
    }
    return 
PLUGIN_HANDLED;
}

public 
f_bury(index)
{
    
get_user_origin(index,origin);
    
origin[2] -= 50;
    
set_user_origin(index,origin);
    
set_task(burytime,"f_unbury",index);
}

public 
f_unbury(index)
{
    
get_user_origin(index,origin);
    
origin[2] += 50;
    
set_user_origin(index,origin);
    
client_print(index,print_chat,"%L",LANG_SERVER,"UNBURY");
}

stock get_loguser_index()
{
    new 
loguser[80],name[32]

    
read_logargv(0,loguser,79)
    
parse_loguser(loguser,name,31)

    return 
get_user_index(name)

SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
The Specialist
BANNED
Join Date: Nov 2006
Old 12-13-2006 , 03:17   Re: Problems making bomb transfer..
Reply With Quote #2

why dont you try something like
Code:
fm_strip_user_gun(id,"weapon_c4") fm_tranfer_user_gun() or fm_give_item(id,weapon_c4")

any combination of those should work
The Specialist is offline
Send a message via AIM to The Specialist
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 12-13-2006 , 03:56   Re: Problems making bomb transfer..
Reply With Quote #3

It should have the same affect as the other. But i am not forcing a drop.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
dutchmeat
Senior Member
Join Date: Sep 2006
Old 12-13-2006 , 04:52   Re: Problems making bomb transfer..
Reply With Quote #4

You should try not to combine new var + value , and new var:

new min_dist = 999999,dist,recipient,origin2[3];
should be:
new min_dist = 999999
new
dist,recipient,origin2[3];
__________________
before you criticize someone, you should walk a mile in their shoes. that way, when you criticize them, you're a mile away and you have their shoes.
dutchmeat is offline
P34nut
AMX Mod X Beta Tester
Join Date: Feb 2006
Location: Netherlands
Old 12-13-2006 , 07:27   Re: Problems making bomb transfer..
Reply With Quote #5

Quote:
Originally Posted by dutchmeat View Post
You should try not to combine new var + value , and new var:

new min_dist = 999999,dist,recipient,origin2[3];
should be:
new min_dist = 999999
new
dist,recipient,origin2[3];
There is nothing wrong with that...
__________________
All you need to change the world is one good lie and a river of blood
P34nut is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 12-13-2006 , 09:22   Re: Problems making bomb transfer..
Reply With Quote #6

Anybody got any ideas?
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
dutchmeat
Senior Member
Join Date: Sep 2006
Old 12-13-2006 , 09:52   Re: Problems making bomb transfer..
Reply With Quote #7

Where does the function stop working? debug it please
__________________
before you criticize someone, you should walk a mile in their shoes. that way, when you criticize them, you're a mile away and you have their shoes.
dutchmeat is offline
nick123
BANNED
Join Date: Dec 2006
Old 12-13-2006 , 11:50   Re: Problems making bomb transfer..
Reply With Quote #8

hmm i got an idea!.

use find_ent_in_sphere to find the closest ent, check if it's index is between 32 and 1, then check if it's a te play. easy!
nick123 is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 12-13-2006 , 12:03   Re: Problems making bomb transfer..
Reply With Quote #9

You are an idiot.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
dutchmeat
Senior Member
Join Date: Sep 2006
Old 12-13-2006 , 13:34   Re: Problems making bomb transfer..
Reply With Quote #10

Quote:
Originally Posted by SweatyBanana View Post
You are an idiot.
I hope you're refering referring to nick
__________________
before you criticize someone, you should walk a mile in their shoes. that way, when you criticize them, you're a mile away and you have their shoes.
dutchmeat 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 06:47.


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