pickup question - 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: pickup question (
/showthread.php?tid=653516)
pickup question -
ShadowBlack - 06.05.2018
how i can use onplayeprickupickup or onplayerpickupdynamicpickup for an object
Re: pickup question -
Dayrion - 06.05.2018
You can't since it's reserved for
pickup only.
That's why those callbacks ar called
OnPlayerPickUpPickup.
Re: pickup question -
Lokii - 06.05.2018
you can create object and add dynamic area then check if player enter this area and do whatever you want to
Example:
PHP код:
#include <a_samp>
#include <streamer>
#define MAX_OBJECT_PICK 100
static ObjectPickup[MAX_OBJECT_PICK] = {-1, ...}; //array to store objects
static Area[MAX_OBJECT_PICK]; //array to store areas
public OnFilterScriptInit()
{
ObjectPickup[0] = CreateDynamicObject(model, Float:x, Float:y, Float:z, Float:RX, Float:RY, Float:RZ); //creating object
CreateDynamicSphere(Float:x, Float:y, Float:z, Float:size); //creating object
return 1;
}
public OnFilterScriptExit() //destroy objects on fs exit
{
for(new i = 0; i < MAX_OBJECT_PICK; i++) // loop
{
if(ObjectPickup[i] == -1) continue; //invalid object skip
DestroyDynamicObject(ObjectPickup[i]); //destroy object
DestroyDynamicArea(Area[i]); //destroy area
}
return 1;
}
public OnPlayerEnterDynamicArea(playerid, areaid)
{
if(areaid == Area[0]) //if area 0
{
//code for first object pickup
}
return 1;
}
Re: pickup question -
ShadowBlack - 06.05.2018
ahh, now i understand , thank you.