Okay so im working on a gunscript.
PHP Code:
//#CLIENTSIDE
function onWeaponFired()
{
shoot(player.x + 1.5 + vecx(player.dir), player.y + 2 + vecy(player.dir), player.z, (playerdir + 1) * pi / 2, NULL, NULL, "era_bulletfx", NULL);
setani("firegani", NULL);
freezeplayer(0.5);
}
function onActionProjectile()
{
player.hearts -= 2;
}
I don't know what im doing wrong, i don't really understand the shoot command yet, but it's not showing the bullet flying.
Oh and, sometimes if i shoot while walking and shoot again i hurt myself :s
as for this one.
PHP Code:
//#CLIENTSIDE
function onKeyPressed()
{
temp.equip = 1;
if (keydown(5))
{
if(temp.equip == 1)
{
temp.equip = 0;
setani("gunequip", NULL);
sleep(1);
setani("gunidle", NULL);
}
else
{
temp.equip = 1;
setani("idle", NULL);
}
}
}
function onWeaponFired()
{
if(temp.equip == 0)
{
shoot(player.x + 1.5 + vecx(player.dir), player.y + 2 + vecy(player.dir), player.z, (playerdir + 1) * pi / 2, NULL, NULL, "era_bulletfx", NULL);
setani("gunidlegani", NULL);
freezeplayer(0.1);
}
}
function onActionProjectile()
{
player.hearts -= 2;
}
I need to figure out if the player is moving or standing still, to add a walking/idle gani to it, but i have no idea how to check it, also, the ganis don't seem to be working on this one, i haven't made any gani's myself yet, so i used those of a server, and i even uploaded them to testbed, but they still don't work.
i would've checked the wiki for the shoot command, but as we all know that's temporarily down.
I myself think i need a timeout function that will constantly check if the player is moving or standing still