February 24, 2018, 04:52:41 AM

Author Topic: player_spawn_cmd is being executed for Spectators  (Read 1914 times)

Offline mnestroy

  • Level 0 Beginner
  • Posts: 7
player_spawn_cmd is being executed for Spectators
« on: May 19, 2008, 04:05:14 AM »
I'm a bit confused cause the player_spawn_cmd is being executed even if a player is a spectator.   The code associated gets executed at the start of each round (even if they are in spectate)

This has become a problem because this is where I code such things as removing and giving of weapons... This becomes a real problem when I give a spectator a weapon and then the person they are watching has a gun floating over their heads, and then can even go as far as droping the gun.

Any ideas?

Offline Espeladden

  • Level 7 Expert
  • *****
  • Posts: 592
  • Country: 00
    • Syndicate Gamers
Re: player_spawn_cmd is being executed for Spectators
« Reply #1 on: May 19, 2008, 05:06:45 PM »
How does a spawn command work for someone that never spawns?
It just doesnt make sence at all

Offline mnestroy

  • Level 0 Beginner
  • Posts: 7
Re: player_spawn_cmd is being executed for Spectators
« Reply #2 on: May 20, 2008, 05:36:51 AM »
That is my point, the code is being executed at the start of a round regardless if a player is in a team or not.

This typically is not an issue but If I do any weapon stripping or giving this also gets done on the spectator.

I have added some extra code but Its kinda a pain

Code: (eventscripts) [Select]
es_xgetplayerteam wcs_team event_var(userid);es es_xif (server_var(wcs_team) != 1) then racealias_kodspn
This may be poor coding on my end or something weird that is causing this issue...

Offline Berettonawak

  • French
  • Level 7 Expert
  • *****
  • Posts: 3147
  • Country: 00
  • Big Berettonawak is watching you...
    • Coding-Alliance.Com : A bunch of coders? Why not a bunch of players? :P
Re: player_spawn_cmd is being executed for Spectators
« Reply #3 on: May 22, 2008, 12:08:19 PM »
...
this is cause team 1 = spec...
team 2 = T
team 3 = CT
Quote from: N0life
Beret, keep yourself focusing on 1 project. Be sure to memorize that down since it sounds good.
Quote from: myself
i love tuna juice :D
Quote from: Pietro
=CA= Pietro: back
=CA= Pietro: sorry, was downstair sharing my chocolate with my cat
=CA= Pietro: you should see his face when he ate it xD
Quote from: myself
=CA= Berettonawak: just because you don't have hope doesn't mean we're doomed

Offline mnestroy

  • Level 0 Beginner
  • Posts: 7
Re: player_spawn_cmd is being executed for Spectators
« Reply #4 on: May 22, 2008, 05:38:19 PM »
...
this is cause team 1 = spec...
team 2 = T
team 3 = CT


No i added that code to prevent the command form being executed.  I shouldn't need to have this snippet of code.

Offline Berettonawak

  • French
  • Level 7 Expert
  • *****
  • Posts: 3147
  • Country: 00
  • Big Berettonawak is watching you...
    • Coding-Alliance.Com : A bunch of coders? Why not a bunch of players? :P
Re: player_spawn_cmd is being executed for Spectators
« Reply #5 on: May 22, 2008, 06:57:13 PM »
well i can't guess if you don't post the racealias  :mrgreen:.
excuse me, i was wrong...

but the code shouldn't be executed for spec...
espeladden is right, why would you exec a spawn cmd for someone who doesn't spawn?
try reinstalling es, est...
Quote from: N0life
Beret, keep yourself focusing on 1 project. Be sure to memorize that down since it sounds good.
Quote from: myself
i love tuna juice :D
Quote from: Pietro
=CA= Pietro: back
=CA= Pietro: sorry, was downstair sharing my chocolate with my cat
=CA= Pietro: you should see his face when he ate it xD
Quote from: myself
=CA= Berettonawak: just because you don't have hope doesn't mean we're doomed

Offline mnestroy

  • Level 0 Beginner
  • Posts: 7
Re: player_spawn_cmd is being executed for Spectators
« Reply #6 on: May 22, 2008, 10:45:37 PM »
Sorry for the confusion.

I do agree 100% with your statements that it should be executed but for some reason it is... I wonder if its a DOD thing?? or is it possible that its being executed for everyone but nobody else issues the same commands in that section as I do???

Or maybe its only DOD that you can use the es code to give a spectator a gun...

I'm just throwing out ideas now :)

Offline Berettonawak

  • French
  • Level 7 Expert
  • *****
  • Posts: 3147
  • Country: 00
  • Big Berettonawak is watching you...
    • Coding-Alliance.Com : A bunch of coders? Why not a bunch of players? :P
Re: player_spawn_cmd is being executed for Spectators
« Reply #7 on: May 23, 2008, 01:51:08 PM »
reinstall everything...
have you addons on your server?
Quote from: N0life
Beret, keep yourself focusing on 1 project. Be sure to memorize that down since it sounds good.
Quote from: myself
i love tuna juice :D
Quote from: Pietro
=CA= Pietro: back
=CA= Pietro: sorry, was downstair sharing my chocolate with my cat
=CA= Pietro: you should see his face when he ate it xD
Quote from: myself
=CA= Berettonawak: just because you don't have hope doesn't mean we're doomed

Offline Koshy

  • Level 7 Expert
  • *****
  • Posts: 569
  • Country: 00
    • Lethal Reflex
Re: player_spawn_cmd is being executed for Spectators
« Reply #8 on: June 07, 2008, 11:05:34 PM »
Damn, I did it again.
« Last Edit: June 07, 2008, 11:07:05 PM by Koshy »

Offline HOLLIDAY

  • <Race Maker>
  • Watchdog
  • Level 7 Expert
  • *****
  • Posts: 2840
  • Country: 00
  • of all the things ive lost i miss my mind the most
    • HOLLIDAYWCS.COM
Re: player_spawn_cmd is being executed for Spectators
« Reply #9 on: June 26, 2008, 02:45:49 AM »
what is your racealias_

Offline Berettonawak

  • French
  • Level 7 Expert
  • *****
  • Posts: 3147
  • Country: 00
  • Big Berettonawak is watching you...
    • Coding-Alliance.Com : A bunch of coders? Why not a bunch of players? :P
Re: player_spawn_cmd is being executed for Spectators
« Reply #10 on: July 01, 2008, 02:13:55 PM »
hum...
it's half logic that it's exec for spec...

It is logic, cause at the start of the round, everyone spawns...
It isn't, cause specs don't spawn...
Quote from: N0life
Beret, keep yourself focusing on 1 project. Be sure to memorize that down since it sounds good.
Quote from: myself
i love tuna juice :D
Quote from: Pietro
=CA= Pietro: back
=CA= Pietro: sorry, was downstair sharing my chocolate with my cat
=CA= Pietro: you should see his face when he ate it xD
Quote from: myself
=CA= Berettonawak: just because you don't have hope doesn't mean we're doomed

Offline HOLLIDAY

  • <Race Maker>
  • Watchdog
  • Level 7 Expert
  • *****
  • Posts: 2840
  • Country: 00
  • of all the things ive lost i miss my mind the most
    • HOLLIDAYWCS.COM
Re: player_spawn_cmd is being executed for Spectators
« Reply #11 on: July 01, 2008, 03:15:24 PM »
sounds like the problem is in the player_spawn_cmd
what is your cmd? could it be somthing like es_give #a weapon_
so every time a player spawns everyone gets a weapon including spectators?