Raised This Month: $ Target: $400
 0% 

What's wrong with my code?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
vermillioN25
Member
Join Date: Apr 2009
Location: Brazil
Old 08-07-2009 , 09:44   Re: What's wrong with my code?
Reply With Quote #7

Really thank you guys

Alucard, thank you, but I think there is something wrong. In new round, I don't get m4a1 and either my knife get stripped.

Should I use Ham with Player Spawn + if (get_user_team(i) == 2) ?

//EDIT

I tested it with HamSandWich and it worked
here is the code:

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

#define PLUGIN "JailMod"
#define VERSION "1.0"
#define AUTHOR "elemeNt;"

new g_MaxPlayers

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1)  
    
register_logevent("logevent_round_end"2"1=Round_End")  
    
    
g_MaxPlayers get_maxplayers()
}

public 
fwHamPlayerSpawnPost(iPlayer)
{
    for(new 
i=1i<=g_MaxPlayersi++)
    {
        if(
is_user_alive(i) )
        {
            if (
get_user_team(i) == 2)
            {
            
strip_user_weapons(i)
            
give_item(i,"weapon_m4a1")
            
give_item(i,"ammo_556nato")
            
give_item(i,"ammo_556nato")
            
give_item(i,"ammo_556nato")
            
give_item(i,"weapon_deagle")
            
give_item(i,"ammo_50ae")
            
give_item(i,"ammo_50ae")
            
give_item(i,"ammo_50ae")
            
give_item(i,"ammo_50ae")
            
give_item(i,"ammo_50ae")
            
give_item(i,"ammo_50ae")
            
give_item(i,"ammo_50ae")
            
give_item(i,"weapon_knife")
            
give_item(i,"weapon_hegrenade")
            }
            else
            {
            
strip_user_weapons(i)
            
give_item(i,"weapon_knife")
            }
        }
    } 
    return 
PLUGIN_CONTINUE
}

public 
logevent_round_end()
{
    for(new 
i=1i<=g_MaxPlayersi++)
    {
        if(
is_user_alive(i) )
        {
        
strip_user_weapons (i)
        
give_item(i,"weapon_knife")
        }
    }    

Thanks to alucard and arkshine
__________________

Last edited by vermillioN25; 08-07-2009 at 10:10. Reason: code worked
vermillioN25 is offline
 



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 18:24.


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