how to make DeathPickup
#6

This could bug, if more than 1 guy dies

Write it like this:

PHP код:
new Death_Pick[3][MAX_PLAYERS];
public 
OnPlayerDeath(playerid,killerid,reason)
{
    if(
GetPlayerMoney(playerid) > 0)
    {
        
Death_Pick[0][playerid] = GetPlayerMoney(playerid);
        
GivePlayerMoney(playerid,-Death_Pick[0][playerid]);
        new 
Float:xFloat:yFloat:z;
        
GetPlayerPos(playeridxyz);
        
Death_Pick[1][playerid] = CreatePickup(12122xyzGetPlayerVirtualWorld(playerid));
        
Death_Pick[2][playerid] = SetTimerEx("@dP",1000*15,0,"i",playerid);
    }
    else 
SendClientMessage(playerid,-1,"* Lucker, you have no money to loose!");
    return 
1;
}
@
dP(i);@dP(i) return DestroyPickup(Death_Pick[1][i]),Death_Pick[1][i]=0;
public 
OnPlayerPickUpPickup(playeridpickupid)
{
    for(new 
ii<MAX_PLAYERSi++) {
        if(
Death_Pick[1][i] != pickupid) continue;
        
GivePlayerMoney(playerid,Death_Pick[0][i]),
        
DestroyPickup(Death_Pick[1][i]),
        
KillTimer(Death_Pick[2][i]),
        
Death_Pick[1][i]=0;
        break;
    }
    return 
1;

Greekz
Reply


Messages In This Thread
how to make DeathPickup - by FrankLucretti - 01.06.2015, 11:57
Re: how to make DeathPickup - by Greaper - 01.06.2015, 12:19
Re: how to make DeathPickup - by MafiaOink - 01.06.2015, 12:33
Re: how to make DeathPickup - by FrankLucretti - 01.06.2015, 12:55
Re: how to make DeathPickup - by hamzajaved780 - 01.06.2015, 13:07
AW: how to make DeathPickup - by Kaliber - 01.06.2015, 13:26
Re: AW: how to make DeathPickup - by FrankLucretti - 01.06.2015, 13:34
Re: how to make DeathPickup - by FrankLucretti - 01.06.2015, 13:36
AW: Re: how to make DeathPickup - by Kaliber - 01.06.2015, 13:40

Forum Jump:


Users browsing this thread: 1 Guest(s)