#1

i try to create pickup for change car
but its not change the car for the players
PHP код:
new Pickups[4];
new 
Pickups2[4]; 
PHP код:
    Pickups[0] = CreateDynamicPickup(13141, -2334.0427, -3311.5967195.1423);
    
Pickups2[1] = CreateDynamicPickup(13141, -3064.8191, -3764.05627.7760); 
PHP код:
public OnPlayerPickUpDynamicPickup(playeridpickupid)
{
    for(new 
i4i++)if(Pickups[i] == pickupid)ChangeVehicle(playerid451);
    for(new 
i4i++)if(Pickups2[i] == pickupid)ChangeVehicle(playerid411);
    return 
1;
}
forward ChangeVehicle(playervehicle);
public 
ChangeVehicle(playervehicle)
{
    if(
IsPlayerInAnyVehicle(player))
    {
        
n
ew veh 
GetPlayerVehicleID(player);
        new 
Float:ang;
        
GetVehicleZAngle(vehang);
        new 
Float:pos[3];
        
GetVehiclePos(vehpos[0], pos[1], pos[2]);
        new 
Float:velo[3];
        
GetVehicleVelocity(vehvelo[0], velo[1], velo[2]);
        
DestroyVehicle(veh);
        
veh CreateVehicle(vehiclepos[0], pos[1], pos[2]+0.5ang, -1, -1, -1);
        
PutPlayerInVehicle(playervehicle0);
        
SetVehicleVelocity(vehvelo[0], velo[1], velo[2]);
        return 
1;
    }
    return 
1;

Reply
#2

Код:

#define MAX_PICKUPS 2

new Pickups[MAX_PICKUPS];

public OnGameModeInit()
{
       Pickups[0] = CreateDynamicPickup(1314, 1, -2334.0427, -3311.5967, 195.1423);
       Pickups[1] = CreateDynamicPickup(1314, 1, -3064.8191, -3764.0562, 7.7760); 
       return 1;
}


public OnPlayerPickUpDynamicPickup(playerid, pickupid) 
{ 
    if(pickupid == Pickups[0]) ChangeVehicle(playerid, 451);  
    if(pickupid == Pickups[1]) ChangeVehicle(playerid, 411); 
    return 1; 
} 

forward ChangeVehicle(player, vehicle); 
public ChangeVehicle(player, vehicle) 
{ 
    if(IsPlayerInAnyVehicle(player)) 
    { 
        new veh = GetPlayerVehicleID(player); 
        new Float:ang; 
        GetVehicleZAngle(veh, ang); 
        new Float:pos[3]; 
        GetVehiclePos(veh, pos[0], pos[1], pos[2]); 
        new Float:velo[3]; 
        GetVehicleVelocity(veh, velo[0], velo[1], velo[2]); 
        DestroyVehicle(veh); 
        veh = CreateVehicle(vehicle, pos[0], pos[1], pos[2]+0.5, ang, -1, -1, -1); 
        PutPlayerInVehicle(player, vehicle, 0); 
        SetVehicleVelocity(veh, velo[0], velo[1], velo[2]); 
        return 1; 
    } 
    return 1; 
}
OR

Try to update ur Streamer Plugin.

https://sampforum.blast.hk/showthread.php?tid=102865/
Reply
#3

Quote:
Originally Posted by kingmk
Посмотреть сообщение
Код:

#define MAX_PICKUPS 2

new Pickups[MAX_PICKUPS];

public OnGameModeInit()
{
       Pickups[0] = CreateDynamicPickup(1314, 1, -2334.0427, -3311.5967, 195.1423);
       Pickups[1] = CreateDynamicPickup(1314, 1, -3064.8191, -3764.0562, 7.7760); 
       return 1;
}


public OnPlayerPickUpDynamicPickup(playerid, pickupid) 
{ 
    if(pickupid == Pickups[0]) ChangeVehicle(playerid, 451);  
    if(pickupid == Pickups[1]) ChangeVehicle(playerid, 411); 
    return 1; 
} 

forward ChangeVehicle(player, vehicle); 
public ChangeVehicle(player, vehicle) 
{ 
    if(IsPlayerInAnyVehicle(player)) 
    { 
        new veh = GetPlayerVehicleID(player); 
        new Float:ang; 
        GetVehicleZAngle(veh, ang); 
        new Float:pos[3]; 
        GetVehiclePos(veh, pos[0], pos[1], pos[2]); 
        new Float:velo[3]; 
        GetVehicleVelocity(veh, velo[0], velo[1], velo[2]); 
        DestroyVehicle(veh); 
        veh = CreateVehicle(vehicle, pos[0], pos[1], pos[2]+0.5, ang, -1, -1, -1); 
        PutPlayerInVehicle(player, vehicle, 0); 
        SetVehicleVelocity(veh, velo[0], velo[1], velo[2]); 
        return 1; 
    } 
    return 1; 
}
OR

Try to update ur Streamer Plugin.

https://sampforum.blast.hk/showthread.php?tid=102865/
its dont work
and i update streamer plugin and include and i have warning in this line
#define MAX_PICKUPS 2
Reply
#4

Quote:
Originally Posted by BFire
Посмотреть сообщение
its dont work
and i update streamer plugin and include and i have warning in this line
#define MAX_PICKUPS 2
What kind of warning does it shows? Please show us those errors/warnings.
Reply
#5

PHP код:
new Pickups[2];
Pickups[0] = CreatePickup(13141, -2334.0427, -3311.5967195.14230); 
Pickups[1] = CreatePickup(13141, -3064.8191, -3764.05627.77600);
public 
OnPlayerPickUpPickup(playeridpickupid

    if(
pickupid == Pickups[0])
    {
        
ChangeVehicle(playerid451);
        return 
1;
    }
    else if(
pickupid == Pickups[1])
    {
        
ChangeVehicle(playerid411);
        return 
1;
    }
    return 
1

forward ChangeVehicle(playeridvehicle); 
public 
ChangeVehicle(playeridvehicle

    if(
IsPlayerInAnyVehicle(playerid)) 
    {
        new 
veh GetPlayerVehicleID(playerid), Float:pos[3], Float:angFloat:velo[3]; 
        
GetVehiclePos(vehpos[0], pos[1], pos[2]);
        
GetVehicleZAngle(vehang);          
        
GetVehicleVelocity(vehvelo[0], velo[1], velo[2]); 
        
DestroyVehicle(veh); 
        
        
veh CreateVehicle(vehiclepos[0], pos[1], pos[2]+0.5ang, -1, -1, -1); 
        
PutPlayerInVehicle(playeridvehicle0); 
        
SetVehicleVelocity(vehvelo[0], velo[1], velo[2]); 
        return 
1
    } 
    return 
1

If it still doesn't work remember to follow everything correctly

types of pills

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

simple tutorial

https://sampforum.blast.hk/showthread.php?tid=200238
Reply
#6

Quote:
Originally Posted by Undef1ned
Посмотреть сообщение
PHP код:
new Pickups[2];
Pickups[0] = CreatePickup(13141, -2334.0427, -3311.5967195.14230); 
Pickups[1] = CreatePickup(13141, -3064.8191, -3764.05627.77600);
public 
OnPlayerPickUpPickup(playeridpickupid

    if(
pickupid == Pickups[0])
    {
        
ChangeVehicle(playerid451);
        return 
1;
    }
    else if(
pickupid == Pickups[1])
    {
        
ChangeVehicle(playerid411);
        return 
1;
    }
    return 
1

forward ChangeVehicle(playeridvehicle); 
public 
ChangeVehicle(playeridvehicle

    if(
IsPlayerInAnyVehicle(playerid)) 
    {
        new 
veh GetPlayerVehicleID(playerid), Float:pos[3], Float:angFloat:velo[3]; 
        
GetVehiclePos(vehpos[0], pos[1], pos[2]);
        
GetVehicleZAngle(vehang);          
        
GetVehicleVelocity(vehvelo[0], velo[1], velo[2]); 
        
DestroyVehicle(veh); 
        
        
veh CreateVehicle(vehiclepos[0], pos[1], pos[2]+0.5ang, -1, -1, -1); 
        
PutPlayerInVehicle(playeridvehicle0); 
        
SetVehicleVelocity(vehvelo[0], velo[1], velo[2]); 
        return 
1
    } 
    return 
1

If it still doesn't work remember to follow everything correctly

types of pills

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

simple tutorial

https://sampforum.blast.hk/showthread.php?tid=200238
its stiil not work
Reply
#7

Then, do a debugging.

PHP код:
public OnPlayerPickUpPickup(playeridpickupid)  
{  
    if(
pickupid == Pickups[0]) 
    { 
        print(
"pickup 1");
        
ChangeVehicle(playerid451); 
        return 
1
    } 
    else if(
pickupid == Pickups[1]) 
    {
        print(
"pickup 2");
        
ChangeVehicle(playerid411); 
        return 
1
    } 
    return 
1;  

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)