Raised This Month: $ Target: $400
 0% 

HE Chance


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Redfalcon
BANNED
Join Date: Sep 2009
Location: Prison Break
Old 10-10-2009 , 07:18   HE Chance
Reply With Quote #1

How can i make a plugin that have 15% to give a HE and a message appear:

Lucky You.... You got a HE! (15% chance)
Redfalcon is offline
Send a message via MSN to Redfalcon
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 10-10-2009 , 07:23   Re: HE Chance
Reply With Quote #2

This is one of the tens of threads you can search from http://forums.alliedmods.net/showthread.php?t=73576.
SnoW is offline
Send a message via MSN to SnoW
Redfalcon
BANNED
Join Date: Sep 2009
Location: Prison Break
Old 10-10-2009 , 07:25   Re: HE Chance
Reply With Quote #3

Yeah but i need a code that give HE 15% chance and a message appear:

Lucky You.... You got a HE! (15% chance)

Only one single code.
Redfalcon is offline
Send a message via MSN to Redfalcon
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 10-10-2009 , 07:26   Re: HE Chance
Reply With Quote #4

You never get anything exact what you want, especially if you are so lazy that you can't copy couple of lines from a bigger code.
SnoW is offline
Send a message via MSN to SnoW
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 10-10-2009 , 07:28   Re: HE Chance
Reply With Quote #5

try this
PHP Code:
#include <amxmodx>
#include <fun>
#include <hamsandwich>

#define PLUGIN "HE Chance"
#define VERSION "1.0"
#define AUTHOR "alan_el_more"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)
}

public 
fw_PlayerSpawn_Post(id)
{
    if(!
is_user_alive(id))
        return 
HAM_IGNORED
        
    
if(random(101) <= 15)
    {
        
client_print(idprint_chat"You got a HE! (15%% chance)")
        
give_item(id"weapon_hegrenade")
    }
    
    return 
HAM_IGNORED

__________________
alan_el_more is offline
Redfalcon
BANNED
Join Date: Sep 2009
Location: Prison Break
Old 10-10-2009 , 07:43   Re: HE Chance
Reply With Quote #6

Ty alan_el_more i will try this one

It compiled!

Last edited by Redfalcon; 10-10-2009 at 07:46.
Redfalcon is offline
Send a message via MSN to Redfalcon
vitorrd
Senior Member
Join Date: Jul 2009
Old 10-10-2009 , 09:01   Re: HE Chance
Reply With Quote #7

Quote:
Originally Posted by alan_el_more View Post
try this
PHP Code:
#include <amxmodx>
#include <fun>
#include <hamsandwich>
 
#define PLUGIN "HE Chance"
#define VERSION "1.0"
#define AUTHOR "alan_el_more"
 
public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
 
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)
}
 
public 
fw_PlayerSpawn_Post(id)
{
    if(!
is_user_alive(id))
        return 
HAM_IGNORED
 
    
if(random(101) <= 15)
    {
        
client_print(idprint_chat"You got a HE! (15%% chance)")
        
give_item(id"weapon_hegrenade")
    }
 
    return 
HAM_IGNORED

Awesome, keep feeding lazy people!
vitorrd is offline
Redfalcon
BANNED
Join Date: Sep 2009
Location: Prison Break
Old 10-10-2009 , 09:18   Re: HE Chance
Reply With Quote #8

I am learin to script vitorrd
Redfalcon is offline
Send a message via MSN to Redfalcon
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 22:36.


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