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

Need some help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
<FiH> zero
Member
Join Date: Oct 2009
Old 03-24-2013 , 23:15   Need some help
Reply With Quote #1

So the war3source.com website is EXTREMELY INACTIVE. So I am going to come here for help. I have compiled a bunch of old aces successfully because I want to use them for my w3s CS:GO server. I am having difficultly installing them. Does anyone know the proper steps to installing a race?

Thanks

source:
Code:
/**
* File: War3Source_Agent.sp
* Description: The Agent race for SourceCraft.
* Author(s): xDr.HaaaaaaaXx
*/

#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <sdktools_stocks>
#include <sdktools_functions>
#include <haaaxfunctions>

#include "W3SIncs/War3Source_Interface"

// War3Source stuff
new thisRaceID, SKILL_SPEED, SKILL_VISIB, SKILL_MOLE, ULT_AWP;

new Float:DamageMultiplier[5] = { 0.0, 0.16, 0.19, 0.21, 0.24 };
new Float:MoleChance[5] = { 0.0, 0.04, 0.07, 0.11, 0.15 };
new Float:AgentSpeed[5] = { 1.0, 1.1, 1.2, 1.3, 1.4 };
new Float:UltDuration[5] = { 0.0, 10.0, 15.0, 20.0, 25.0 };

new String:Spawn[] = "doors/heavy_metal_stop1.wav";
new String:sOldModel[MAXPLAYERS][256];

new OriginOffset;

new HaloSprite, BeamSprite, GlowSprite;

public Plugin:myinfo = 
{
    name = "War3Source Race - Agent",
    author = "xDr.HaaaaaaaXx",
    description = "The Agent race for War3Source.",
    version = "1.0.0.0",
    url = ""
};

public OnPluginStart()
{
    OriginOffset = FindSendPropOffs( "CBaseEntity", "m_vecOrigin" );
}

public OnMapStart()
{
    HaloSprite = PrecacheModel( "materials/sprites/halo01.vmt" );
    BeamSprite = PrecacheModel( "sprites/tp_beam001.vmt" );
    GlowSprite = PrecacheModel( "materials/sprites/640_pain.vmt" );
    War3_PrecacheSound( Spawn );
}

public OnWar3PluginReady()
{
    thisRaceID = War3_CreateNewRace( "Agent", "agent" );
    
    SKILL_SPEED = War3_AddRaceSkill( thisRaceID, "High Speed", "Run Fast", false );    
    SKILL_VISIB = War3_AddRaceSkill( thisRaceID, "Shades of Visibility", "Invisible players apear when hit", false );    
    SKILL_MOLE = War3_AddRaceSkill( thisRaceID, "Double Agent", "Disguies your self as an enemy Spy", false );
    ULT_AWP = War3_AddRaceSkill( thisRaceID, "Ultimate Artillery", "Switch From M4a1 to Awp!", true );

    War3_CreateRaceEnd( thisRaceID );
}

public InitPassiveSkills( client )
{
    if( War3_GetRace( client ) == thisRaceID )
    {
        War3_SetBuff( client, fMaxSpeed, thisRaceID, AgentSpeed[War3_GetSkillLevel( client, thisRaceID, SKILL_SPEED )] );
    }
}

public OnRaceChanged( client, oldrace, newrace )
{
    if( newrace != thisRaceID )
    {
        W3ResetAllBuffRace( client, thisRaceID );
    }
    else
    {
        if( IsPlayerAlive( client ) )
        {
            InitPassiveSkills( client );
            StripWeaponFromClient( client );
            GivePlayerItem( client, "weapon_m4a1" );
            GivePlayerItem( client, "weapon_deagle" );
            GivePlayerItem( client, "weapon_knife" );
        }
    }
}

public OnSkillLevelChanged( client, race, skill, newskilllevel )
{
    InitPassiveSkills( client );
}

public OnWar3EventSpawn( client )
{
    new race = War3_GetRace( client );
    if( race == thisRaceID )
    {
        InitPassiveSkills( client );
        new skill_level = War3_GetSkillLevel( client, thisRaceID, SKILL_MOLE );
        if( GetRandomFloat( 0.0, 1.0 ) <= MoleChance[skill_level])
        {
            StartMole( client );
        }
        EmitSoundToAll( Spawn, client );
        StripWeaponFromClient( client );
        GivePlayerItem( client, "weapon_m4a1" );
        GivePlayerItem( client, "weapon_deagle" );
        GivePlayerItem( client, "weapon_knife" );
    }
}

public OnWar3EventDeath( victim, attacker )
{
    W3ResetAllBuffRace( victim, thisRaceID );
}

public OnWar3EventPostHurt( victim, attacker, damage )
{
    if( W3GetDamageIsBullet() && ValidPlayer( victim, true ) && ValidPlayer( attacker, true ) && GetClientTeam( victim ) != GetClientTeam( attacker ) )
    {
        if( War3_GetRace( attacker ) == thisRaceID )
        {
            new skill_dmg = War3_GetSkillLevel( attacker, thisRaceID, SKILL_VISIB );
            if( !Hexed( attacker, false ) && skill_dmg > 0 && GetRandomFloat( 0.0, 1.0 ) <= 0.15 )
            {
                new String:wpnstr[32];
                GetClientWeapon( attacker, wpnstr, 32 );
                if( !StrEqual( wpnstr, "weapon_knife" ) )
                {
                    War3_DealDamage( victim, RoundToFloor( damage * DamageMultiplier[skill_dmg] ), attacker, DMG_BULLET, "agent_crit" );
                    W3ResetBuffRace( victim, fInvisibilitySkill, War3_GetRace( victim ) );
                
                    W3PrintSkillDmgHintConsole( victim, attacker, War3_GetWar3DamageDealt(), SKILL_VISIB);
                    
                    W3FlashScreen( victim, RGBA_COLOR_RED );
                    
                    new Float:victim_pos[3];
                    new Float:attacker_pos[3];
                    
                    GetClientAbsOrigin( victim, victim_pos );
                    GetClientAbsOrigin( attacker, attacker_pos );
                    
                    victim_pos[2] += 40;
                    attacker_pos[2] += 40;
                    
                    TE_SetupBeamPoints( attacker_pos, victim_pos, BeamSprite, HaloSprite, 0, 0, 3.0, 6.0, 12.0, 0, 0.0, { 155, 155, 155, 255 }, 0 );
                    TE_SendToAll();
                }
            }
        }
    }
}

public OnUltimateCommand( client, race, bool:pressed )
{
    if( race == thisRaceID && pressed && ValidPlayer( client, true ) )
    {
        new ult_level = War3_GetSkillLevel( client, race, ULT_AWP );
        if( ult_level > 0 )
        {
            if( War3_SkillNotInCooldown( client, thisRaceID, ULT_AWP, true ) )
            {
                StripWeaponFromClient( client );
                GivePlayerItem( client, "weapon_awp" );
                GivePlayerItem( client, "weapon_deagle" );
                GivePlayerItem( client, "weapon_knife" );
                
                new Float:pos[3];
                
                GetClientAbsOrigin( client, pos );
                
                pos[2] += 50;
                
                TE_SetupGlowSprite( pos, GlowSprite, 2.0, 2.0, 255 );
                TE_SendToAll();
                
                CreateTimer( UltDuration[ult_level], GiveWeapon, client );
                
                War3_CooldownMGR( client, UltDuration[ult_level] + 5.0, thisRaceID, ULT_AWP, true,true );
            }
        }
        else
        {
            PrintHintText( client, "Level Your Ultimate First" );
        }
    }
}

public Action:GiveWeapon( Handle:timer, any:client )
{
    if( ValidPlayer( client, true ) )
    {
        StripWeaponFromClient( client );
        GivePlayerItem( client, "weapon_m4a1" );
        GivePlayerItem( client, "weapon_deagle" );
        GivePlayerItem( client, "weapon_knife" );
    }
}

public StartMole( client )
{
    new Float:mole_time = 5.0;
    W3MsgMoleIn( client, mole_time );
    CreateTimer( 0.2 + mole_time, DoMole, client );
}

public Action:DoMole( Handle:timer, any:client )
{
    if( ValidPlayer( client, true ) )
    {
        new team = GetClientTeam( client );
        new searchteam = ( team == 2 )?3:2;
        
        new Float:emptyspawnlist[100][3];
        new availablelocs = 0;
        
        new Float:playerloc[3];
        new Float:spawnloc[3];
        new ent = -1;
        while( ( ent = FindEntityByClassname( ent, ( searchteam == 2 )?"info_player_terrorist":"info_player_counterterrorist" ) ) != -1 )
        {
            if( !IsValidEdict( ent ) ) continue;
            GetEntDataVector( ent, OriginOffset, spawnloc );
            
            new bool:is_conflict = false;
            for( new i = 1; i <= MaxClients; i++ )
            {
                if( ValidPlayer( i, true ) )
                {
                    GetClientAbsOrigin( i, playerloc );
                    if( GetVectorDistance( spawnloc, playerloc ) < 60.0 )
                    {
                        is_conflict = true;
                        break;
                    }                
                }
            }
            if( !is_conflict )
            {
                emptyspawnlist[availablelocs][0] = spawnloc[0];
                emptyspawnlist[availablelocs][1] = spawnloc[1];
                emptyspawnlist[availablelocs][2] = spawnloc[2];
                availablelocs++;
            }
        }
        if( availablelocs == 0 )
        {
            War3_ChatMessage( client, "%T", "No suitable location found, can not mole!", client );
            return;
        }
        GetClientModel( client, sOldModel[client], 256 );
        SetEntityModel( client, ( searchteam == 2 )?"models/player/t_leet.mdl":"models/player/ct_urban.mdl" );
        TeleportEntity( client, emptyspawnlist[GetRandomInt( 0, availablelocs - 1 )], NULL_VECTOR, NULL_VECTOR );
        W3MsgMoled( client );
        War3_ShakeScreen( client, 1.0, 20.0, 12.0 );
        CreateTimer( 10.0, ResetModel, client );
    }
    return;
}

public Action:ResetModel( Handle:timer, any:client )
{
    if( ValidPlayer( client, true ) )
    {
        SetEntityModel( client, sOldModel[client] );
        W3MsgNoLongerDisguised( client );
    }
}

Last edited by <FiH> zero; 04-01-2013 at 17:36.
<FiH> zero is offline
Sreaper
髪を用心
Join Date: Nov 2009
Old 03-24-2013 , 23:33   Re: Need some help
Reply With Quote #2

Yes, some good tutorials can be found on this page.

Last edited by Sreaper; 03-24-2013 at 23:36.
Sreaper is offline
Dr_Knuckles
AlliedModders Donor
Join Date: Mar 2005
Location: SW Florida
Old 03-26-2013 , 19:41   Re: Need some help
Reply With Quote #3

If the races are compiled just drop them in the plugins folder, restart server, boom.
__________________
Dr_Knuckles is offline
<FiH> zero
Member
Join Date: Oct 2009
Old 03-26-2013 , 22:21   Re: Need some help
Reply With Quote #4

Quote:
Originally Posted by Dr_Knuckles View Post
If the races are compiled just drop them in the plugins folder, restart server, boom.

I do not need to change any configs?
<FiH> zero is offline
Sakretsos
Member
Join Date: Feb 2013
Old 03-27-2013 , 02:35   Re: Need some help
Reply With Quote #5

Quote:
Originally Posted by <FiH> zero View Post
I do not need to change any configs?
depent of your plugin that you want to add.. , when you download a plugin .. the creator also .. share the script command files ( configs ) also you can check out to your server on "cfg/sourcemod/" there you can bring all the sourcemod config files ! ;)
__________________

Hellenic SF Gameservers To Do List
Sakretsos is offline
Dr_Knuckles
AlliedModders Donor
Join Date: Mar 2005
Location: SW Florida
Old 03-27-2013 , 15:08   Re: Need some help
Reply With Quote #6

What I said above is all you have to do. Assuming the race works right with the game(for example a css specific race may not work properly on a tf2 server and vice versa) it will be available to play after a server restart. Map change probably won't cut it, an actual reboot.

That being said there are some cvars for each race to add to war3source.cfg or wherever you like to put your war3source cvars. If you go into console and type:

cvarlist war3 (mostly war3source stuff)

and also

war3 cvarlist (mostly race options)

each of the above 2 commands will bring up a list of different commands you can use to customize your war3source. You don't really HAVE to change any of that stuff though, if the race works it works. Of course if the race calls for certain models/sounds/sprites/materials etc... and you don't have them it might not work right.

Definitely do NOT add more than 1 race at a time if you don't want to take a chance at screwing things up. Some of those custom races are garbage and will "break" your server.
__________________
Dr_Knuckles is offline
<FiH> zero
Member
Join Date: Oct 2009
Old 03-28-2013 , 15:31   Re: Need some help
Reply With Quote #7

I added a race into the server and it didn't show up. It didn't break my server either.
<FiH> zero is offline
Dr_Knuckles
AlliedModders Donor
Join Date: Mar 2005
Location: SW Florida
Old 03-28-2013 , 16:10   Re: Need some help
Reply With Quote #8

Sometimes I try out a new race and end up with people running around as error messages, it's really bizarre.

After you put the race plugin in your plugins folder did you check to see if the plugin was running?
__________________
Dr_Knuckles is offline
<FiH> zero
Member
Join Date: Oct 2009
Old 03-28-2013 , 21:38   Re: Need some help
Reply With Quote #9

I am not getting errors, but I can't find the race on the changerace list. How do I check if it is running?
<FiH> zero is offline
Dr_Knuckles
AlliedModders Donor
Join Date: Mar 2005
Location: SW Florida
Old 03-29-2013 , 15:51   Re: Need some help
Reply With Quote #10

Check your plugin list. If you have access to the server console type:

sm plugins list

and see if that race's plugin is running. It's probably a bad load. If you don't have access to the server console use rcon.
__________________
Dr_Knuckles 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 03:47.


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