AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help with Drop-weapon script (https://forums.alliedmods.net/showthread.php?t=8778)

goodtod 12-25-2004 19:03

Help with Drop-weapon script
 
I am writing a simple script for use with CSDM on scoutzknivez. The script should drop the scout whenever the player spawns(not just on a new round). Tell me what I'm doing wrong? :D
Code:

#include <amxmodx>


public plugin_init() {
       
        register_plugin("scoutzknivez drop","0.1","goodman")
        new mapname[33]
        get_mapname(mapname,32)
        if(containi(mapname,"scoutzknivez") > -1 ) { 
                register_event("ResetHUD", "new_spawn", "be")
                }
}

public new_spawn()
{
        client_cmd(0,"drop weapon_scout")
        return PLUGIN_CONTINUE
}

Thanks in advance you guys...

XxAvalanchexX 12-25-2004 22:52

Re: Help with Drop-weapon script
 
Why don't you tell us what the problem is and then maybe we can tell you what you are doing wrong.

doomy 12-25-2004 23:17

Use this:

Code:
client_cmd( 0, "drop" )

instead of this:

Code:
client_cmd(0,"drop weapon_scout")

if you want them to not start out with it u r going to have to use the event CurWeapon and set up som code to tell when its there first time getting their weapon and then drop it. OR you could just use a timer off of ResetHUD and wait like...ooo...half a second; then you could drop it.

goodtod 12-26-2004 00:52

OK, sorry I didn't type the problem before, I thought I did. :lol:

Problem is that it takes like 5 seconds for the scout to be dropped when it needs to be dropped before the CSDM weapon selection comes up.

TIA

XxAvalanchexX 12-26-2004 02:02

I don't think I can help you, but in regards to doomy: "drop weapon_scout" will work just as "drop". However, "drop" only works in dropping the scout if you have it selected; "drop weapon_scout" will drop the scout no matter what weapon you have out.

Freecode 12-26-2004 04:33

this
Code:
public new_spawn() {    client_cmd(0,"drop weapon_scout")    return PLUGIN_CONTINUE }

should be this
Code:
public new_spawn(id) {    client_cmd(id,"drop weapon_scout")    return PLUGIN_CONTINUE }

goodtod 12-26-2004 17:37

Quote:

Originally Posted by Freecode
should be this
Code:
public new_spawn(id) {    client_cmd(id,"drop weapon_scout")    return PLUGIN_CONTINUE }

Hmmm...That just made it stop working.

Peli 12-26-2004 21:47

Here you go :
Code:
#include <amxmodx> public plugin_init() {        register_plugin("scoutzknivez drop","0.1","goodman")    new mapname[33]    get_mapname(mapname,32)    if(containi(mapname,"scoutzknivez") > -1 ) {       register_event("ResetHUD", "new_spawn", "be")       } } public new_spawn(id) {    client_cmd(id,"drop weapon_scout")    return PLUGIN_CONTINUE }


All times are GMT -4. The time now is 19:21.

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