SA-MP Forums Archive
Picks up (pickup) from long distance - 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: Picks up (pickup) from long distance (/showthread.php?tid=631121)



Picks up (pickup) from long distance - Pokemon64 - 23.03.2017

Hi
How need make script like this, if pickup is a long distance away he will take it. Anyway it should look like this, if anyone dead this code should take that pickup and get like for example 5 score and when he took that pickup that pickup is destroyed. Its like magnet


Re: Picks up (pickup) from long distance - Private200 - 23.03.2017

PHP код:
new pickup;

public 
OnGameModeInit()
{
     
pickup CreatePickup(model11503.33591432.358510.1191, -1);
     return 
1;
}

public 
OnPlayerPickUpPickup(playeridpickupid)
{
    if(
pickupid == pickup)
    {
        
// do what you want
        
DestroyPickup(pickup);
    }
    return 
1;

Something like that should work.


Re: Picks up (pickup) from long distance - Pokemon64 - 23.03.2017

Quote:
Originally Posted by Private200
Посмотреть сообщение
PHP код:
new pickup;
public 
OnGameModeInit()
{
     
pickup CreatePickup(model11503.33591432.358510.1191, -1);
     return 
1;
}
public 
OnPlayerPickUpPickup(playeridpickupid)
{
    if(
pickupid == pickup)
    {
        
// do what you want
        
DestroyPickup(pickup);
    }
    return 
1;

Something like that should work.
I mean not how to create i talking about how need make take pickups around me from long distance and get score from it. With your code i need walk into pickup and then get something i need take it from long distance


Re: Picks up (pickup) from long distance - Flamehaze7 - 23.03.2017

Quote:
Originally Posted by Pokemon64
Посмотреть сообщение
I mean not how to create i talking about how need make take pickups around me from long distance and get score from it. With your code i need walk into pickup and then get something i need take it from long distance
You can create Dynamic Checkpoints or even define Areas with IsPlayerInArea


Re: Picks up (pickup) from long distance - Pokemon64 - 23.03.2017

Quote:
Originally Posted by Flamehaze7
Посмотреть сообщение
You can create Dynamic Checkpoints or even define Areas with IsPlayerInArea
Example?


Re: Picks up (pickup) from long distance - LazzyBoy - 24.03.2017

Код:
 OnPlayerEnterDynamicArea
     {
       if(IsPlayerInRangeOfPoint(playerid,range, x ,y ,z) 
          {
             Give player score and delete the pickup 
           }
       }
Im really sorry cuz ive phone worten this thing