Moneybag drops under ground
#1

pawn Код:
#include <a_samp>

new Moneys;
new Cashdrop1;

public OnPlayerDeath(playerid, killerid, reason)
{
        if(GetPlayerMoney(playerid) > 0)
        {
                Moneys = GetPlayerMoney(playerid)/5;
                ResetPlayerMoney(playerid);
                new Float:x,Float:y,Float:z;
                GetPlayerPos(playerid,x,y,z);
                Cashdrop1 = CreatePickup(1550,4,x,y,z-0.8);
        }
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == Cashdrop1) GivePlayerMoney(playerid,Moneys), DestroyPickup(Cashdrop1);
    return 1;
}
its an moneybag so if he died he goes cash away but anything and when i pick it up comes not the same cash

i got this one https://sampforum.blast.hk/showthread.php?tid=156722 and it shows(moneybag) the half of it in the ground the other above

Thanks, Sorry for bad english.
Reply
#2

So the moneybag is partly in the ground? If this is the same at every position, try increasing the z-value on the CreatePickup line, e.g. edit -0.8 to -0.6 etc.
Reply
#3

If i make the -0.8 and the other one to an 0 and 0 it will work?? let see.

Works but when i do
/5 //for the full
It does
$4231
gives only $831 or something??
Reply
#4

Err.... It's always confusing what people mean, it's like a damn riddle.. so I'm going to guess.

Код:
Moneys = GetPlayerMoney(playerid)/5;
This line, yer? the variable 'Moneys' will be equal to the money the dead player had, divided by 5 (/5 = divide by 5)
so, if the person had $5000, he dies, the money bag will drop on the floor you pick it up and you get.... wait for it...... wait for it..... $1000!!!

Alright, that's about it I guess.. Happy scripting!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)