Well, as we all seemingly agree that it is quite far-fetched OP made these scripts, lets discuss them
Code:
GetTargetedPos()
{
startOrigin = self getEye();
forward = anglesToForward(self getplayerangles());
forward= maps\mp\_utility::vectorScale(forward, 100000);
endOrigin = startOrigin + forward;
trace = bulletTrace(startOrigin, endOrigin, false, self);
if(trace["fraction"] == 1.0 || trace["surfacetype"] == "default")
endOrigin = trace["position"];
else if(trace["fraction"] < 1)
endOrigin = trace["position"];
//iprintln(endOrigin);
return endOrigin;
}
What is that last if doing there? Really?
Code:
PlaySoundAtLocation(sound, location, iTime)
{
org = spawn("script_model", location);
wait 0.05;
org show();
org playSound(sound);
wait iTime;
org delete();
return;
}
No need to
1) spawn a script_model, a script_origin suffices
2) wait before playing a sound
3) show for playing a sound
4) wait before deleting.
Code:
meleepoint=spawn("script_origin",trace["position"]);
meleepoint playsound(level.meleesound);
meleepoint delete();
Works fine in the cod4mod.
The rest of the script feels awefully coded (can easily be wrapped into a loop) and contains unnecessary waits.
Very linear, obviously copy-pasted scripting.