Raised This Month: $ Target: $400
 0% 

[SOLVED] CurrentWep Drop...crashes server.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bwgrubbs1
Senior Member
Join Date: Sep 2006
Old 05-28-2007 , 03:31   [SOLVED] CurrentWep Drop...crashes server.
Reply With Quote #1

OK...I made this plugin, and for some reason my server keeps crashing...

I am new to coding and just learning this stuff......SOOOO

go easy on me...lol

Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#define PLUGIN "GunGlitch"
#define VERSION "1.0"
#define AUTHOR "bwgrubbs1"

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_event("CurWeapon","DROP_IT","b","1=1")
}

public DROP_IT(id)
{
    new wclip, wammo
    new team = get_user_team(id)
    new weapon = get_user_weapon(id, wclip, wammo)
    {
        if(weapon == CSW_USP || weapon == CSW_GLOCK18)
        {
            client_cmd(id, "drop")
            client_print(id, print_chat, "[ Weapons ] You were FORCED to drop your Pistol !")
        }
        if(team == 1 && weapon == CSW_KNIFE)
        {
            strip_user_weapons(id)
            client_print(id, print_chat, "[ Weapons ] You were FORCED to drop your Knife !")
        }
    }
}
The main idea of this plugin is so that if anyone joins the server late...after a few things have already taken place...this is to prevent a glitch with the gun.

Those of you familiar with Hide N Seek know what I am talking about.

Anyone ?
bwgrubbs1 is offline
Old 05-28-2007, 06:01
Lee
This message has been deleted by Lee.
bwgrubbs1
Senior Member
Join Date: Sep 2006
Old 05-28-2007 , 14:01   Re: CurrentWep Drop...crashes server.
Reply With Quote #2

Anyone have any ideas ? PLZ
bwgrubbs1 is offline
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 05-28-2007 , 14:05   Re: CurrentWep Drop...crashes server.
Reply With Quote #3

Try adding the flag e to make sure the player is alive.
PHP Code:
register_event("CurWeapon","DROP_IT","be","1=1"
Or do a set_task in client_putinserver.

PHP Code:
public client_putintserver(id)
{
  
set_task(20.0"DROP_IT"id)

__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
bwgrubbs1
Senior Member
Join Date: Sep 2006
Old 05-28-2007 , 14:28   Re: CurrentWep Drop...crashes server.
Reply With Quote #4

ok, i will test this
bwgrubbs1 is offline
bwgrubbs1
Senior Member
Join Date: Sep 2006
Old 05-28-2007 , 14:37   Re: CurrentWep Drop...crashes server.
Reply With Quote #5

ok i tried both different ideas and each of them together and all three ways seem to crash the server on end of round.
bwgrubbs1 is offline
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 05-28-2007 , 14:52   Re: CurrentWep Drop...crashes server.
Reply With Quote #6

Are you sure that this script is crashing the server?
Because it looks correct...
Maybe try to hook playerspawn(http://forums.alliedmods.net/showthread.php?t=42159)
and strip the weapons when the player spawns...with a little delay (set_task)!?

greetz regalis
__________________
regalis is offline
bwgrubbs1
Senior Member
Join Date: Sep 2006
Old 05-28-2007 , 18:26   Re: CurrentWep Drop...crashes server.
Reply With Quote #7

I like the fact that you say my code looks correct, it makes me feel all warm and fuzzy inside...lol I will check other plugins. Thank you.
bwgrubbs1 is offline
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 05-29-2007 , 11:08   Re: CurrentWep Drop...crashes server.
Reply With Quote #8

try this one
Attached Files
File Type: sma Get Plugin or Get Source (gunglitch.sma - 805 views - 1.4 KB)
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
bwgrubbs1
Senior Member
Join Date: Sep 2006
Old 05-29-2007 , 14:56   Re: CurrentWep Drop...crashes server.
Reply With Quote #9

Perfect man, simply perfect !
bwgrubbs1 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 10:42.


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