June 18, 2018, 05:40:31 PM

Author Topic: whats wrong with my skill  (Read 1183 times)

Alucard1985

  • Guest
whats wrong with my skill
« on: August 05, 2012, 09:49:58 PM »
Hi i have a little problem maybe anyone know whats wrong with my skill, its crazy if i join the server it works. if i press ultimate i fly and i if press ultimate again i lose my fly but if i push ultimate again it dosent work only after joining the server again, thats my code

Code: [Select]
[[skill4]]
setting        = ""
racealias_fly = "es wcs2_jetpack event_var(userid) 0;es_xset fly 0"
cmd            = "es wcs2_jetpack event_var(userid) 1;if (server_var(fly) = 1) then wcs_xalias racealias_fly;es_xset fly 1"
sfx            = ""
cooldown       = "1"
« Last Edit: August 05, 2012, 09:53:25 PM by Alucard1985 »

Offline HOLLIDAY

  • <Race Maker>
  • Watchdog
  • Level 7 Expert
  • *****
  • Posts: 2845
  • Country: 00
  • of all the things ive lost i miss my mind the most
    • HOLLIDAYWCS.COM
Re: whats wrong with my skill
« Reply #1 on: August 06, 2012, 05:55:45 AM »
its because you use event_var(userid) instead of server_var(wcs_userid)

Offline Naiken

  • Level 7 Expert
  • *****
  • Posts: 240
  • Country: gb
  • Languages: ESS, SQF
Re: whats wrong with my skill
« Reply #2 on: August 06, 2012, 12:27:31 PM »
Heres what i do with userids:
event_var(userid) - for Spawn skills or Victims
server_var(wcs_userid) - for anything ultimate related

Offline HOLLIDAY

  • <Race Maker>
  • Watchdog
  • Level 7 Expert
  • *****
  • Posts: 2845
  • Country: 00
  • of all the things ive lost i miss my mind the most
    • HOLLIDAYWCS.COM
Re: whats wrong with my skill
« Reply #3 on: August 06, 2012, 02:33:48 PM »
yes ultimate always uses server_var and will never use event_var

the reason that it would work when connecting or reconnecting and at times not at all is because
ultimate is not an event its a command so by using an event_var(userid) in a server command
it gets the userid of the last player in an event such as player_spawn player_hurt player_death witch could be any player
so when you thought your ultimate was not working it was actually effecting another player on the server

change event_var(userid) to server_var(wcs_userid) and it should work fine   everytime 

Alucard1985

  • Guest
Re: whats wrong with my skill
« Reply #4 on: August 06, 2012, 02:55:02 PM »
I will try it tonight, thank you holliday

Offline HOLLIDAY

  • <Race Maker>
  • Watchdog
  • Level 7 Expert
  • *****
  • Posts: 2845
  • Country: 00
  • of all the things ive lost i miss my mind the most
    • HOLLIDAYWCS.COM
Re: whats wrong with my skill
« Reply #5 on: August 06, 2012, 03:23:22 PM »
no problem

when you change it you may want to check that its not the only ultimate that uses event_var in your DB

Alucard1985

  • Guest
Re: whats wrong with my skill
« Reply #6 on: August 06, 2012, 03:47:08 PM »
Np holliday i change all skills to Sourcemod and i must rewrite everything. But i had Problems with my fly ultimate the other skills and ultimate works Without Problems