October 18, 2018, 08:19:38 AM

Author Topic: Custom Commands  (Read 1841 times)

Offline Hojjke

  • Level 4 Intermediate
  • ****
  • Posts: 91
  • Country: ru
  • I <3 WCS :)
Re: Custom Commands
« Reply #15 on: September 06, 2018, 09:46:25 PM »
I did a test with a skill and it did not work. I also did a test with using the command via console and it did so I guess that for some reason Source Pythons way of executing commands does not like SM commands that much. I might have found some info on how to remake this command in SP though. I will keep you updated!

nvm, tested it another way and it works just like a charm

Offline rossobenoit

  • Level 0 Beginner
  • Posts: 13
  • <3 WCS :)
Re: Custom Commands
« Reply #16 on: September 06, 2018, 11:44:59 PM »
I did a test with a skill and it did not work. I also did a test with using the command via console and it did so I guess that for some reason Source Pythons way of executing commands does not like SM commands that much. I might have found some info on how to remake this command in SP though. I will keep you updated!

nvm, tested it another way and it works just like a charm


you can show us how you do your time

Offline Kami

  • Developer
  • Level 7 Expert
  • *****
  • Posts: 886
  • Country: de
  • Pokemon Master!
Re: Custom Commands
« Reply #17 on: September 07, 2018, 06:03:42 AM »
I guess he used blocks instead of using the command inside a skill directly.

You could try and use wcs_doteleport <userid>

That is a wrapper for the sourcemod teleport command and it also gets the viewcoords of the Player. Let me know if that works For you :)

Offline rossobenoit

  • Level 0 Beginner
  • Posts: 13
  • <3 WCS :)
Re: Custom Commands
« Reply #18 on: September 07, 2018, 02:43:20 PM »
you could show us how to use it  :P

[[skill4]]
setting        =
cmd = "es playerget viewcoord server_var(wcs_userid) wcs_x1 wcs_y1 wcs_z1;es wcs_teleport server_var(wcs_userid) server_var(wcs_x1) server_var(wcs_y1) server_var(wcs_z1)"
sfx            =
cooldown       = "5|3|1|0|0"


Offline Kami

  • Developer
  • Level 7 Expert
  • *****
  • Posts: 886
  • Country: de
  • Pokemon Master!
Re: Custom Commands
« Reply #19 on: September 07, 2018, 06:38:10 PM »
Okay, I kinda remade the command with python. It has got some problems now and then, but this is how it works:

Code: [Select]
[[skill1]]
setting = "es_xset wcs_range 1500|es_xset wcs_range 1550|es_xset wcs_range 1600|es_xset wcs_range 1650"
cmd = "es playerget viewcoord server_var(wcs_userid) wcs_x1 wcs_y1 wcs_z1;es_getplayerlocation wcs_x2 wcs_y2 wcs_z2 server_var(wcs_userid);es wcs_getdistance wcs_tmp server_var(wcs_x1) server_var(wcs_y1) server_var(wcs_z1) server_var(wcs_x2) server_var(wcs_y2) server_var(wcs_z2);if (server_var(wcs_tmp) <= server_var(wcs_range)) then wcs_xalias racealias_teleport;if (server_var(wcs_tmp) > server_var(wcs_range)) then wcs_xalias racealias_telefailed"
racealias_telefailed = "es_tell server_var(wcs_userid) #multi #green[WCS] #lightgreenTarget position out of range!"
racealias_teleport = "es wcs_teleport server_var(wcs_userid) server_var(wcs_x1) server_var(wcs_y1) server_var(wcs_z1)"
sfx = ""
cooldown = "0"


To use this, remove the sourcemod plugin wcs_teleport.smx and download the latest version of wcs.

Offline Hojjke

  • Level 4 Intermediate
  • ****
  • Posts: 91
  • Country: ru
  • I <3 WCS :)
Re: Custom Commands
« Reply #20 on: September 07, 2018, 07:28:24 PM »
you could show us how to use it  :P

[[skill4]]
setting        =
cmd = "es playerget viewcoord server_var(wcs_userid) wcs_x1 wcs_y1 wcs_z1;es wcs_teleport server_var(wcs_userid) server_var(wcs_x1) server_var(wcs_y1) server_var(wcs_z1)"
sfx            =
cooldown       = "5|3|1|0|0"

I used plugin commands.smx by Kami and this
Code: [Select]
block wcs_ulti_teleport
{
es wcs_getviewcoords server_var(wcs_userid) wcs_x2 wcs_y2 wcs_z2
es_getplayerlocation wcs_x1 wcs_y1 wcs_z1 server_var(wcs_userid)
es wcs_getdistance wcs_distance server_var(wcs_x1) server_var(wcs_y1) server_var(wcs_z1) server_var(wcs_x2) server_var(wcs_y2) server_var(wcs_z2)
if (server_var(wcs_distance) <= server_var(wcs_range)) do
{
es_tell server_var(wcs_userid) #multi #green[WCS] You teleported
//es_math wcs_z2 + 100
es wcs_teleport server_var(wcs_userid) server_var(wcs_x2) server_var(wcs_y2) server_var(wcs_z2)

}
else do
{
es_tell server_var(wcs_userid) #multi #green[WCS] #lightgreenYou cannot teleport this far.
}

}

Offline Hojjke

  • Level 4 Intermediate
  • ****
  • Posts: 91
  • Country: ru
  • I <3 WCS :)
Re: Custom Commands
« Reply #21 on: September 17, 2018, 09:47:08 PM »
does anyone know why [corelib/repeat/repeat_loop 310] isn't working? :(

Tried on freddy and blackhole ulti, getting same error

Code: [Select]
[corelib/repeat/repeat_loop 310] _repeat_freddy_nightmare_10: The command '_repeat_freddy_nightmare_10' could not be found

Offline Kami

  • Developer
  • Level 7 Expert
  • *****
  • Posts: 886
  • Country: de
  • Pokemon Master!
Re: Custom Commands
« Reply #22 on: September 18, 2018, 06:47:06 AM »
Without the code I cannot tell you much, but it looks like there is a "es repeat create" Missing somewhere (if that is the right syntax for repeat).

If it tells you _repeat_freddy_nightmare_10 not found that means the repeat was not registered.

Offline Hojjke

  • Level 4 Intermediate
  • ****
  • Posts: 91
  • Country: ru
  • I <3 WCS :)
Re: Custom Commands
« Reply #23 on: September 18, 2018, 01:50:42 PM »
Without the code I cannot tell you much, but it looks like there is a "es repeat create" Missing somewhere (if that is the right syntax for repeat).

If it tells you _repeat_freddy_nightmare_10 not found that means the repeat was not registered.

Oke, actual code of the BlackHole

Code: [Select]
block wcs_blackhole_start
{
es_set bh_id server_var(wcs_userid)
es repeat create blackhole "es_xdoblock wcs/tools/ultimates/default/wcs_blackhole_on"
es repeat start blackhole server_var(bh_tick)
if (server_var(bh_onself) = 1) then es_getplayerlocation wcs_x2 wcs_y2 wcs_z2 server_var(bh_id)
if (server_var(bh_onself) = 0) then es playerget viewcoord server_var(bh_id) wcs_x2 wcs_y2 wcs_z2
es_math wcs_z2 + server_var(bh_height)
es_getplayerteam wcs_team server_var(bh_id)
if (server_var(bh_defaultsfx) = 1) do
{
es est_effect 10 #a 0 sprites/water_drop.vmt server_var(wcs_x2) server_var(wcs_y2) server_var(wcs_z2) 200 500 server_var(bh_duration) 120 350 0 155 155 155 255 10
es est_effect 11 #a 0 sprites/physcannon_bluecore1b.vmt server_var(wcs_x2) server_var(wcs_y2) server_var(wcs_z2) server_var(bh_duration) 3 255
}

es_delayed server_var(bh_duration) es repeat delete blackhole
}

block wcs_blackhole_on
{
es_xset wcs_targetteam 0

if (server_var(wcs_team) = 2) do
{
es_xset wcs_targetteam 3
es_xset wcs_targetteamn "#ct,#alive"
}

if (server_var(wcs_team) = 3) do
{
es_xset wcs_targetteam 2
es_xset wcs_targetteamn "#t,#alive"
}


if (server_var(wcs_targetteam) != "0") do
{
wcs_xalias wcs_blackhole_set1 "es_xset vector2 0;es_getplayerlocation wcs_x1 wcs_y1 wcs_z1 server_var(targetid); es_createvectorstring vector2 server_var(wcs_x2) server_var(wcs_y2) server_var(wcs_z2);es wcs push server_var(targetid) 0 0 50; es_delayed .3 wcs_pushto server_var(targetid) server_var(vector2) server_var(bh_power)"
es wcs_nearcoord targetid server_var(wcs_targetteamn) server_var(wcs_x2) server_var(wcs_y2) server_var(wcs_z2) server_var(bh_radius) "wcs_xalias wcs_blackhole_set1"
//This blackhole ultimate is made by Kamiqawa
wcs_xalias wcs_blackhole_kill1 "es wcs_damage server_var(btargetid) server_var(bh_id) server_var(bh_damage)"
es wcs_nearcoord btargetid server_var(wcs_targetteamn) server_var(wcs_x2) server_var(wcs_y2) server_var(wcs_z2) server_var(bh_killradius) "wcs_xalias wcs_blackhole_kill1"
}
}

Creates effect, nothing happens anymore


Console:
Code: [Select]
[corelib/repeat/repeat_loop 310] _repeat_blackhole_2: The command '_repeat_blackhole_2' could not be found
P.S.: if I get this right, es repeat works like creating _repeat_blackhole_1, _repeat_blackhole_2, _repeat_blackhole_3, _repeat_blackhole_4 etc

Offline Hojjke

  • Level 4 Intermediate
  • ****
  • Posts: 91
  • Country: ru
  • I <3 WCS :)
Re: Custom Commands
« Reply #24 on: September 19, 2018, 01:21:31 AM »
Code: [Select]
Command name: wcs_giverace
Command syntax: <userid> <racename>
Command purpose: Possibility to give private races automatically by another plugins

Example: plugin that letting you to buy a private race

Dunno if that is possible, but that would be a great addition I guess

Offline Kami

  • Developer
  • Level 7 Expert
  • *****
  • Posts: 886
  • Country: de
  • Pokemon Master!
Re: Custom Commands
« Reply #25 on: September 19, 2018, 06:07:06 AM »
You can use "wcs_giveprivate <userid> <Racename>"

Example:
es wcs_giveprivate event_var(userid) "Undead Scourge"

Offline Hojjke

  • Level 4 Intermediate
  • ****
  • Posts: 91
  • Country: ru
  • I <3 WCS :)
Re: Custom Commands
« Reply #26 on: September 19, 2018, 01:24:24 PM »
You can use "wcs_giveprivate <userid> <Racename>"

Example:
es wcs_giveprivate event_var(userid) "Undead Scourge"

wow, didn't know about that one, ty!