I have noticed that on a few servers projectiles don't seem to work right.
I PMed Stefan about the problem on one PW when it occured, but I never heard back.
Heres the problem:
Serversided actionprojectile/actionsprojectile seem to call before a projectile actually hits something. Now randomly it WILL work but usually it doesn't.
I have found that if you add a "zangle" and "power" to the projectile it work fine, otherwise it doesn't.
Scripts used for testing:
weapon: Projectile/Test-1
NPC Code:
//#CLIENTSIDE
if (weaponfired) {
setshootparams test;
shoot playerx,playery,playerz,
getangle(vecx(playerdir),vecy(playerdir)),
0,0,
gralats,1;
}
This one seems to call before it hits, shortly after its fired.
weapon: Projectile/Test-2
NPC Code:
//#CLIENTSIDE
if (weaponfired) {
setshootparams test;
shoot playerx,playery,playerz,
getangle(vecx(playerdir),vecy(playerdir)),
0.7,1.5,
gralats,1;
}
This one calls when it lands like it's supposed to.
DB-NPC: Control-NPC
NPC Code:
if (actionprojectile || actionsprojectile) {
if (strequals(#p(2),test)) {
this.x = strtofloat(#p(0));
this.y = strtofloat(#p(1));
setplayerprop #c,Projectile: (#v(this.x),#v(this.y)) Player pos: (#v(playerx),#v(playery))
}
}