Raised This Month: $ Target: $400
 0% 

weapon drop plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ch3cker
Veteran Member
Join Date: Jun 2005
Location: Deutschland / Baden-Würt
Old 09-10-2005 , 10:37   weapon drop plugin
Reply With Quote #1

can zou help me with this plugin ??
on my computer it`s working but on the internet server it`s dont working:

Code:
#include <amxmodx>

public plugin_init() { 
	
	register_plugin("weapon drop","1.0","ch3cker")  
	register_logevent("new_round",2,"0=World triggered","1=Round_Start")
} 

public new_round()
{
    new players[32]
    new inum
    get_players(players,inum)
    for(new i; i <= inum; i++) {
           			new weapon[32]
				new wnum
				get_user_weapons(players[i],weapon,wnum)
				for(new a; a <= wnum; a++) {
				client_cmd(players[i],"%s",weapon[a])
				client_cmd(players[i],"drop")
		return PLUGIN_CONTINUE
   		}
	}
}
normaly it should drop the weapon on the start of a round. Plz help me
__________________
SORRY 4 MY BAD ENGLISH
ch3cker is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 09-10-2005 , 13:13  
Reply With Quote #2

First, let's fix up your indenting:

Code:
public new_round() {     new players[32]     new inum     get_players(players,inum)     for(new i; i <= inum; i++) {         new weapon[32]         new wnum         get_user_weapons(players[i],weapon,wnum)         for(new a; a <= wnum; a++) {             client_cmd(players[i],"%s",weapon[a])             client_cmd(players[i],"drop")             return PLUGIN_CONTINUE         }     } }

First thing's first: Your for() loops shouldn't be checking if i/a is <=, it should simply be <. The reason is that the functions return the number of items starting at 1, but array indexes start at 0, so the max array index is the number of items - 1.

Secondly, you return PLUGIN_CONTINUE, thus stopping the entire function, after the first player's first weapon is dropped. Remove that and it should work.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
ch3cker
Veteran Member
Join Date: Jun 2005
Location: Deutschland / Baden-Würt
Old 09-10-2005 , 13:36  
Reply With Quote #3

ok thx
i will test it
__________________
SORRY 4 MY BAD ENGLISH
ch3cker 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 14:25.


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