AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Drop C4 In Site=kill (https://forums.alliedmods.net/showthread.php?t=50356)

Alka 01-24-2007 15:58

Drop C4 In Site=kill
 
Hi.I want that this plugin "slay" that player who drop the [c4] on C4 AREA after 5 seconds!Here is the Code!But it's not working why?:shock: =>>

Code:


#include <amxmodx>
 
#define PLUGIN_NAME "New plugin"
#define PLUGIN_VERSION "0.1"
#define PLUGIN_AUTHOR "Name"
 
 
public plugin_init()
{
    register_plugin(PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_AUTHOR);
    register_logevent("f_spawned", 3, "2=Spawned_With_The_Bomb");
}
 
 
public f_killuser(id)
    user_kill(id,0);
 
stock get_loguser_index()
{
    new loguser[80],name[32]
 
    read_logargv(0,loguser,79)
 
    parse_loguser(loguser,name,31)
 
    return get_user_index(name)
 
}
 
public f_spawned()
{
 
    new id = get_loguser_index();
 
    set_task(5.0,"f_hasbomb",id);
 
}
 
public f_hasbomb(id)
{
 
    if(user_has_weapon(id, CSW_C4))
        return PLUGIN_HANDLED;
    else
    { 
 
        set_task(5.0,"f_killuser",id);
 
    }
 
    return PLUGIN_HANDLED;
 
}

Thanks in Advanced!

Alka 01-25-2007 09:30

Re: Drop C4=Slay
 
*bump* can enyone help me pls..:|

Dutchie 01-25-2007 09:37

Re: Drop C4 In Site=kill
 
Code:

#include <cstrike>
#include <amxmodx>


#define PLUGIN_NAME "New plugin"
#define PLUGIN_VERSION "0.1"
#define PLUGIN_AUTHOR "Name"
 
 
public plugin_init()
{
    register_plugin(PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_AUTHOR);
    register_logevent("f_spawned", 3, "2=Spawned_With_The_Bomb");
}
 
 
public f_killuser(id)
    user_kill(id,0);
 
stock get_loguser_index()
{
    new loguser[80],name[32]
 
    read_logargv(0,loguser,79)
 
    parse_loguser(loguser,name,31)
 
    return get_user_index(name)
 
}
 
public f_spawned()
{
 
    new id = get_loguser_index();
 
    set_task(5.0,"f_hasbomb",id);
 
}
 
public f_hasbomb(id)
{
 
    if(user_has_weapon(id, CSW_C4))
        return PLUGIN_HANDLED;
    else
    { 
 
        set_task(5.0,"f_killuser",id);
 
    }
 
    return  PLUGIN_HANDLED;
 
}

Try that

Dutchie 01-25-2007 09:39

Re: Drop C4 In Site=kill
 
SCRATCH THAT

Code:

#include <cstrike>
#include <amxmodx>


#define PLUGIN_NAME "New plugin"
#define PLUGIN_VERSION "0.1"
#define PLUGIN_AUTHOR "Name"
 
 
public plugin_init()
{
    register_plugin("C4 Drop","1.0","Alka");
    register_logevent("f_spawned", 3, "2=Spawned_With_The_Bomb");
}
 
 
public f_killuser(id)
    user_kill(id,0);
 
stock get_loguser_index()
{
    new loguser[80],name[32]
 
    read_logargv(0,loguser,79)
 
    parse_loguser(loguser,name,31)
 
    return get_user_index(name)
 
}
 
public f_spawned()
{
 
    new id = get_loguser_index();
 
    set_task(5.0,"f_hasbomb",id);
 
}
 
public f_hasbomb(id)
{
 
    if(user_has_weapon(id, CSW_C4))
        return PLUGIN_HANDLED;
    else
    { 
 
        set_task(5.0,"f_killuser",id);
 
    }
 
    return  PLUGIN_HANDLED;
 
}


Alka 01-25-2007 09:48

Re: Drop C4 In Site=kill
 
Last one is not working.. ERROR "/home/groups/amxmodx/compiler3/include/cstrike.inc(13) : error 017: undefined symbol "AMXX_VERSION_NUM"
" But you modify nothing :|....enyone else..

dutchmeat 01-25-2007 10:37

Re: Drop C4 In Site=kill
 
This plugin doesn't kill anyone, because it checks who spawned with the bomb, and if they didn't have the bomb, they get killed...
Which is nonsense, because you get the id of the one who got spawned with the bomb, so he ALWAYS have the bomb...
You should think of something else

Alka 01-25-2007 12:56

Re: Drop C4 In Site=kill
 
oooo sorry..:| my bad! but u can help me to do this plugin! If someone drop the C4 on Bombsite he will be slayd?!Btw thanks :)

Dutchie 01-25-2007 16:36

Re: Drop C4 In Site=kill
 
Eh, I modified alot of things... Jesus, you forgot the #include <cstrike> you didn't have enough spaces I fixed that, there was 4 spelling errors.. Don't tell me I didnt modify anything..


All times are GMT -4. The time now is 22:24.

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