Originally Posted by
Tally
Using this code:
Code:
self playFX( <nameoffx>, <origin> );
Will incur a runtime error "unknown function". I don't know the technical name for it, but playFX() is one of those script functions which run independently of any entity - be that a world entity or a player entity. Entities cannot run it; they can only be assigned to it.
You will need to make a player flag out of it and assign it to the playfx() function like this:
Code:
self.test = playfx( <nameoffx>, <origin> );
I'm sorry, while rewriting the script to this forum I just made a mistake. Normally I have a correctly function without 'self' object.
To IzNoGod:
I got same problem with 2 vectors.
My code:
PHP Code:
_spray()
{
//while( !self useButtonPressed() )
//wait .2;
angles = self getPlayerAngles();
eye = self getEye();
forward = eye + maps\mp\_utility::vectorScale( anglesToForward( angles ), 70 );
trace = bulletTrace( eye, forward, false, self );
iprintln("fr:"+ trace["fraction"]);
if( trace["fraction"] == 1 )
{
iprintln("return");
return;
}
position = trace["position"] - maps\mp\_utility::vectorScale( anglesToForward( angles ), -2 );
angles = vectorToAngles( eye - position );
forward = anglesToForward( angles );
up = anglesToUp( angles );
playFx( level.testfx, position, forward, up );
//self playSound
}
This isn't effect problem maybe..?
Thanks for reply.