Money Drop all the player money?
#1

i searche script for money drop but i find only things that give u a certain sum of money when a pleyer death.
i want a script that if a player die, and he have 3456$, the pickups spawn with a total amount of 3456$. I want that pickups have the same amount of the player sum (because when a player die he lose all money in my server)
Reply
#2

Try this:
forward DestroyPickup();//at the top of your script
new pick3;//at the top of your script
new pickuptimer;//at the top of your script
new DropMoney;//at the top of your script



DropMoney = GetPlayerMoney(playerid);//in "public OnPlayerDeath(playerid, killerid, reason)"
pickuptimer = SetTimerEx("DestroyPickup",1000, 0, "i");//in "public OnPlayerDeath(playerid, killerid, reason)"
pick3 = CreatePickup(1550,3,x,y-0.5,z);//in "public OnPlayerDeath(playerid, killerid, reason)"


pawn Код:
public DestroyPickup()
{
    DestroyPickup(pick3);
}
 
public OnPlayerPickUpPickup( playerid, pickupid )
{
    if(pickupid == pick3)
    {
    new string[128];
    format(string, sizeof(string), "You found %d$ in the money bag!", DropMoney);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    GivePlayerCash(playerid,DropMoney);
    DestroyPickup(pickupid);
    }
    return 1;
}
This code is not tested! And i dosent know if the timer is working...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)