AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   HE Chance (https://forums.alliedmods.net/showthread.php?t=105957)

Redfalcon 10-10-2009 07:18

HE Chance
 
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)

SnoW 10-10-2009 07:23

Re: HE Chance
 
This is one of the tens of threads you can search from http://forums.alliedmods.net/showthread.php?t=73576.

Redfalcon 10-10-2009 07:25

Re: HE Chance
 
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.

SnoW 10-10-2009 07:26

Re: HE Chance
 
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.

alan_el_more 10-10-2009 07:28

Re: HE Chance
 
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



Redfalcon 10-10-2009 07:43

Re: HE Chance
 
Ty alan_el_more i will try this one :D

It compiled!

vitorrd 10-10-2009 09:01

Re: HE Chance
 
Quote:

Originally Posted by alan_el_more (Post 957487)
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!

Redfalcon 10-10-2009 09:18

Re: HE Chance
 
I am learin to script vitorrd


All times are GMT -4. The time now is 22:36.

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