these states do not work -
Thewin - 17.07.2014
ID Macro Description
4 PLAYER_STATE_EXIT_VEHICLE Player exits a vehicle
5 PLAYER_STATE_ENTER_VEHICLE_DRIVER Player enters a vehicle as driver
6 PLAYER_STATE_ENTER_VEHICLE_PASSENGER Player enters a vehicle as passenger
I use this code..
public OnPlayerStateChange(playerid, newstate, oldstate)
{
fVehSpeed[playerid] = 0.0;
if(newstate == 4)
{
SCM(playerid,-1,"sales del vehiculo");
}
if(newstate == 5)
{
SCM(playerid,-1,"entras del vehiculo conductor");
}
if(newstate == 6)
{
SCM(playerid,-1,"entras al vehiculo pasajero");
}
return 1;
}
But i didn't receive this messages, why?
Re: these states do not work -
Onfroi - 17.07.2014
I think you have to check the oldstate as well.
Re: these states do not work -
Jack_Leslie - 17.07.2014
Try something like:
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
fVehSpeed[playerid] = 0.0;
if(oldstate != 4 && newstate == 4)
{
SCM(playerid,-1,"sales del vehiculo");
}
if(oldstate != 5 && newstate == 5)
{
SCM(playerid,-1,"entras del vehiculo conductor");
}
if(oldstate != 6 && newstate == 6)
{
SCM(playerid,-1,"entras al vehiculo pasajero");
}
return 1;
}
Respuesta: these states do not work -
Thewin - 17.07.2014
Nothing
Re: these states do not work -
Jack_Leslie - 17.07.2014
Add a print to debug what's happening.
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
printf("%d - %d", newstate, oldstate);
fVehSpeed[playerid] = 0.0;
if(oldstate != 4 && newstate == 4)
{
SCM(playerid,-1,"sales del vehiculo");
}
if(oldstate != 5 && newstate == 5)
{
SCM(playerid,-1,"entras del vehiculo conductor");
}
if(oldstate != 6 && newstate == 6)
{
SCM(playerid,-1,"entras al vehiculo pasajero");
}
return 1;
}
Then check and see what it inputs on the server console when you change into the certain states.
Respuesta: these states do not work -
Thewin - 17.07.2014
2 -1
1 - 2
PLAYER_STATE_DRIVER and PLAYER_STATE_ONFOOT
Re: these states do not work -
Jack_Leslie - 17.07.2014
I just did some debugging, and 3 is passenger, and 2 is driver, and 1 is onfoot. So don't use 4, 5 or 6. Hope that helps with what you want to do.
Respuesta: these states do not work -
Thewin - 17.07.2014
I needed a function of when exit the vehicle and when enter, but i did make a function for this, well thanks
Re: these states do not work -
Jack_Leslie - 17.07.2014
If oldstate 2, and newstate 1 then player has exited the vehicle.
If oldstate 1, ad newstate 2, then player has entered vehicle as driver.
If oldstate 1, and newstate 3, then player has entered as passenger.
Re: these states do not work -
Konstantinos - 17.07.2014
They cannot be used in a script and as the description says "Used internally" only.