18.07.2009, 09:53
Quote:
Originally Posted by sggassasin
thx for the help man you wouldent happen to know how to make it so when the player picks it up no 1 can get the case and when that play dies the case drops and after like 1min it respawns at its location would you thx for the help
|
pawn Код:
#include <a_samp>
new Pickup;
new PlayerMoney;
new PlayerMoneyPickup;
public OnGameModeInit()
{
Pickup = CreatePickup(1212, 2, Float:x, Float:y, Float:z);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
PlayerMoney = GetPlayerMoney(playerid);
PlayerMoneyPickup = CreatePickup(1212, 2, Float:x, Float:y, Float:z);
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == Pickup)
{
GivePlayerMoney(playerid, amount);
DestroyPickup(Pickup);
return 1;
}
if(pickupid == PlayerMoneyPickup)
{
GivePlayerMoney(playerid, PlayerMoney);
DestroyPickup(PlayerMoneyPickup);
return 1;
}
return 1;
}
@Karlip: Oh, I forgot that. :S