01.06.2015, 13:07
Now it should work
Код:
// This should be at the top under includes new pMoneyDeath[MAX_PLAYERS]; new LastMoney; new death_pickup; forward messagepickup(); public OnPlayerDeath(playerid, killerid, reason) { GetPlayerMoney(playerid, pMoneyDeath[playerid]); // Declare 3 float variables to store the X, Y and Z coordinates in new Float:x, Float:y, Float:z; // Use GetPlayerPos, passing the 3 float variables we just created GetPlayerPos(playerid, x, y, z); // Create a cash pickup at the player's position death_pickup = CreatePickup(1212, 4, x, y, z, -1); //Change the pickupid if you want SetTimer("messagepickup", 15000, false); LastMoney = pMoneyDeath[playerid]; return 1; } public messagepickup() { //some time later... DestroyPickup(death_pickup); } public OnPlayerPickUpPickup(playerid, pickupid) { if(pickupid == death_pickup) { GivePlayerMoney(playerid, LastMoney); } return 1; }