OnPlayerPickUpPickup HELP
#1

Hi,i wont to make when player enter pickup,put him into vehicle.
I do this but only one time put me in vehicle.I think you understand me because i don't know to speak perfect english.
PHP код:
new INFERNUS
PHP код:
INFERNUS AddStaticPickup(1240,2,2114.8801,-2426.1147,13.5469,0); 
PHP код:
    if(pickupid == INFERNUS)
    {
        
PutPlayerInVehicle(playeridINFERNUS0);
        
GetPlayerPos(playeridX,Y,Z);
        
INFERNUS CreateVehicle(411X,Y,Z0.00060000);
    } 
Reply
#2

Код:
new CustomPickup;
new Infernus;
Код:
CustomPickup = AddStaticPickup(1240,2,2114.8801,-2426.1147,13.5469,0);
Код:
if(pickupid == CustomPickup) 
    { 
        new Float:X, Float:Y, Float:Z);
        GetPlayerPos(playerid, X,Y,Z); 
        Infernus = CreateVehicle(411, X,Y,Z, 0.0, 0, 0, 60000); 
        PutPlayerInVehicle(playerid, Infernus, 0);
    }
Reply
#3

It's because you changed the "INFERNUS" variable from the pickup id to the vehicle id.

This should work:

pawn Код:
new Infernus_Pickup, Infernus;

Infernus_Pickup = AddStaticPickup(1240, 2, 2114.8801, -2426.1147, 13.5469, 0);

if(pickupid == Infernus_Pickup)
{
    if(GetVehicleModel(Infernus)) DestroyVehicle(Infernus);

    new Float:Pos[4];
    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    GetPlayerFacingAngle(playerid, Pos[3]);
    Infernus = CreateVehicle(411, Pos[0], Pos[1], Pos[2], Pos[3], -1, -1, 60000);
    PutPlayerInVehicle(playerid, Infernus, 0);
}
Edit: Ninja'd
Reply
#4

@Jason
It's work,but i made two pickups and when i enter in one he spawn me NRG and INFERNUS..i do this:

PHP код:
new NRGNRG1;
new 
INFERNUSINFERNUS1
PHP код:
NRG1 AddStaticPickup(1240,2,2118.9846,-2425.7520,13.5469,0);
INFERNUS1 AddStaticPickup(1240,2,2127.5208,-2430.4951,13.5469,0); 
PHP код:
public OnPlayerPickUpPickup(playeridpickupid)
{
    if(
pickupid == NRG1)
    {
        
GetPlayerPos(playeridX,Y,Z);
        
NRG CreateVehicle(522X,Y,Z0.00060000);
        
PutPlayerInVehicle(playeridNRG0);
    }
    if(
pickupid == INFERNUS1)
    {
        
GetPlayerPos(playeridX,Y,Z);
        
INFERNUS CreateVehicle(411X,Y,Z0.00060000);
        
PutPlayerInVehicle(playeridINFERNUS0);
    }
    return 
1;

Reply
#5

Its because you forgot new Float, Float:y, Float:z;

Wich wil be used for GetPlayerPos
Reply
#6

Again nothing..
PHP код:
public OnPlayerPickUpPickup(playeridpickupid)
{
    if(
pickupid == NRG1)
    {
        new 
Float:XFloat:YFloat:Z;
        
GetPlayerPos(playeridX,Y,Z);
        
NRG CreateVehicle(522X,Y,Z0.00060000);
        
PutPlayerInVehicle(playeridNRG0);
    }
    if(
pickupid == INFERNUS1)
    {
        new 
Float:XFloat:YFloat:Z;
        
GetPlayerPos(playeridX,Y,Z);
        
INFERNUS CreateVehicle(411X,Y,Z0.00060000);
        
PutPlayerInVehicle(playeridINFERNUS0);
    }
    return 
1;

Reply
#7

Here:

Код:
new InfernusPickup, NrgPickup, Nrg, Infernus;
Код:
NrgPickup = AddStaticPickup(1240,2,2118.9846,-2425.7520,13.5469,0);
InfernusPickup = AddStaticPickup(1240,2,2127.5208,-2430.4951,13.5469,0);
Код:
public OnPlayerPickUpPickup(playerid, pickupid) 
{ 
    if(pickupid == NrgPickup) 
    { 
        new Float:X, Float:Y, Float:Z);
        GetPlayerPos(playerid, X,Y,Z); 
        Nrg = CreateVehicle(522, X,Y,Z, 0.0, 0, 0, 60000); 
        PutPlayerInVehicle(playerid, Nrg, 0); 
    } 
    if(pickupid == InfernusPickup) 
    { 
        new Float:X, Float:Y, Float:Z);
        GetPlayerPos(playerid, X,Y,Z); 
        Infernus = CreateVehicle(411, X,Y,Z, 0.0, 0, 0, 60000); 
        PutPlayerInVehicle(playerid, Infernus, 0); 
    } 
    return 1; 
}
Reply
#8

damn! again the same..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)