Raised This Month: $ Target: $400
 0% 

Please Help...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
can1357
Junior Member
Join Date: Apr 2011
Old 06-22-2011 , 02:52   Please Help...
Reply With Quote #1

I have a random weapon giver.
Code:
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>

#define PLUGIN "Rastgele Deagle Gelme"
#define VERSION "1.0"
#define AUTHOR "Optimist ( LockdowN )"
#define chance(%1) ( %1 > random(100) )  


public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("HLTV""FwdRoundStart""a")
}

public 
FwdRoundStart()
{
    if(
random(100) > 49)
    {
        new 
players[32], num
        get_players
(playersnum"ach")
        
        new 
id players[random(num)]
        
give_item(id"weapon_m4a1")
    
cs_set_user_bpammo(id,CSW_M4A1,555
        
give_item(id"weapon_mp5navy")
    
give_item(id"weapon_deagle")
    
cs_set_user_bpammo(id,CSW_MP5NAVY,555)  
    
cs_set_user_bpammo(id,CSW_DEAGLE,555)
    }

in round start script will give one person weapon
but it not
and how can i give weapons only T persons

PLEASE HELP ME SORY FOR MY BAD ENGLİSH
can1357 is offline
DarkGL
Senior Member
Join Date: Aug 2010
Location: Warsaw, Poland
Old 06-22-2011 , 12:11   Re: Please Help...
Reply With Quote #2

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

#define PLUGIN "Rastgele Deagle Gelme"
#define VERSION "1.0"
#define AUTHOR "Optimist ( LockdowN )" 


public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_logevent("Poczatek_Rundy", 2, "1=Round_Start") 
}

public Poczatek_Rundy()
{
	new players[32], num
	get_players(players, num, "ac")
	
	new id = players[random(num)]
	
	if(!is_user_alive(id)){
		return PLUGIN_CONTINUE;
	}
	
	give_item(id, "weapon_m4a1")
	give_item(id, "weapon_mp5navy")
	give_item(id, "weapon_deagle")
	cs_set_user_bpammo(id,CSW_M4A1,555) 
	cs_set_user_bpammo(id,CSW_MP5NAVY,555)  
	cs_set_user_bpammo(id,CSW_DEAGLE,555)
	
	return PLUGIN_CONTINUE;
}
DarkGL is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 06-22-2011 , 12:16   Re: Please Help...
Reply With Quote #3

@DarkGl: You don't have to check if he is alive because the "a" flag with get_players() only returns alive players.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
DarkGL
Senior Member
Join Date: Aug 2010
Location: Warsaw, Poland
Old 06-23-2011 , 02:27   Re: Please Help...
Reply With Quote #4

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

#define PLUGIN "Rastgele Deagle Gelme"
#define VERSION "1.0"
#define AUTHOR "Optimist ( LockdowN )" 


public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_logevent("Poczatek_Rundy", 2, "1=Round_Start") 
}

public Poczatek_Rundy()
{
	new players[32], num
	get_players(players, num, "ac")
	
	new id = players[random(num)]
	
	give_item(id, "weapon_m4a1")
	give_item(id, "weapon_mp5navy")
	give_item(id, "weapon_deagle")
	cs_set_user_bpammo(id,CSW_M4A1,555) 
	cs_set_user_bpammo(id,CSW_MP5NAVY,555)  
	cs_set_user_bpammo(id,CSW_DEAGLE,555)
	
	return PLUGIN_CONTINUE;
}
DarkGL is offline
can1357
Junior Member
Join Date: Apr 2011
Old 07-12-2011 , 10:10   Re: Please Help...
Reply With Quote #5

thanks
can1357 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 23:33.


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