SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 21/08/2014, 10:57 AM   #1
Kyance
Gangsta
 
Kyance's Avatar
 
Join Date: Mar 2013
Posts: 817
Reputation: 92
Default Hydra 'dogfight' script / OPD not working

I know this is probably a messy code, because I've never tried something like this before, but I just tried XD

So, the problem;
When a player dies, and he's in a Hydra, there should be a kill message, which Hydra pilot killed that Hydra pilot, but for some reason, nothing is happening. I've seen some videos on YouTube, in which people have created, that if you shoot a hydra, a death message comes etc.. so it is possible.

Code;
pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
    for(new line=0; line < 6; line++) TextDrawHideForPlayer(playerid, BoxMsg[line]);
    SendDeathMessage(killerid, playerid, reason);
   
    if(IsPlayerInAnyVehicle(playerid))
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, X, Y, Z);
        if(GetVehicleModel(vehicleid) == 520)
        {
            new target, attacker;
            new
                Float:fPX, Float:fPY, Float:fPZ,
                Float:fVX, Float:fVY, Float:fVZ
            ;
            //const Float:fScale = 10.0;

            foreach(Player, i)
            {
                if(IsPlayerInAnyVehicle(i) && IsPlayerInRangeOfPoint(i, 20, X, Y, Z))
                {
                    attacker = i;
                    GetPlayerCameraPos(i, fPX, fPY, fPZ);
                    GetPlayerCameraFrontVector(i, fVX, fVY, fVZ);
                    if(IsPlayerInRangeOfPoint(i, 10, fVX, fVY, fVZ)) target = i; break;
                }
            }
            OnPlayerDeath(target, attacker, 51);

        }
    }
    return 1;
}
E: did some minor changes, still not working :l
__________________
I'm amazed how you people are still wasting your time on a decade old game.
Kyance is offline   Reply With Quote
Old 21/08/2014, 05:56 PM   #2
Kyance
Gangsta
 
Kyance's Avatar
 
Join Date: Mar 2013
Posts: 817
Reputation: 92
Default Re: Hydra 'dogfight' script / OPD not working

bump
__________________
I'm amazed how you people are still wasting your time on a decade old game.
Kyance 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
Hydra Battle script Help mehdi171996 Scripting Help 6 30/07/2014 04:08 PM
Script Error: Hydra spawn blubber Help Archive 2 29/12/2009 02:55 PM


All times are GMT. The time now is 01:20 AM.


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