[Include] OnPlayerJackVehicle - (ninja)Jack detection!
#1

OnPlayerJackVehicle V1.1
About:
I've seen a few includes from Wups and i was suprised how usefull those functions were, so i decided to make one myself for people who are annoyed by vehicle jackers.

This include will detect when players are jacking or getting jacked.

Callbacks:.
pawn Код:
public OnPlayerJackVehicle(playerid,victimid,vehicleid,bool:ninjajack)
{
    /*playerid= the player whos jacking, victimid = the player who is getting jacked
      vehicleid = the vehicle getting jacked and ninjajack is when a player is ninjajacking (bug abuse)
      ninjajack will be true when positive (player was ninja jacking), and false when negative (no ninja jack).*/

    return 1;
}

public OnPlayerGotJacked(playerid,jackerid,vehicleid)
{
    /*Playerid = the playerid getting jacked, jackerid = the player whos jacking
      and vehicleid is the vehicle getting jacked.*/

    return 1;
}
Known bugs:
Код:
When you are jacking too fast between echother then OnPlayerGotJacked() will may not be called!
My advice is just using OnPlayerJackVehicle() !
Example script:
pawn Код:
/*
    This example script is written by Gamer931215
    This scripts is showing the usage of OPJV and will show
    how to make it impossible to jack other players's vehicles!
*/


#include <a_samp>
#include <OPJV>

public OnPlayerJackVehicle(playerid,victimid,vehicleid,bool:ninjajack)
{
    if(ninjajack == true)
    {
        SendClientMessage(playerid,0xffffffff,"Ninja-jacking is NOT allowed!");
        Kick(playerid);
    } else {
        TogglePlayerControllable(playerid,0);
        GameTextForPlayer(playerid,"~w~Jacking is ~r~NOT ~w~allowed!",5000,6);
        SetTimerEx("UnfreezePlayer",5000,false,"i",playerid);
    }
    return 1;
}

public OnPlayerGotJacked(playerid,jackerid,vehicleid)
{
    PutPlayerInVehicle(playerid,vehicleid,0); //putting player back in vehicle (just in case)
    return 1;
}

forward UnfreezePlayer(playerid);
public UnfreezePlayer(playerid)
{
    TogglePlayerControllable(playerid,1);
}
Download:
http://pastebin.com/pgjDSd8i
Reply


Messages In This Thread
OnPlayerJackVehicle - (ninja)Jack detection! - by gamer931215 - 20.08.2011, 17:48
Re: OnPlayerJackVehicle - (ninja)Jack detection! - by serman - 20.08.2011, 17:52
Re: OnPlayerJackVehicle - (ninja)Jack detection! - by KoczkaHUN - 20.08.2011, 17:56
Re: OnPlayerJackVehicle - (ninja)Jack detection! - by gamer931215 - 20.08.2011, 18:00
Re: OnPlayerJackVehicle - (ninja)Jack detection! - by KoczkaHUN - 20.08.2011, 18:02
Re: OnPlayerJackVehicle - (ninja)Jack detection! - by kurta999 - 20.08.2011, 18:05
Re: OnPlayerJackVehicle - (ninja)Jack detection! - by gamer931215 - 20.08.2011, 18:08
Re: OnPlayerJackVehicle - (ninja)Jack detection! - by KoczkaHUN - 20.08.2011, 18:13
Re: OnPlayerJackVehicle - (ninja)Jack detection! - by Darnell - 20.08.2011, 18:16
Re: OnPlayerJackVehicle - (ninja)Jack detection! - by gamer931215 - 20.08.2011, 18:19
Re: OnPlayerJackVehicle - (ninja)Jack detection! - by wups - 20.08.2011, 19:45
Re: OnPlayerJackVehicle - (ninja)Jack detection! - by gamer931215 - 20.08.2011, 19:51
Re: OnPlayerJackVehicle - (ninja)Jack detection! - by Hiddos - 20.08.2011, 20:02
Re: OnPlayerJackVehicle - (ninja)Jack detection! - by Kaperstone - 20.08.2011, 20:05
Re: OnPlayerJackVehicle - (ninja)Jack detection! - by gamer931215 - 20.08.2011, 20:21
Re: OnPlayerJackVehicle - (ninja)Jack detection! - by IstuntmanI - 20.08.2011, 20:54
Re: OnPlayerJackVehicle - (ninja)Jack detection! - by TheArcher - 04.09.2011, 23:55
Re: OnPlayerJackVehicle - (ninja)Jack detection! - by RealCop228 - 04.09.2011, 23:59
Re: OnPlayerJackVehicle - (ninja)Jack detection! - by AlExAlExAlEx - 19.03.2012, 20:32
Re: OnPlayerJackVehicle - (ninja)Jack detection! - by rbN. - 20.03.2012, 10:54
Re: OnPlayerJackVehicle - (ninja)Jack detection! - by KyleSmith - 20.03.2012, 11:17
Re: OnPlayerJackVehicle - (ninja)Jack detection! - by Niko_boy - 20.03.2012, 11:36
Re: OnPlayerJackVehicle - (ninja)Jack detection! - by gamer931215 - 20.03.2012, 11:54
Re: OnPlayerJackVehicle - (ninja)Jack detection! - by antonio112 - 20.03.2012, 12:52
Re: OnPlayerJackVehicle - (ninja)Jack detection! - by Edvin - 20.03.2012, 12:54
Re: OnPlayerJackVehicle - (ninja)Jack detection! - by gamer931215 - 20.03.2012, 17:33
Re: OnPlayerJackVehicle - (ninja)Jack detection! - by JaKe Elite - 29.07.2012, 01:42
Re: OnPlayerJackVehicle - (ninja)Jack detection! - by Anak - 28.09.2012, 15:41
Re: OnPlayerJackVehicle - (ninja)Jack detection! - by [HK]Ryder[AN] - 29.09.2012, 06:44

Forum Jump:


Users browsing this thread: 1 Guest(s)