SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 22/03/2017, 07:06 PM   #31
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Ottawa, Canada
Posts: 1,550
Reputation: 550
Default Re: projectile.inc - PeppeAC's physics modified and simpler version

Quote:
Originally Posted by AndySedeyn View Post
Nice! Though, OnProjectileStop seems to be called prematurely. It's an annoyance when you create an object that is supposed to replace the projectile under OnProjectileStop (the replacement object would be in the air instead of on the ground).
Can you give me example projectile which causes this bug.
__________________

If you are reading this, its too late!



Gammix is offline   Reply With Quote
Old 22/03/2017, 07:12 PM   #32
AndySedeyn
High-roller
 
AndySedeyn's Avatar
 
Join Date: Feb 2014
Location: Belgium
Posts: 1,352
Reputation: 677
Default Re: projectile.inc - PeppeAC's physics modified and simpler version

Quote:
Originally Posted by Gammix View Post
Can you give me example projectile which causes this bug.
I took your example and just added the CreateObject line under OnProjectileStop because that's what roughly happens in my script:
PHP Code:
#include <a_samp>
#include <zcmd>
#include <projectile>

new iProjObject[MAX_PROJECTILES];

public 
OnFilterScriptInit()
{
    
CA_Init();
    return 
1;
}

CMD:test(playerid)
{
    new 
Float:xFloat:yFloat:zFloat:ang;
    
GetPlayerPos(playeridxyz);
    
GetPlayerFacingAngle(playeridang);

    new 
Projectile(x0.5 floatcos(-(ang 90.0), degrees), z2.0 floatsin(-angdegrees), 2.0 floatcos(-angdegrees), 4.0, .collision_friction 5.0, .sphere_radius 0.01, .gravity 13.0);
    if (
== -1)
        return 
0;
    
DestroyObject(iProjObject[i]);
    
iProjObject[i] = CreateObject(348x0.5 floatcos(-(ang 90.0), degrees), z93.7120.0ang 60.0);
    
    
ApplyAnimation(playerid,"GRENADE","WEAPON_throwu",3.0,0,0,0,0,0);
    return 
1;
}

public 
OnProjectileUpdate(projid)
{
    new 
Float:xFloat:yFloat:z;
    
GetProjectilePos(projidxyz);
    
SetObjectPos(iProjObject[projid], xyz);
    return 
1;
}

public 
OnProjectileStop(projid)
{
    new 
Float:xFloat:yFloat:z;
    
GetProjectilePos(projidxyz);
    
CreateObject(348xyz90.00.00.0);
    return 
1;

AndySedeyn is online now   Reply With Quote
Old 23/03/2017, 06:16 AM   #33
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Ottawa, Canada
Posts: 1,550
Reputation: 550
Default Re: projectile.inc - PeppeAC's physics modified and simpler version

Update v1.3.4:
- Fixed sphere hanging in space when colliding with a player.
- Fixed min and max height calculation.

@Andy: This version should get rid of all those issues you addressed before. Give it a try!
__________________

If you are reading this, its too late!



Gammix is offline   Reply With Quote
Old 23/03/2017, 12:17 PM   #34
AndySedeyn
High-roller
 
AndySedeyn's Avatar
 
Join Date: Feb 2014
Location: Belgium
Posts: 1,352
Reputation: 677
Default Re: projectile.inc - PeppeAC's physics modified and simpler version

Quote:
Originally Posted by Gammix View Post
@Andy: This version should get rid of all those issues you addressed before. Give it a try!
Yep, thank you
AndySedeyn is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vehicle Projectile Detection Killa[DGZ] Scripting Help 7 04/10/2016 10:52 AM
[FilterScript] Soccer Mod PeppeAC -Small Edited by me. Ivander Filterscripts 6 29/09/2013 04:34 PM
Must be a simpler but efficient way to show textdraw countdowns for two players [REP++] Hoborific Scripting Help 0 06/02/2012 11:43 AM


All times are GMT. The time now is 03:34 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.