SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 05/08/2016, 07:11 AM   #12
AbyssMorgan
Banned
 
Join Date: Apr 2015
Location: Poland
Posts: 1,213
Reputation: 352
Default Re: Missile Launcher

Update v1.6.6:

- Fixed a random detection player who shoots. (Thank you for reporting @Slotomic)
AbyssMorgan is offline   Reply With Quote
Old 10/08/2016, 06:14 PM   #13
Jensenn
Banned
 
Join Date: Apr 2014
Location: PAWN Coder
Posts: 100
Reputation: 8
Default Re: Missile Launcher

awesome
Jensenn is offline   Reply With Quote
Old 24/11/2016, 08:10 PM   #14
AbyssMorgan
Banned
 
Join Date: Apr 2015
Location: Poland
Posts: 1,213
Reputation: 352
Default Re: Missile Launcher

Update v1.7.0:

- Added functions:
PHP Code:
MissileLaunchAimPlayer(targetid,type,Float:detection_range,Float:explode_radius,Float:speed,Float:x,Float:y,Float:z,worldid,interiorid,playerid,Float:streamdistance,missile_object,Float:tx,Float:ty,Float:tz,byplayerid=INVALID_PLAYER_ID,teamid=ANY_TEAM);
bool:MissileStopAimPlayer(mobid); 
Video:
https://www.youtube.com/watch?v=bS6jnEebJR4
AbyssMorgan is offline   Reply With Quote
Old 11/02/2017, 07:53 AM   #15
AbyssMorgan
Banned
 
Join Date: Apr 2015
Location: Poland
Posts: 1,213
Reputation: 352
Default Re: Missile Launcher

Issues:
- Idle players don't see missile projectiles.
PHP Code:
//Fix
public OnPlayerConnect(playerid){

    
Streamer_ToggleIdleUpdate(playerid,1);
    
    return 
1;

Components:
Missile.inc
VehicleMissile.inc
VehicleMissileCol.inc
AbyssMorgan is offline   Reply With Quote
Old 11/02/2017, 08:09 AM   #16
X337
Gangsta
 
Join Date: Sep 2014
Location: Indonesia
Posts: 879
Reputation: 291
Default Re: Missile Launcher

Thanks for the include.
Is there any way to detect, if a player just killed a player / destroyed a vehicle with a missile?
__________________
viva la sa-mp
X337 is offline   Reply With Quote
Old 11/02/2017, 08:51 AM   #17
AbyssMorgan
Banned
 
Join Date: Apr 2015
Location: Poland
Posts: 1,213
Reputation: 352
Default Re: Missile Launcher

SAMP Synchronization is still suck, maybe this code working:
PHP Code:
public OnMissileDestroy(mobid,Float:x,Float:y,Float:z,type,killerid){
    
Tryg3DForeach(i){
        if(
IsPlayerInRangeOfPoint(i,5.0,x,y,z)){
            new 
Float:hp;
            
GetPlayerHealth(killerid,hp);
            if(
hp <= 0.0){
                
//bla bla bla
            
}
        }
    }
    
    return 
1;

AbyssMorgan is offline   Reply With Quote
Old 11/02/2017, 09:23 AM   #18
Lordzy
High-roller
 
Lordzy's Avatar
 
Join Date: Mar 2012
Location: NetherRealm
Posts: 2,703
Reputation: 1176
Default Re: Missile Launcher

Quote:
Originally Posted by AbyssMorgan View Post
SAMP Synchronization is still suck, maybe this code working:
PHP Code:
public OnMissileDestroy(mobid,Float:x,Float:y,Float:z,type,killerid){
    
Tryg3DForeach(i){
        if(
IsPlayerInRangeOfPoint(i,5.0,x,y,z)){
            new 
Float:hp;
            
GetPlayerHealth(killerid,hp);
            if(
hp <= 0.0){
                
//bla bla bla
            
}
        }
    }
    
    return 
1;

A better way would be to set a boolean variable true upon missile hitting the player. Reset the boolean in case if the player has inflicted damage by something else. Under OnPlayerDeath, if the boolean variable is true, it can be concluded that player's death was caused by the missile explosion.
__________________
Currently inactive - I don't play at any SA-MP servers nor work on anything in PAWN for now. The projects that I've done so far in PAWN, which requires updates will be taking some time.
Lordzy is offline   Reply With Quote
Old 14/02/2017, 07:49 PM   #19
AbyssMorgan
Banned
 
Join Date: Apr 2015
Location: Poland
Posts: 1,213
Reputation: 352
Default Re: Missile Launcher

Update v1.8.0:

- Updated callback:
Code:
OnMissileDestroy(mobid,Float:x,Float:y,Float:z,type,killerid,byplayerid);
How to check is player kill by missile:
PHP Code:
enums:
last_missile_shot
last_missile_player

public OnMissileDestroy(mobid,Float:x,Float:y,Float:z,type,killerid,byplayerid){
    if(
type == MISSILE_DESTROY_TYPE_DETECT && killerid != INVALID_PLAYER_ID){
        
PlayerInfo[killerid][last_missile_shot] = GetTickCount();
        
PlayerInfo[killerid][last_missile_player] = byplayerid;
    }
    return 
1;
}

public 
OnMissileDetectPlayer(playerid,killerid){
    if(
killerid != INVALID_PLAYER_ID){
        
PlayerInfo[playerid][last_missile_shot] = GetTickCount();
        
PlayerInfo[playerid][last_missile_player] = killerid;
    }
    return 
1;
}

public 
OnPlayerDeath(playeridkilleridreason){
    if(
PlayerInfo[playerid][last_missile_player] != INVALID_PLAYER_ID && reason 46 && playerid != killerid){
        if(
GetTickCount()-PlayerInfo[playerid][last_missile_shot] < 2000){
            
killerid PlayerInfo[playerid][last_missile_player];
            
reason 51;
        }
    }
    
    
//your code
    
return 1;

AbyssMorgan is offline   Reply With Quote
Old 26/03/2017, 05:30 PM   #20
AbyssMorgan
Banned
 
Join Date: Apr 2015
Location: Poland
Posts: 1,213
Reputation: 352
Default Re: Missile Launcher

Update v1.8.1:

- Remove useless Timer after missile destroy
AbyssMorgan is offline   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
Missile Object PCheriyan007 Help Archive 4 31/05/2011 04:49 PM


All times are GMT. The time now is 12:37 PM.


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