x
ETF2L is looking for new Staff to recruit! Are you interested in supporting the league? Then click here for more details on what we can offer and how to apply! 
x
To those who participated in the Highlander Season 32 (Summer 2024), please fill out this Feedback Form for the current & next Highlander seasons!

Forum

Script makes my game crash

Created 15th February 2009 @ 12:22

Add A Reply Pages: 1

Rele

I created this script myself. Basically it should just change the color of my crosshair whenever I press the bound button and it should go like this: ch green -> f7 -> ch yellow -> f7 -> ch orange -> … -> ch green

Currently it looks like this:

//Crossy-Colors

alias green “cl_crosshair_blue 54; cl_crosshair_red 102; cl_crosshair_green 255; alias green yellow”
alias yellow “cl_crosshair_blue 0; cl_crosshair_red 247; cl_crosshair_green 255; alias yellow orange”
alias orange “cl_crosshair_blue 0; cl_crosshair_red 247; cl_crosshair_green 159; alias orange lightblue”
alias lightblue “cl_crosshair_blue 255; cl_crosshair_red 85; cl_crosshair_green 200; alias lightblue darkblue”
alias darkblue “cl_crosshair_blue 255; cl_crosshair_red 51; cl_crosshair_green 98; alias darkblue pink”
alias pink “cl_crosshair_blue 202; cl_crosshair_red 251; cl_crosshair_green 91; alias pink white”
alias white “cl_crosshair_blue 255; cl_crosshair_red 255; cl_crosshair_green 255; alias white green”

bind f7 green

It works fine until the white crosshair. But as soon as I press F7 again, the game crashes and can only be shut down by the task manager.

Any ideas are welcome.

Regards.

RaCio

GoT²

“alias white green”
I think this is the causing the problems.
When your script reaches that part of the script, green will be aliased as yellow which is aliased as orange etc. So the script will get in a loop and crash.
So instead of binding color’s to eachother try to use something like this

Bind f7 clrchange
alias clrchange green
alias green “cl_crosshair_blue 54; cl_crosshair_red 102; cl_crosshair_green 255; alias clrchange yellow”
alias yellow “cl_crosshair_blue 0; cl_crosshair_red 247; cl_crosshair_green 255; alias clrchange orange”

And so on :)

Rele

I had it like this before, just with crosshair instead of clrchange. Same result :/

EDIT: Didnt look properly at the script, I didnt use exactly this script :P Still doesnt work though ;/
But nvm Im using only 2 colours now anyway. Was just a question out of interest.

Thx for the help Racio & Anakin.

AnAkkk

strange, it should work.

Well just copy and paste this:

alias xhairchange “green”
alias green “cl_crosshair_blue 54; cl_crosshair_red 102; cl_crosshair_green 255; alias xhairchange yellow”
alias yellow “cl_crosshair_blue 0; cl_crosshair_red 247; cl_crosshair_green 255; alias xhairchange orange”
alias orange “cl_crosshair_blue 0; cl_crosshair_red 247; cl_crosshair_green 159; alias xhairchange lightblue”
alias lightblue “cl_crosshair_blue 255; cl_crosshair_red 85; cl_crosshair_green 200; alias xhairchange darkblue”
alias darkblue “cl_crosshair_blue 255; cl_crosshair_red 51; cl_crosshair_green 98; alias xhairchange pink”
alias pink “cl_crosshair_blue 202; cl_crosshair_red 251; cl_crosshair_green 91; alias xhairchange white”
alias white “cl_crosshair_blue 255; cl_crosshair_red 255; cl_crosshair_green 255; alias xhairchange green”

bind f7 xhairchange

qck.

U/²

i had the same problem with a fps config, as soon i chose class on a server my game crashed… so now i use some fps tweaker :D but i still want to use the fps config, someone know whats wrong?

Shrapnel

The OP’s script becomes an infinite loop after it has gone round once.
Think about it, after white has been executed once, the next time f7 is pressed the following happens:

green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->green->yellow->orange->lightblue->darkblue->pink->white->ad infinitum

Anakins version is a working way to do what you are trying to achieve.

Rele

It didnt work.
It didnt do anything.

Absolute

LoLZ at RaiNBoW ScrIpTZ

Add A Reply Pages: 1