SA-MP Forums Archive
[FilterScript] [FS]Weapons&MoneyOnPlayerDeath - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] [FS]Weapons&MoneyOnPlayerDeath (/showthread.php?tid=229489)



[FS]Weapons&MoneyOnPlayerDeath - Dr.Ghost - 21.02.2011

Hello today i just Bored and make one simple Filterscript.
i have see the gamerX server when the player Died then The Pickup Droped by player Death on the place..

Feature:
Function OnplayerDeath Only ...
Free Use AS FILTERSCRIPT OR GAMEMODE just copy the code to your gamemode.
.When Then Player Death the weapons droped by player death on the place,..where is
player has died....Going To Pickup it you will get Weapons and money from the pickup

PAWN CODE:
pawn Код:
#include <a_samp>
#define FILTERSCRIPT

#define COLOR_RED 0xAA3333AA

// onplyaerdeath function
new PickupPlayerDeath1;
new PickupPlayerDeath2;
new PickupPlayerDeath3;
//----------------------

public OnFilterScriptInit()
{
    print("\n--------------------------");
    print(" FILTERSCRIPT BY DR.GHOST");
    print("---------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
        new Float:X,Float:Y,Float:Z;
       GetPlayerPos(playerid,X,Y,Z);
        PickupPlayerDeath1 = CreatePickup(1550, 3,X+2,Y,Z);
        PickupPlayerDeath2 = CreatePickup(353, 3,X+4,Y,Z);
    PickupPlayerDeath3 = CreatePickup(337, 3,X+5,Y,Z);
   
    GameTextForPlayer(playerid,"~r~L~b~O~r~L Y~Y~O~b~U ~r~D~b~I~g~E~y~D!!!",5000,5);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/kill", true) == 0)
    {
        SetPlayerHealth(playerid,0.0);
        return 1;
    }
    return 0;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
     // Has testing when player death droped weapons.
    if(pickupid == PickupPlayerDeath1)
    {
    GivePlayerMoney(playerid,15080);
        PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
        DestroyPickup(PickupPlayerDeath1);
        }
        if(pickupid == PickupPlayerDeath2)
    {
       GivePlayerWeapon(playerid,29,9999);
       PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
       DestroyPickup(PickupPlayerDeath2);
       }
       if(pickupid == PickupPlayerDeath3)
    {
    GivePlayerWeapon(playerid,6,9999);
    PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
    DestroyPickup(PickupPlayerDeath3);
        }
    return 1;
}

ScreenShot:


Free to comment it. ..

Known Bugs: Not. have tested it,

DOWNLOAD:
http://up.ht/ganC6B


Re: [FS]Weapons&MoneyOnPlayerDeath - Eirikm - 21.02.2011

....


Re: [FS]Weapons&MoneyOnPlayerDeath - Dr.Ghost - 21.02.2011

Quote:
Originally Posted by Eirikm
Посмотреть сообщение
Nice, always wanted things from gamerx server :P
yes xD .. thanks comment yea


Re: [FS]Weapons&MoneyOnPlayerDeath - Anzhelov - 22.02.2011

Good job


Re: [FS]Weapons&MoneyOnPlayerDeath - BBAT - 22.02.2011

SUGGESTION:

OnTop

pawn Код:
new moneyz;
Under OnPlayerDeath

pawn Код:
moneyz = GetPlayerMoney(playerid);
Under OnPlayerPickUpPickup

Replace

pawn Код:
GivePlayerMoney(playerid,15080);
To

pawn Код:
GivePlayerMoney(playerid,moneyz);



Re: [FS]Weapons&MoneyOnPlayerDeath - Kwarde - 22.02.2011

It's nice but, why not spawning the weapon as pickup that the player had in his hands, with the ammo that's left?


Re: [FS]Weapons&MoneyOnPlayerDeath - BBAT - 22.02.2011

For that one do this:

OnTop

pawn Код:
new weaponz;
new ammoz;
Under OnPlayerDeath

pawn Код:
weaponz = GetPlayerWeapon(playerid);
ammoz = GetPlayerAmmo(playerid);
Under OnPlayerPickUpPickup

Replace

pawn Код:
GivePlayerWeapon(playerid,29,9999);
with

pawn Код:
GivePlayerWeapon(playerid, weaponz, ammoz);



Re: [FS]Weapons&MoneyOnPlayerDeath - Dr.Ghost - 23.02.2011

Quote:
Originally Posted by BBAT
Посмотреть сообщение
For that one do this:

OnTop

pawn Код:
new weaponz;
new ammoz;
Under OnPlayerDeath

pawn Код:
weaponz = GetPlayerWeapon(playerid);
ammoz = GetPlayerAmmo(playerid);
Under OnPlayerPickUpPickup

Replace

pawn Код:
GivePlayerWeapon(playerid,29,9999);
with

pawn Код:
GivePlayerWeapon(playerid, weaponz, ammoz);
nice! sugguestion thanks all .


AW: [FS]Weapons&MoneyOnPlayerDeath - .LaaRs. - 23.02.2011

verry simple but funny ^^


Re: [FS]Weapons&MoneyOnPlayerDeath - Tee - 25.02.2011

Quote:
Originally Posted by BBAT
Посмотреть сообщение
For that one do this:

OnTop

pawn Код:
new weaponz;
new ammoz;
Under OnPlayerDeath

pawn Код:
weaponz = GetPlayerWeapon(playerid);
ammoz = GetPlayerAmmo(playerid);
Under OnPlayerPickUpPickup

Replace

pawn Код:
GivePlayerWeapon(playerid,29,9999);
with

pawn Код:
GivePlayerWeapon(playerid, weaponz, ammoz);
This is a nice suggestion.

When player dies. Get their pos. Get the weapons. Get the cash. Create a pickup with info from weapons and cash so that you an be accurate in what the other player picks u.