AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Need Help With code (https://forums.alliedmods.net/showthread.php?t=229393)

asdfdsdf 11-06-2013 19:19

Need Help With code
 
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")
    }



bat 11-24-2013 05:35

Re: Need Help With code
 
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")
    }
}


ConnorMcLeod 11-24-2013 05:42

Re: Need Help With code
 
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


All times are GMT -4. The time now is 23:17.

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