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

Solved [CSGO] wc3 changerace menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Yevorz
Junior Member
Join Date: Sep 2016
Old 09-27-2016 , 02:28   [CSGO] wc3 changerace menu
Reply With Quote #1

I removed most races from wc3 except the first 3 and added my own as a test (learning here) when i load the server and join game theres no changerace menu and you are auto set on Undead scourge.

On server launch only relevant error is

L 09/27/2016 - 01:17:14: [SM] Failed to load plugin "w3s\WCX_Engine_Display.smx":

When I compiled my race I got the error

// War3Source_003_BruteBruce.SP(42) : warning 217: loose indentation

but it still compiled so i figured no big deal.

Heres the WCX_Engine_Display.smx
Code:
#include <sourcemod>
#include "W3SIncs/War3Source_Interface"

public Plugin:myinfo = 
{
    name = "War3Source - Warcraft Extended - RPG Text Display",
    author = "War3Source Team",
    description="Generic text display"
};

new Handle:g_hCvarEnable = INVALID_HANDLE;
new Handle:g_hHudSynchronizer = INVALID_HANDLE;

new String:hintstring[4096];

public LoadCheck()
{
    // Revan: keyhinttext works with CS:GO but weird symbols will be displayed
    g_hCvarEnable = CreateConVar("War3_RightTextDisp",(War3_GetGame() == Game_CSGO) ? "0" : "1", "Enables the right-hand text display of war3source information",_,true,0.0,true,1.0);
    g_hHudSynchronizer = CreateHudSynchronizer();
    if(g_hHudSynchronizer == INVALID_HANDLE && GameCSANY()) {
        //SetFailState("This game does not support Hud Synchronizers or KeyHintText.");
        PrintToServer("[W3XDisplay] This game does not support Hud Synchronizers or KeyHintText.");
        return false;
    }
    return true;
}

public OnPluginStart()
{
    // Revan: keyhinttext works with CS:GO but weird symbols will be displayed
    g_hCvarEnable = CreateConVar("War3_RightTextDisp",(War3_GetGame() == Game_CSGO) ? "0" : "1", "Enables the right-hand text display of war3source information",_,true,0.0,true,1.0);
    g_hHudSynchronizer = CreateHudSynchronizer();
    if(g_hHudSynchronizer == INVALID_HANDLE && GameCSANY()) {
        SetFailState("This game does not support Hud Synchronizers or KeyHintText.");
    }
    RegAdminCmd("sm_display", SetHint, ADMFLAG_ROOT, "Sets the hintstring");
}

public OnMapStart()
{
    CreateTimer(1.0,Print_Level,_,TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
}

public Action:Print_Level(Handle:timer, any:data)
{
    if(GetConVarBool(g_hCvarEnable) == false) {
        // destroy timer
        return Plugin_Handled;
    }
    for(new i;i<MAXPLAYERS;i++)
    {
        if(ValidPlayer(i,true))
        {
            if(GameCSANY())
            {
                War3_KeyHintText(i, hintstring);
            } else {
                SetHudTextParams(1.0, -1.0, 1.5, 255, 255 ,255, 255);
                ShowSyncHudText(i, g_hHudSynchronizer, hintstring);
            }
        }
    }
    return Plugin_Continue;
}

public Action:SetHint(client, args)
{
    if(GetConVarBool(g_hCvarEnable) == false) {
        return Plugin_Continue;
    }
    new String:buffer[64];
    new String:buffer2[4096];
    for(new i = 1;i<=args;i++)
    {
        GetCmdArg(i,buffer, sizeof(buffer));
        Format(buffer2,sizeof(buffer2),"%s \n %s",buffer2,buffer);
    }
    strcopy(hintstring,sizeof(hintstring),buffer2);
    return Plugin_Handled;
}

/*
public Action:Print_Level(Handle:timer,any:data)
{
    for(new i;i<MAXPLAYERS;i++)
    {
        if(ValidPlayer(i,true))
        {
            new race = War3_GetRace(i);
            if(race==0)
            {
                return;
            }
            new racelevel = War3_GetLevel(i, race);
            decl String:racename[64];
            War3_GetRaceName(race,racename,sizeof(racename));
            
            new level;
            new SkillCount = War3_GetRaceSkillCount(race);
            decl String:str[1000];
            decl String:skill[64];
            decl String:skilldesc[128];
            new String:selectioninfo[32];
            for(new x=1;x<=SkillCount;x++)
            {
                W3GetRaceSkillName(race,x,skill,sizeof(skill));
                level=War3_GetSkillLevel(i,race,x) ;
                
                if(War3_IsSkillUltimate(race,x))
                {
                    Format(str,sizeof(str),"Ultimate: %s (LVL %i/%i)",skill,level,W3GetRaceSkillMaxLevel(race,x));
                }
                else
                {
                    Format(str,sizeof(str),"%s (LVL %i/%i)",skill,level,W3GetRaceSkillMaxLevel(race,x));
                }
                
                Format(selectioninfo,sizeof(selectioninfo),"%d,skill,%d",race,x);
                
                
                if(SkillCount==x){
                    
                    W3GetRaceSkillDesc(race,x,skilldesc,sizeof(skilldesc)) ;
                    
                    Format(str,sizeof(str),"%s \n%s \n",str,skilldesc);
                }
                
                if(x==War3_GetRaceSkillCount(race)&&SkillCount==x){
                    Format(str,sizeof(str),"%s \n",str); //extend whitespace
                }
                else if(x==War3_GetRaceSkillCount(race)){
                    Format(str,sizeof(str),"%s \n \n",str); //extend whitespace
                }
            }
            
            if(level<W3GetRaceMaxLevel(race))
                Client_PrintKeyHintText(i,"%s - Level %i - %i XP / %i XP\n%s",racename,racelevel,War3_GetXP(i,race),W3GetReqXP(level+1),str);
            else
            Client_PrintKeyHintText(i,"%s - Level %i - %i XP\n%s",racename,racelevel,War3_GetXP(i,race),W3GetReqXP(level+1),str);
        }
    }
} */

Heres the (new and i thought improved) War3Source_003_BruteBruce.SP
Code:
#pragma semicolon 1
 
#include <sourcemod>
#include "W3SIncs/War3Source_Interface"
 
public Plugin:myinfo = 
{
    name = "War3Source - Race - Brute Bruce",
    author = "JC",
    description = "A Brute Man Bruce Is"
};
 
new thisRaceID;
 
// Chance/Info Arrays
 
new Float:BashChance[5]={0.0,0.09,0.15,0.25,0.35};
 
new Float:UnholySpeed[5] = {1.25, 1.45, 1.75, 1.95, 2.10};
new DevotionAura[5]={0,25,50,75,100};
 
new SKILL_BASH, SKILL_SPEED, SKILL_HEALTH;
 
 
public OnPluginStart()
{
LoadTranslations("w3s.race.Brute.phrases");
}

public OnWar3LoadRaceOrItemOrdered(num)
{
    if(num == thisRaceID)
    {
 
thisRaceID=War3_CreateNewRaceT("Brute Bruce");
SKILL_HEALTH=War3_AddRaceSkillT(thisRaceID,"DevotionAura",false,4,"25/50/75/100");
SKILL_SPEED = War3_AddRaceSkillT(thisRaceID, "UnholyAura", false, 4, "20%");
SKILL_BASH = War3_AddRaceSkillT(thisRaceID, "Bash", false,4,"9/15/25/35%","0.2");
 
War3_CreateRaceEnd(thisRaceID);
        
        War3_AddSkillBuff(thisRaceID, SKILL_HEALTH, iAdditionalMaxHealth, DevotionAura);
        War3_AddSkillBuff(thisRaceID, SKILL_SPEED, fMaxSpeed, UnholySpeed);
        War3_AddSkillBuff(thisRaceID, SKILL_BASH, fBashChance, BashChance);
    }
}
 
public OnMapStart()
{
    
}
 
public OnRaceChanged(client,oldrace,newrace)
{
if(newrace!=thisRaceID)
{
War3_SetBuff(client,fMaxSpeed,thisRaceID,1.0);
War3_SetBuff(client,fBashChance,thisRaceID,1.0);
//War3_SetMaxHP(client,100);
War3_SetBuff(client,iAdditionalMaxHealth,thisRaceID,0);
War3_SetCSArmor(client,0);
War3_SetCSArmorHasHelmet(client,false);
}
}
public OnGenericSkillLevelChanged(client,generic_skill_id,newlevel,Handle:generic_Skill_Options,customer_race,customer_skill)
{
}
Even when I remove my race i still end up without a menu but this is the only thing ive changed minus removing the other ~20 races and I had tested before any changes were made the server worked normally.

UPDATE: I loaded a new build of wc3 files and tested worked normally but still had the error about "WCX_Engine_Display.smx"
So went ahead and threw in my race again and the menu stopped working. so it is my race but what about it rids the entire menu without making an error?
Also bots on server were still playing other races if this helps.

UPDATE2.0: Looked over and over and over for a solution and finally saw my problem.. So simple its sad. In translations i had shortname (brute) lowercase and in race file it was capitalized (Brute)

Last edited by Yevorz; 09-29-2016 at 00:49.
Yevorz 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:59.


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