When an player death
#1

hi

How I can do that when i kill a player, creates a pickup in the place where he died with his money, that I can take and if I forgot to take or not take a player to destroy it to make an X seconds?
I don't need another FS from this forum, only a simple script.
Reply
#2

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
CreatePickup(356, 3, X,Y,Z, -1) // M4 Pickup
}
Try this, wrote in few seconds...

PS: For Pickup money you can Add a new Pickup around of Player in Pos Random.
Reply
#3

And a timer to call DestroyPickup.
Reply
#4

and how i can took all the money had that player in one pickup ... ? ?
Reply
#5

When a Player death, use GetPlayerMoney for set a Money in a Var/Array.
(Ex. new Pick_VarMoney = GetPlayerMoney(playerid);)

After, Create a Pickup, type 1 under Var.
In OnPlayerPickUpPickup, Destroy the Pickup and give the $ to Player.
(Ex: GivePlayerMoney(playerid, Pick_VarMoney);)
Reply
#6

Hust do something like this
pawn Код:
forward DestroyDeathMoney(playerid);

new DeathMoney;

public OnPlayerDeath(playerid, killerid, reason)
{
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    DeathMoney = CreatePickup(1212, 3, X, Y, Z, -1);
}

public DestroyDeathMoney(playerid)
{
    DestroyPickup(DeathMoney);
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == DeathMoney)
    {
        new GetRandomMoney = random(1234) + 345;
        GivePlayerMoney(playerid, GetRandomMoney);
        DestroyPickup(DeathMoney);
       
        new string[64];
        format(string,sizeof(string),"You picked up: $%d from someones dead body", GetRandomMoney);
        SendClientMessage(playerid, 0xFFFFFFAA, string);
        return 1;
    }
    return 1;
}
Simple and working ^^
Reply
#7

I have a problem, when i pickup up another pickup(armour, guns and others) shows "You picked up: $945 from someones dead body."
Reply
#8

help me someone, please .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)