Thread: Projectiles?
View Single Post
  #2  
Old 04-02-2010, 06:14 AM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
For shooting a projectile, before calling shoot you need to set the parameters that will be recieved when the projectile lands:
PHP Code:
setshootparams(param1param2etc);
shoot(xyzanglezanglepoweraninameaniparam1aniparam2etc); 
Practical example would be:
PHP Code:
setshootparams("clientside"player.accountdamageamount);
shoot(player.xplayer.yplayer.zgetangle(vecx(player.dir),vecy(player.dir)), 01"aniname"); 
While on an advanced level there is the issue of the detection being serverside or clientside among other things such as abstracting all projectile landing occurrences into a single system, the simplest way to do this would be to have the following code within a weapon:

PHP Code:
//#CLIENTSIDE
function onActionProjectile(param1param2etc){
  
player.chat "Im hit!";

Parameters being what was set before the projectile was shot via setshootparams.

I don't think Clientside onActionProjectile is either accurate or synced with the serverside version of the function however, on Classic I use custom detection on the onActionProjectile2(x, y, params) event which occurs whenever a projectile hits anything and not just your player.

Last edited by ffcmike; 04-02-2010 at 06:33 AM..
Reply With Quote