15.06.2009, 12:16
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)"
This code is not tested! And i dosent know if the timer is working...
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;
}