$player in a global file?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
SA007
Lance Corporal
Posts: 24
Joined: Thu Sep 03, 2009 10:17 pm

$player in a global file?

Post by SA007 »

I'm (still) doing some mods and I'm busy with some stuff that needs to work for all levels, so in some global script.

There is just a problem, when I try to use $player in that script (for example DMprecache.scr) it goes horribly wrong.

Is it possible to use $player (or something else that lets me scan trough all the players) outside the map script?
Tazz
Second Lieutenant
Posts: 155
Joined: Fri Feb 16, 2007 1:29 pm
Contact:

Post by Tazz »

u should be able to make ur own script and exec it in the map script....i wouldnt try to put it in the dmprecache but make ur own then exec it in the maps scripts u want......that how alot of fixes work without having to mod all the maps...just put exec global/urscriptname.scr and there ya go


hope this helps ya
SA007
Lance Corporal
Posts: 24
Joined: Thu Sep 03, 2009 10:17 pm

Post by SA007 »

I tried DMprecache and my own script, but that didn't work.

Apperantly $player can only be used after waittill spawn.
Makes sense, but DMprecache is before that and you can't use waittill spawn anywhere else than the mapscript.
So, i moved my script to after waittill spawn (just an exec) and it worked fine :)

Now I can finaly make changes to that in 1 place in stead of every map :P
Tazz
Second Lieutenant
Posts: 155
Joined: Fri Feb 16, 2007 1:29 pm
Contact:

Post by Tazz »

well glad ya got going buddy......so u have t6o put the exec global/urfixname.scr after waittill spawn????? or ur script???

cuz i just meant make a script and put in global folder....then exec it from map script...but all ur fixes would be in the script in global file...but if u got it going then forget what i said lol
Post Reply