Raised This Month: $51 Target: $400
 12% 

Need Help With code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
asdfdsdf
AlliedModders Donor
Join Date: Aug 2010
Location: Belgium
Old 11-06-2013 , 19:19   Need Help With code
Reply With Quote #1

Hello i need some help with a a plugin its a boxing day for my jailbreak server but the problem is it doesnt have any models im noob in coding i just want to have so the Terrorists have boxing models when box day is started if someone can help me grtz

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

#define PLUGIN "Day: Box"
#define VERSION "1.0"
#define AUTHOR "asdfdsdf"

forward jailbreak_day_start(dayid)
forward jailbreak_day_end()
native jailbreak_day_add(name[32], description[200], blockgunsweaponsurvivorblockdamage)


public 
plugin_precache( ) 
{    
    
precache_model("models/boxing_mod/v_box_red.mdl" )          
}

new 
intDayintMaxplayers

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Add: Day
    
intDay jailbreak_day_add("Box Day""Terrorists needs to kill each other, surviver wins"1011)
    
    
// Others
    
intMaxplayers get_maxplayers()
}
public 
jailbreak_day_start(dayid)
{
    if(
dayid == intDay)
    {
        for(new 
1<= intMaxplayersi++)
        {
            if(
is_user_alive(i))
            {
                if(
cs_get_user_team(i) == CS_TEAM_T)
                {
                    
strip_user_weapons(i)
                    
give_item(i"weapon_knife")
                    
cs_set_user_model(i"boxing_mod")
                    
set_user_health(i400)
                }
            }
        }        
        
server_cmd("mp_friendlyfire 1")
    }

asdfdsdf is offline
bat
Veteran Member
Join Date: Jul 2012
Old 11-24-2013 , 05:35   Re: Need Help With code
Reply With Quote #2

Test it...

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

#define PLUGIN "Day: Box" 
#define VERSION "1.0" 
#define AUTHOR "asdfdsdf" 

forward jailbreak_day_start(dayid) 
forward jailbreak_day_end() 
native jailbreak_day_add(name[32], description[200], blockguns, weapon, survivor, blockdamage) 


public plugin_precache( )  
{     
    precache_model("models/boxing_mod/v_box_red.mdl")   
    precache_model("models/player/boxing_models/boxing_models.mdl")
} 

new intDay, intMaxplayers 

public plugin_init()  
{ 
    register_plugin(PLUGIN, VERSION, AUTHOR) 
     
    // Add: Day 
    intDay = jailbreak_day_add("Box Day", "Terrorists needs to kill each other, surviver wins", 1, 0, 1, 1) 
     
    // Others 
    intMaxplayers = get_maxplayers() 
} 
public jailbreak_day_start(dayid) 
{ 
    if(dayid == intDay) 
    { 
        for(new i = 1; i <= intMaxplayers; i++) 
        { 
            if(is_user_alive(i)) 
            { 
                if(cs_get_user_team(i) == CS_TEAM_T) 
                { 
                    strip_user_weapons(i) 
                    give_item(i, "weapon_knife") 
                    cs_set_user_model(i, "boxing_models")
                    set_user_health(i, 400) 
                } 
            } 
        }         
        server_cmd("mp_friendlyfire 1") 
    } 
}

Last edited by bat; 11-24-2013 at 05:35.
bat is offline
Send a message via Skype™ to bat
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-24-2013 , 05:42   Re: Need Help With code
Reply With Quote #3

Edit ("Go Advanced" button) your title to something descriptive, everybody needs help with code.

And please take some time to read rules : https://forums.alliedmods.net/misc.php?do=showrules
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 11-24-2013 at 05:42.
ConnorMcLeod 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 17:20.


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