%target = containerRayCast(%cl.player.getEyePoint(), vectorAdd(vectorScale(vectorNormalize(%cl.player.getEyeVector()), 5), %cl.player.getEyePoint()), $typeMasks::playerObjectType).client;
Code: [Select]%target = containerRayCast(%cl.player.getEyePoint(), vectorAdd(vectorScale(vectorNormalize(%cl.player.getEyeVector()), 5), %cl.player.getEyePoint()), $typeMasks::playerObjectType).client;This gets the client that a player is looking at.just replace .client; with .getid();
on a related note, so i'm not posting a whole new topic, is there a way to get the direction in x y z of a player's looking? so that i could add velocity to a vehicle in that direction?
I tried it and it keeps getting my id not what i am looking at
%start = %player.getEyePoint();%end = vectorAdd(%start,vectorScale(%player.getEyeVector(),15));%ray = containerRayCast(%start,%end,$TypeMasks::All,%player);%col = firstWord(%ray);
just replace .client; with .getid();
Code: [Select]%ray = containerRayCast(%player.getEyePoint(),vectorScale(%player.getEyeVector(),5),$TypeMasks::All,%player);%col = firstWord(%ray);
%ray = containerRayCast(%player.getEyePoint(),vectorScale(%player.getEyeVector(),5),$TypeMasks::All,%player);%col = firstWord(%ray);
Woops, sorry.Code: [Select]%start = %player.getEyePoint();%end = vectorAdd(%start,vectorScale(%player.getEyeVector(),15));%ray = containerRayCast(%start,%end,$TypeMasks::All,%player);%col = firstWord(%ray);
player.getEyeVector()
i'm looking at this and when i look straight up one of the numbers comes out in ten millions. is there a way of reducing it so it doesn't do something like this? since i'm planning on using this on a vehicle that really wouldn't work.