Raised This Month: $ Target: $400
 0% 

Weapon chance HELP


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
falken208
Junior Member
Join Date: Jul 2007
Old 06-14-2009 , 08:52   Weapon chance HELP
Reply With Quote #1

Hi, can someone fix this plugin? I only fail :#(
http://data.fuskbugg.se/skalman01/wc.sma
falken208 is offline
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 06-14-2009 , 09:00   Re: Weapon chance HELP
Reply With Quote #2

I don't know that this works, but it compiles

PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <engine>
#include <cstrike>
#define Plugin "Weapon Chance"
#define Version "1.2"
#define Author "Limpan"
#define TIME_TO_WAIT 10.0
new gMsg_SayText
public plugin_init()
{
    
register_plugin(PluginVersionAuthor)
    
register_logevent("round_start"2"1=Round_Start")
    
gMsg_SayText get_user_msgid("SayText")  
}
stock print_green(id,const fmt[],{Float,_}:...) {
    if(
id && !is_user_connected(id)) return 0
    
static buffer[192]
    
buffer[0] = '^x04'
    
vformat(buffer[1],190fmt,3)
    
    
message_begin(id MSG_ONE MSG_ALL,gMsg_SayText,{0,0,0},id)
    
write_byte(id)
    
write_string(buffer)
    
message_end()
    
    return 
1
}
public 
main_func() {
    
    new 
players[32], num
    get_players
(playersnum)
    
    new 
player
    
    
for ( new num i++ ) {
        
        
player players[i]
        
        new 
CsTeams:team cs_get_user_team(player);
        
 if(
random_num(0100) <= 10)      
 {
 if( 
team == CS_TEAM_T 
 {      
 
give_item(player"weapon_hegrenade");
 
print_green(player"team-pokEmon.kz> Lucky you.. you got a HE (10%% chance)")
 }  
 if(
random_num(0100) <= 4)
 {
 
give_item(player"weapon_deagle");
 
 new 
weapon_id find_ent_by_owner(-1"weapon_deagle"player);
 
 
cs_set_weapon_ammo(weapon_id1);
 
print_green(player"team-pokEmon.kz> Lucky you.. you got a deagle (4%% chance)")      
 }
 if(
random_num(0100) <= 4
 {
 
give_item(player"weapon_glock18");
 new 
weapon_id find_ent_by_owner(-1"weapon_gock18"player);
 
cs_set_weapon_ammo(weapon_id3);
 
print_green(player"team-pokEmon.kz> Lucky you.. you got a glock (4%% chance)")     
 } 
        if(
random_num(0100) <= 4)
        {
            
give_item(player"weapon_usp");
            new 
weapon_id find_ent_by_owner(-1"weapon_usp"player);
            
cs_set_weapon_ammo(weapon_id1);
            
print_green(player"team-pokEmon.kz> Lucky you.. you got a usp (4%% chance)")      
        } 
 if(
random_num(0100) <= 5)
 {
 
set_user_health(playerget_user_armor(player) + 100);
 
print_green(player"team-pokEmon.kz> Lucky you.. you got a 100 HP Armorpack (5%% chance)")
 }
        if(
random_num(0100) <= 50)
        {
            
set_user_health(playerget_user_armor(player) + 10);
            
print_green(player"team-pokEmon.kz> Lucky you.. you got a 10 HP Armorpack (50%% chance)")
        }
 if(
random_num(0100) <= 4)
        {
            
give_item(player"weapon_fiveseven");
            new 
weapon_id find_ent_by_owner(-1"weapon_fiveseven"player);
            
cs_set_weapon_ammo(weapon_id2);
            
print_green(player"team-pokEmon.kz> Lucky you.. you got a 5-7 (4%% chance)")      
        } 
 if(
random_num(0100) <= 100)
 {
 if( 
team == CS_TEAM_T ) {       
 
give_item(player"weapon_knife");
 
print_green(player"team-pokEmon.kz> Lucky you.. you got a KNIFE! Dont say anything to someone :) (1%% chance)")
 } 
 if(
random_num(0100) <= 10)
 {
 
give_item(player"weapon_scout");
 new 
weapon_id find_ent_by_owner(-1"weapon_scout"player);
 
cs_set_weapon_ammo(weapon_id0);
 
print_green(player"team-pokEmon.kz> Lucky you.. you got a Scout to run faster (10%% chance)")
 }
        if(
random_num(0100) <= 4)
        {
            
set_user_health(playerget_user_health(player) + 50);
            
print_green(player"team-pokEmon.kz> Lucky you.. you got a 50 HP Healthpack (4%% chance)")
        }
        if(
random_num(0100) <= 8)
        {
            
set_user_health(playerget_user_health(player) + 10);
            
print_green(player"team-pokEmon.kz> Lucky you.. you got a 10 HP Healthpack (8%% chance)")
        }
        if(
random_num(0100) <= 6)
        {
            
set_user_health(playerget_user_health(player) + 20);
            
print_green(player"team-pokEmon.kz> Lucky you.. you got a 20 HP Healthpack (6%% chance)")         
            
        }
        if(
random_num(0100) <= 2)
        {      
            if( 
team == CS_TEAM_CT ) {      
                
set_user_footsteps(player1)
                
print_green(player"team-pokEmon.kz> Lucky you.. you got no footsteps (2%% chance)")               
        }
    }
   }
  }
 }

__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
falken208
Junior Member
Join Date: Jul 2007
Old 06-14-2009 , 10:00   Re: Weapon chance HELP
Reply With Quote #3

Quote:
Originally Posted by crazyeffect View Post
I don't know that this works, but it compiles
dont work
falken208 is offline
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 06-14-2009 , 10:05   Re: Weapon chance HELP
Reply With Quote #4

Ok

I just did a try
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 06-14-2009 , 10:10   Re: Weapon chance HELP
Reply With Quote #5

Search for exolents weapon chance plugin.
__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath is offline
falken208
Junior Member
Join Date: Jul 2007
Old 06-14-2009 , 10:39   Re: Weapon chance HELP
Reply With Quote #6

Quote:
Originally Posted by Xellath View Post
Search for exolents weapon chance plugin.
I dont like hims
falken208 is offline
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 06-15-2009 , 06:46   Re: Weapon chance HELP
Reply With Quote #7

Then just do a function that is called every round, do random_num, give em items. Done.

PHP Code:
#include <amxmodx>
#include <fun>
 
#define PLUGIN "Weapon Chance"
#define AUTHOR "Xellath"
#define VERSION "0.1"
 
new gMaxPlayers;
 
public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
 
    
register_event("HLTV""eventRoundStart""a""1=0""2=0");
 
    
gMaxPlayers get_maxplayers();
}
 
public 
eventRoundStart()
{
    
set_task(1.0"weapon_chance");
}
 
public 
weapon_chance()
{
    for(new 
id 1id <= gMaxPlayersid++)
    {
        if(
is_user_connected(id) && is_user_alive(id))
        {
            if(
random_num(0100) <= 25)
            {
                
give_item(id"weapon_hegrenade");
                
client_print(idprint_chat"You got a HE! (25%% chance)");
            }
        }    
    }

__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath is offline
falken208
Junior Member
Join Date: Jul 2007
Old 06-15-2009 , 09:12   Re: Weapon chance HELP
Reply With Quote #8

Quote:
Originally Posted by Xellath View Post
Then just do a function that is called every round, do random_num, give em items. Done.

PHP Code:
#include <amxmodx>
#include <fun>
 
#define PLUGIN "Weapon Chance"
#define AUTHOR "Xellath"
#define VERSION "0.1"
 
new gMaxPlayers;
 
public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
 
    
register_event("HLTV""eventRoundStart""a""1=0""2=0");
 
    
gMaxPlayers get_maxplayers();
}
 
public 
eventRoundStart()
{
    
set_task(1.0"weapon_chance");
}
 
public 
weapon_chance()
{
    for(new 
id 1id <= gMaxPlayersid++)
    {
        if(
is_user_connected(id) && is_user_alive(id))
        {
            if(
random_num(0100) <= 25)
            {
                
give_item(id"weapon_hegrenade");
                
client_print(idprint_chat"You got a HE! (25%% chance)");
            }
        }    
    }


How to add a deagle there?
falken208 is offline
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 06-15-2009 , 10:27   Re: Weapon chance HELP
Reply With Quote #9

PHP Code:
give_item(id"weapon_deagle"); 
__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath 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:05.


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