23.07.2016, 21:15
Hey guy.
I made a money drop.
So if a player dies it will drup 5 cash pickups and each pickup will give the player 100$ cash.
My problem: The player walks in the pickups and they will be gone. If the player respawns the pickups will appear again.
How to fix that the pickups will stay gone after a player picked it up?
Codes:
Please help me
I made a money drop.
So if a player dies it will drup 5 cash pickups and each pickup will give the player 100$ cash.
My problem: The player walks in the pickups and they will be gone. If the player respawns the pickups will appear again.
How to fix that the pickups will stay gone after a player picked it up?
Codes:
PHP код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == cash)
{
GivePlayerMoney(playerid,100);
}
else if(pickupid == cash2)
{
GivePlayerMoney(playerid,100);
}
else if(pickupid == cash3)
{
GivePlayerMoney(playerid,100);
}
else if(pickupid == cash4)
{
GivePlayerMoney(playerid,100);
}
else if(pickupid == cash5)
{
GivePlayerMoney(playerid,100);
}
return 1;
}
PHP код:
public OnPlayerDeath(playerid, killerid, reason)
{
new Float:x,Float:y,Float:z;
ResetPlayerMoney(playerid);
GetPlayerPos(playerid,x,y,z);
cash = CreatePickup(1212,8,x,y,z);
cash2 = CreatePickup(1212,8,x+1,y,z);
cash3 = CreatePickup(1212,8,x-1,y,z);
cash4 = CreatePickup(1212,8,x,y+1,z);
cash5 = CreatePickup(1212,8,x,y-1,z);
}