Usage
Syntax: setshootparams(parameters);
Explanation
This sets the parameters for the projectiles that are shot by the shoot function. It's important to use this before you call the shoot function so you can ensure the right parameters are passed.When a projectile hits it calls the following events onActionProjectile, onActionProjectile2, or onActionSProjectile.
Example
//#CLIENTSIDE function onWeaponFired() { // Set parameters setshootparams("arrow", player.account); // Shoot projectile temp.angle = getangle(vecx(player.dir), vecy(player.dir)); temp.zangle = pi / 4; temp.power = 1.5; shoot(player.x, player.y, player.z, temp.angle, temp.zangle, temp.power, "arrow", "barrow0.png"); }
... This is a basic custom bow script, that sets the parameters to "arrow" and the account that fired it.
function onActionProjectile() { if (params[0] == "arrow") { echo("Hit by an arrow from" SPC params[1]); } }
... When the clientside shot projectile hits an NPC or a player directly it calls the onActionProjectile event with the parameters passed to it. In the example it checks to see if "arrow" is the first parameter and echoes the second parameter which is the player who shot it.
Categories
CategoryFunctionClientside
CategoryFunctionServerside
There are no comments on this page. [Add comment]