How can you create a repair pickup
#1

Hey guys, How can you create a Repair pickup? ^^

The Location is : 2030.0023,-1863.4410,13.5481,178.4680
Reply
#2

pawn Код:
//example
new repairp;

public OnGameModeInit()
{
    repairp = CreatePickup(ID, 2, X, Y, Z, -1);
    // Remplace ID by your pickup ID. -1 = virtual world
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == repairp) // if he is on the repair pickup
    {
        // if he is in a veh
        RepairVehicle(GetPlayerVehicleID(playerid));
    }
    return 1;
} // matnix
Visit these link https://sampwiki.blast.hk/wiki/PickupTypes and https://sampwiki.blast.hk/wiki/Pickup_IDs
Reply
#3

https://sampwiki.blast.hk/wiki/CreatePickup


pawn Код:
new repair_pickup;
pawn Код:
//In ongamemodeinit..
repair_pickup =  CreatePickup(1242, 14, 2030.0023,-1863.4410,13.5481, -1);
https://sampwiki.blast.hk/wiki/OnPlayerPickUpPickup
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == repair_pickup)
    {
         if(IsPlayerInAnyVehicle(playerid)) {
              RepairVehicle(GetPlayerVehicleID(playerid));
         }
    }
    return 1;
}
https://sampwiki.blast.hk/wiki/RepairVehicle
Reply
#4

Quote:
Originally Posted by iJumbo
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/CreatePickup


pawn Код:
new repair_pickup;
pawn Код:
//In ongamemodeinit..
repair_pickup =  CreatePickup(1242, 14, 2030.0023,-1863.4410,13.5481, -1);
https://sampwiki.blast.hk/wiki/OnPlayerPickUpPickup
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == repair_pickup)
    {
         if(IsPlayerInAnyVehicle(playerid)) {
              RepairVehicle(GetPlayerVehicleID(playerid));
         }
    }
    return 1;
}
https://sampwiki.blast.hk/wiki/RepairVehicle
How can you do that it stays for ever and not go away
Reply
#5

Set the param that is 14 to 1
Reply
#6

And how can you use it everytime?
Reply
#7

Well what you mean with everytime?
Reply
#8

Nevermind, I already did it Thanks for your help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)