SA-MP Forums Archive
My problems with the pickups on 0.3 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: My problems with the pickups on 0.3 (/showthread.php?tid=99997)



My problems with the pickups on 0.3 - Mr.Z - 02.10.2009


1: DropMoney System, the pickup is created when the player dies, but the pickup appears and it disappears after quickly.

2: Something happens similar to my system of houses, when I place a house for sale the blue pickup it should be destroyed and the green pickup created, but the green pickup but disappears after quickly.

3: DropWeapon System, after check the present weapons in all the player's slots would be created the pickups. But the first weapon found doesn't appear. Example: The player has a pistol, a tec and a shotgun, when he dies only tec and the shotgun is created.

Note 1: This worked perfectly in 0.2x
Note 2: I am using -1 for the new parameter VW of the function

I think the problem should be the same, therefore I will post part of the a code:
pawn Код:
stock DropMoney(playerid)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    if(GetPlayerMoney(playerid)>0)
    {
        for(new p,bool:found=false;p<MAX_DEATH_PICKUP && found==false;p++)
        {
            if(Pickup[p][p_created]==false)
            {
             Pickup[p][p_pickupid]=CreatePickup(1212,19,x+random(5),y+random(5),z-0.3,-1);
             Pickup[p][p_money]=GetPlayerMoney(playerid);
             Pickup[p][p_timetolive]=60;
             Pickup[p][p_created]=true;
             ResetPlayerMoney(playerid);
             found=true;
            }
        }
    }
}

Thanks
Sorry bad english




Re: My problems with the pickups on 0.3 - Balon - 02.10.2009

Try with another pickup type - 2 for example.

By the way.. Instead of:
pawn Код:
for(new p,bool:found=false;p<MAX_DEATH_PICKUP && found==false;p++)
pawn Код:
found=true;
use just
pawn Код:
for(new p = 0; p < MAX_DEATH_PICKUP; p++)
pawn Код:
break;