Is there such callback as
#1

Is there such callback as, OnPlayerExitVehicle,
Or anything simular or what would do the same thing?
Reply
#2

Why need a other one if you want the exact same thing as OnPlayerExitVehicle ?

[Doppeyy
Reply
#3

Quote:
Originally Posted by ๔๏קקєyy
Why need a other one if you want the exact same thing as OnPlayerExitVehicle ?

[Doppeyy
I mean, Im wondering if that callback exists,
If it dosent then one that would do the same thing
Reply
#4

Quote:
Originally Posted by JoeDaDude
Quote:
Originally Posted by ๔๏קקєyy
Why need a other one if you want the exact same thing as OnPlayerExitVehicle ?

[Doppeyy
I mean, Im wondering if that callback exists,
If it dosent then one that would do the same thing
OnPlayerExitVehicle excist its a standard samp callback.

[Doppeyy
Reply
#5

https://sampwiki.blast.hk/wiki/OnPlayerExitVehicle - it's called when player exits the vehicle.

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
  if(newstate == PLAYER_STATE_ONFOOT && (oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER))
  {
    // your code.
  }
  return true;
}
This code will work if player's old state was driver/passenger and if new state is on foot.
Reply
#6

Ok new question:

How would i do like this:

Engine[vehicleid] = 1;

On a vehicle only,
And not a playerid,
As you can see im kinda making a engine system
Reply
#7

I'm afraind i don't understand your wish.

Something like this?
pawn Код:
// array.
new
    Engine[MAX_VEHICLES]; // change it to your own vehicle_define.

// code.
new
    vehicleid = GetPlayerVehicleID(playerid);
Engine[vehicleid] = 1;
Reply
#8

Erm not sure,

Like a engine system,
They get in and the engine starts
Which would set Engine to 1
But for that car tht they got in, Not the player
And when they exit its still 1,
So when they get back in the engine is still running, Rather than having to start it again
Reply
#9

Then i guess you're looking for this:
Quote:
Originally Posted by Don Correlli
pawn Код:
// array.
new
    Engine[MAX_VEHICLES]; // change it to your own vehicle_define.

// code.
new
    vehicleid = GetPlayerVehicleID(playerid);
Engine[vehicleid] = 1;
Just put it where you want (example: "/engineon" command in which you would use IsPlayerInAnyVehicle function to check if player is in any vehicle).
That code will get the ID of the vehicle in which the player is in currently and set its Engine variable to 1.
Reply
#10

Quote:
Originally Posted by Don Correlli
Then i guess you're looking for this:
Quote:
Originally Posted by Don Correlli
pawn Код:
// array.
new
    Engine[MAX_VEHICLES]; // change it to your own vehicle_define.

// code.
new
    vehicleid = GetPlayerVehicleID(playerid);
Engine[vehicleid] = 1;
Just put it where you want (example: "/engineon" command in which you would use IsPlayerInAnyVehicle function to check if player is in any vehicle).
That code will get the ID of the vehicle in which the player is in currently and set its Engine variable to 1.
Ok whatcha mean by this: // change it to your own vehicle_define.
Reply
#11

Quote:
Originally Posted by JoeDaDude
Ok whatcha mean by this: // change it to your own vehicle_define.
SA:MP standard define for maximum amount of vehicles is 2000 and that's too big if don't have 2000 vehicles in your gamemode, so change it to your own value (how much vehicles you're using in your gamemode).
Reply
#12

So

pawn Код:
Engine[12];
Or

pawn Код:
Engine[MAX_VEHICLES_12];
Or what?

Sorry never done anything like this before
Reply
#13

Quote:
Originally Posted by JoeDaDude
pawn Код:
Engine[12];
is the correct example if you have 12 vehicles in your gamemode.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)