SetPlayerCheckpoint
#1

PHP код:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    new 
Veh GetPlayerVehicleID(playerid);
    if(
Veh == 448)
    {
         if(
pInfo[playerid][IsPlayerPizzaboy] == true)
           {
            new 
rand random(sizeof(pizzaDelivery));
            
SetPlayerCheckpoint(playeridpizzaDelivery[rand][0], pizzaDelivery[rand][1], pizzaDelivery[rand][2], 3.0);
           }
    }
    return 
1;

This is my code, however, the checkpoint does not appear. No errors, warnings.
Reply
#2

did you make cords of checkpoints?

example
pawn Код:
new Float:pizzaDelivery[][] =
{
    {Here cords}
};
Reply
#3

Are you sure you did enter Pizza Boi Vehicle ?
Reply
#4

Replace
pawn Код:
new Veh = GetPlayerVehicleID(playerid);
pawn Код:
new Veh = GetVehicleModel(GetPlayerVehicleID(playerid));
Reply
#5

Should be
if( GetVehicleModel( Veh ) == 448 )
Reply
#6

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
     if(GetVehicleModel(vehicleid) == 448)
    {
         if(pInfo[playerid][IsPlayerPizzaboy] == true)
           {
            new rand = random(sizeof(pizzaDelivery));
            SetPlayerCheckpoint(playerid, pizzaDelivery[rand][0], pizzaDelivery[rand][1], pizzaDelivery[rand][2], 3.0);
           }
    }
    return 1;
}
This work fine, I'm pretty sure, You have something wrong with that random coordinates.
Reply
#7

I've tried everything, but nothing works.
Reply
#8

Make sure your Float: pizzaDelivery is set to 3 values.Could you show use you "new Float: pizzaDelivery" please
Reply
#9

PHP код:
static Float:pizzaDelivery[20][3] =
{
    {-
2378.99781317.874116.0611},
    {-
2354.71021263.686926.2144},
    {-
2371.49291115.632955.7266},
    {-
2458.66061133.675455.7266},
    {-
2577.22491145.591755.7266},
    {-
2599.4448969.217078.2836},
    {-
2570.1301916.184864.9844},
    {-
2431.5283899.600950.3249},
    {-
2376.6199784.353335.1719},
    {-
2322.2085816.235145.1090},
    {-
2550.1704800.897249.9844},
    {-
2576.6282816.757549.9844},
    {-
2614.7183830.746749.9844},
    {-
2659.8044806.175449.9844},
    {-
2684.9578819.259549.9844},
    {-
2743.6890865.453264.7907},
    {-
2744.2253747.009250.2130},
    {-
2841.5918692.136523.0355},
    {-
2861.0640812.641138.8102},
    {-
2846.4707970.307643.6686}
}; 
I've also tried this:

PHP код:
static Float:pizzaDelivery[][] =
{
    {-
2378.99781317.874116.0611},
    {-
2354.71021263.686926.2144},
    {-
2371.49291115.632955.7266},
    {-
2458.66061133.675455.7266},
    {-
2577.22491145.591755.7266},
    {-
2599.4448969.217078.2836},
    {-
2570.1301916.184864.9844},
    {-
2431.5283899.600950.3249},
    {-
2376.6199784.353335.1719},
    {-
2322.2085816.235145.1090},
    {-
2550.1704800.897249.9844},
    {-
2576.6282816.757549.9844},
    {-
2614.7183830.746749.9844},
    {-
2659.8044806.175449.9844},
    {-
2684.9578819.259549.9844},
    {-
2743.6890865.453264.7907},
    {-
2744.2253747.009250.2130},
    {-
2841.5918692.136523.0355},
    {-
2861.0640812.641138.8102},
    {-
2846.4707970.307643.6686}
}; 
It still doesn't work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)