pickup question
#1

how i can use onplayeprickupickup or onplayerpickupdynamicpickup for an object
Reply
#2

You can't since it's reserved for pickup only.
That's why those callbacks ar called OnPlayerPickUpPickup.
Reply
#3

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(modelFloat:xFloat:yFloat:zFloat:RXFloat:RYFloat:RZ); //creating object
    
CreateDynamicSphere(Float:xFloat:yFloat:zFloat:size); //creating object
    
return 1;
}
public 
OnFilterScriptExit() //destroy objects on fs exit
{
    for(new 
0MAX_OBJECT_PICKi++) // loop
    
{
        if(
ObjectPickup[i] == -1) continue; //invalid object skip
        
DestroyDynamicObject(ObjectPickup[i]); //destroy object
        
DestroyDynamicArea(Area[i]); //destroy area
    
}
    return 
1;
}
public 
OnPlayerEnterDynamicArea(playeridareaid)
{
    if(
areaid == Area[0]) //if area 0
    
{
        
//code for first object pickup
    
}
    return 
1;

Reply
#4

ahh, now i understand , thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)