SA-MP Forums Archive
/createpickup - 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)
+--- Thread: /createpickup (/showthread.php?tid=571430)



/createpickup - suni - 18.04.2015

i cant get this fix. creating a pickup and setting the amounts of money on it . who ever pick it up will get the amount of money from the pickup. please help.


Re: /createpickup - Azula - 18.04.2015

let's start
PHP код:
new mypickup[MAX_PLAYERS]; 
// create cmd 
mypickup[playerid] = CreatePickup/// script ) ; 
// callback on player enter pickups
if(pickupid == mypickup[playerid])
    {
        
GivePlayerMoney(playerid1000);
DestroyPickup(mypickup[playerid]);
    } 



Re: /createpickup - lanix - 18.04.2015

Something like this:



Код:
new pickup1;

public OnGameModeInit()
      pickup1 = CreatePickup(1318,9000000,-1033.5370,-1189.0121,129.2188);//Position of Pickup

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == pickup1)//Name of pickup
    {
       GivePlayerMoney(playerid, 800);//Amount
       return 1;
}
    }



Re: /createpickup - suni - 18.04.2015

yes. the both of you did it right but i mean like set the amount of money on anypickup i create. like this

Quote:

/createpickup 1212(object id) 500(the amount of money)




Re: /createpickup - suni - 19.04.2015

i need help


Re: /createpickup - justice96 - 19.04.2015

Код:
[new]
new vehrepair;
 
public OnGameModeInit()
{
        Create3DTextLabel("Grab it fast!\n$500 dude!", text, color, x,y,z, drawdistance, virtualworld, testLOS);
        vehrepair = CreatePickup(model, pickupsid, x,y,z, virtualworld (-1 to make it show all worlds));
        return 1;
}
 
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == vehrepair)
    {
        GivePlayerMoney(playerid,500);     
    }
    return 1;
}