February 17, 2020, 03:42:04 PM

Author Topic: [ADDON] Custom Race Menu  (Read 2990 times)

Offline Predz

  • Moderator
  • Level 7 Expert
  • *****
  • Posts: 552
  • Country: england
  • Warcraft: GO Co-Lead Programmer
[ADDON] Custom Race Menu
« on: August 25, 2012, 09:50:47 AM »
WCS Custom Race Menu

Custom Race Menu Specific to Player's Steam ID

Okay, After Request I have created a Addon that will form a Custom Menu when a Player calls "changerace2". It will take from the INI file all the Player's specific races and put them into a Menu, which will change them to that race on selection.

Now, how to configure this? Basically you must still add the Race to your Races.ini, in WCS. Then you can just alter the Steam.ini inside the Racemenu Mod. This is alot easier because you can just add a false SteamID to the Race inside the Races.ini inside WCS, and then just use the Races Name under the SteamID inside the Steam.ini. Also you can monitor who has access to which races alot easier.

Remember this is a BETA mode, as I haven't had time to test so please post any errors.

Example Race:
Code: [Select]
[Glitcher]
#Requirement section
required           = 0
maximum            = 0

#Restrict section
restrictmap        = ""
restrictteam       = 0
restrictitem       = ""
teamlimit          = 0

#Other info
author             = "Predz"
desc               = ""
spawncmd           = "es wcsgroup set wcs_trigger server_var(wcs_userid) 0; es wcsgroup set wcs_point server_var(wcs_userid) 0"
deathcmd           = ""
roundstartcmd      = ""
roundendcmd        = ""
preloadcmd         = ""
allowonly          = "STEAM_0:1:1023838339"          ## <---- False Steam ID
onchange           = ""

#Skill information
numberofskills     = 4
numberoflevels     = 5
skillnames         = "Huge Steps|Console Guns|Triggers|Set Pos"
skilldescr         = "Walk Up Walls|Gain a Gun on Spawn because you glitched the Servers Console|If you have set a position with your Ulti then spawn there when shot|Set the position to spawn when shot"
skillcfg           = "player_spawn|player_spawn|player_victim|player_ultimate"
skillneeded        = "0|0|0|8"

#Skill specific information
[[skill1]]
setting        = "es_xset wcs_stepsize 100|es_xset wcs_stepsize 120|es_xset wcs_stepsize 130|es_xset wcs_stepsize 140|es_xset wcs_stepsize 160"
cmd            = "es_setplayerprop event_var(userid) CCSPlayer.baseclass.localdata.m_Local.m_flStepSize server_var(wcs_stepsize)"
sfx            = "es_xdoblock wcs/addons/effect/cryptshake"

[[skill2]]
setting         = "es_xset wcs_chance 20|es_xset wcs_chance 45|es_xset wcs_chance 68|es_xset wcs_chance 80|es_xset wcs_chance 93"
racealias_gunb1 = "es_give event_var(userid) weapon_m4a1"
cmd             = "if (server_var(wcs_chance) > server_var(wcs_dice)) then es wcs_xalias racealias_gunb1"
sfx             = ""

[[skill3]]
setting         = "es_xset wcs_chance 20|es_xset wcs_chance 25|es_xset wcs_chance 28|es_xset wcs_chance 30|es_xset wcs_chance 33"
racealias_getb1  = "es wcsgroup get wcs_x1 wcs_x2 event_var(userid); es wcsgroup get wcs_y1 wcs_y2 event_var(userid); es wcsgroup get wcs_z1 wcs_z2 event_var(userid); es_createvectorstring wcs_point server_var(wcs_x2) server_var(wcs_y2) server_var(wcs_z2); es wcs_xalias racealias_tele1"
racealias_tele1 = "es_setplayerprop event_var(userid) CBaseEntity.m_vecOrigin server_var(wcs_point); es playerset viewplayer event_var(userid) event_var(attacker)"
racealias_if    = "if (server_var(wcs_chance) < server_var(wcs_dice)) then es wcs_xalias racealias_getb1"
cmd             = "es wcsgroup get wcs_trigger wcs_trigger event_var(userid); if (server_var(wcs_trigger) != 0) then wcs_xalias racealias_if"
sfx             = ""

[[skill4]]
setting         = ""
racealias_tegb1 = "es_tell server_var(wcs_userid) #multi #green[WCS Pos]: #lightgreenAdded #greenTeleportation #lightgreenposition at your #greenViewing Point."
cmd             = "es wcsgroup set wcs_trigger server_var(wcs_userid) 1;es playerget viewcoord server_var(wcs_userid) wcs_x1 wcs_y1 wcs_z1; es_math wcs_z1 + 50; es wcsgroup set wcs_x1 server_var(wcs_userid) server_var(wcs_x1); es wcsgroup set wcs_y1 server_var(wcs_userid) server_var(wcs_y1); es wcsgroup set wcs_z1 server_var(wcs_userid) server_var(wcs_z1); wcs_xalias racealias_tegb1"
sfx             = ""
cooldown        = "20"

Steam.ini:
Code: [Select]
[STEAM_0:1:5110973]
"Glitcher" = 1

That is my SteamID, so when I type "changerace2" it will form a Menu looking like the following:

Code: [Select]
Custom Race Menu

1. Glitcher
« Last Edit: August 25, 2012, 09:55:33 AM by Predz »

Offline Deathkilla

  • Level 7 Expert
  • *****
  • Posts: 899
  • Country: us
    • Elite-Gamers Community
Re: [ADDON] Custom Race Menu
« Reply #1 on: August 25, 2012, 10:56:17 PM »
seems a bit complicated, can you elaborate what exactly it does?
Visit Elite Gamers Today!
www.Elite-Gamers.org




Offline $Diablo$

  • Level 7 Expert
  • *****
  • Posts: 714
  • Country: au
Re: [ADDON] Custom Race Menu
« Reply #2 on: July 18, 2014, 05:59:04 PM »
it doesn't work correctly i get this error in console

Code: [Select]
*** EventScripts caught an exception:
Traceback (most recent call last):
File addons\eventscripts\es.py", line 272, in triggerEvent
self.EventListeners[eventname][listener](event_var)
File "addons\eventscripts\wcs\addons\racemenu\racemenu.py", line 14, in player_say
wcsRaceChange.delete()
UnboundLocalError: local variable 'wcsRaceChange' referenced before assignment

Offline Etox

  • Level 4 Intermediate
  • ****
  • Posts: 98
  • Country: no
  • Do You Even Block!?
    • Lucky.Gaming
Re: [ADDON] Custom Race Menu
« Reply #3 on: July 18, 2014, 06:45:14 PM »
It's 2 years old O.o

Offline Teller

  • Level 7 Expert
  • *****
  • Posts: 273
  • Country: dk
  • #FIXYOURRACE
Re: [ADDON] Custom Race Menu
« Reply #4 on: July 19, 2014, 12:09:28 AM »
It's 2 years old O.o

Agree with Etox do not expect it to work since it's over 2 years old  :)
« Last Edit: July 19, 2014, 01:59:01 AM by Teller »

This is the best wcs server i've ever seen.
Check it out ! http://warcraft-source.com/board/index.php?topic=16799.0

Offline Predz

  • Moderator
  • Level 7 Expert
  • *****
  • Posts: 552
  • Country: england
  • Warcraft: GO Co-Lead Programmer
Re: [ADDON] Custom Race Menu
« Reply #5 on: July 20, 2014, 12:50:23 AM »
Nah. Sorry guys, this is just a fail from me. The line should read

Code: [Select]
try: wcsRaceChange.delete()
except: pass

Basically it is used to reset the popup, and when the popup has not been initialized then it will return that wcsRaceChange has no function delete().
« Last Edit: July 20, 2014, 02:25:07 AM by Predz »