SA-MP Forums Archive
How can i make a custom pickupcallback? - 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: How can i make a custom pickupcallback? (/showthread.php?tid=620555)



How can i make a custom pickupcallback? - vassilis - 31.10.2016

Nvm.


Re: How can i make a custom pickupcallback? - StrikerZ - 31.10.2016

PHP код:
OnPlayerEnterExistPickup(playerid, [ur pickupid number]); 
for ex
PHP код:
OnPlayerEnterExistPickup(playerid1); 
And forward the public as well.


Re: How can i make a custom pickupcallback? - vassilis - 31.10.2016

Quote:
Originally Posted by Sunehildeep
Посмотреть сообщение
PHP код:
OnPlayerEnterExistPickup(playerid, [ur pickupid number]); 
for ex
PHP код:
OnPlayerEnterExistPickup(playerid1); 
And forward the public as well.
You didn't understand what i want. Nevermind.


Re: How can i make a custom pickupcallback? - Threshold - 31.10.2016

It really depends on what you mean by functionality. If you mean houses, teleports etc. then it's pretty easy to accomplish what you want. For example, if I had house pickups and I used an array called 'HousePickups':

PHP код:
// When I create my house pickups:
HousePickups[index][PickupID] = CreatePickup(...

OnPlayerPickUpPickup(playeridpickupid) {
    for(new 
0sizeof(HousePickups); i++) {
        if(
pickupid == HousePickups[i][PickupID]) {
            
CallLocalFunction("OnPlayerEnterHousePickup""iii"playeridipickupid);
            break;
        }
    }
    return 
1;
}

forward OnPlayerEnterHousePickup(playeridindexpickupid);
public 
OnPlayerEnterHousePickup(playeridindexpickupid) return 1
Again, this is a short example written on a phone, but are you referring to something like this example?


Re: How can i make a custom pickupcallback? - vassilis - 31.10.2016

Quote:
Originally Posted by Threshold
Посмотреть сообщение
It really depends on what you mean by functionality. If you mean houses, teleports etc. then it's pretty easy to accomplish what you want. For example, if I had house pickups and I used an array called 'HousePickups':

PHP код:
// When I create my house pickups:
HousePickups[index][PickupID] = CreatePickup(...
OnPlayerPickUpPickup(playeridpickupid) {
    for(new 
0sizeof(HousePickups); i++) {
        if(
pickupid == HousePickups[i][PickupID]) {
            
CallLocalFunction("OnPlayerEnterHousePickup""iii"playeridipickupid);
            break;
        }
    }
    return 
1;
}
forward OnPlayerEnterHousePickup(playeridindexpickupid);
public 
OnPlayerEnterHousePickup(playeridindexpickupid) return 1
Again, this is a short example written on a phone, but are you referring to something like this example?
Hmm I guess yes Thanks Threshold!


Re: How can i make a custom pickupcallback? - vassilis - 31.10.2016

EDIT: MISSed double post, apologising.
@Threshold i did how you mention and works correctly thanks.