RemovePlayerFromVehicle(playerid); problem -_- -
ross8839 - 06.02.2014
Fixed.. loool
Re: RemovePlayerFromVehicle(playerid); problem -_- -
SickAttack - 06.02.2014
I guess you didn't read the stuff on samp wiki.
Taken from samp wiki:
Notes:
The exiting animation is not synced for other players.
This function will not work when used in OnPlayerEnterVehicle, because the player isn't in the vehicle when the callback is called. Use OnPlayerStateChange (newstate == 2/PLAYER_STATE_DRIVER) instead.
Link:
https://sampwiki.blast.hk/wiki/RemovePlayerFromVehicle
Try this:
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == 2 && pizzabike)
{
if(JobStatus[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "Type /startwork to start working!"); //this sends whenever my variable is set to 1
}
else
{
RemovePlayerFromVehicle(playerid); //when variable is 0, it doesnt kick me from vehicle
SendClientMessage(playerid, COLOR_GREY, "You don't work for the pizza place!"); //My variable is set to 0, and this sends... so it's as if it's skipping removeplayerfrom.. anyone?
}
}
return 1;
}
Re: RemovePlayerFromVehicle(playerid); problem -_- -
ross8839 - 06.02.2014
ooooooooooooooooooooooooh, no i didn't because I already read it but ages ago... but not all of it... and so no, i didn't read the wiki xD thanks tho man..
Re: RemovePlayerFromVehicle(playerid); problem -_- -
Mattakil - 06.02.2014
what you could do is set the doors to locked, and under OnPlayerEnterVehicle if the pllayer has the correct job, automatically unlock
Re: RemovePlayerFromVehicle(playerid); problem -_- -
ross8839 - 06.02.2014
is there a way, not to freeze the player but freeze the bike so the bike wont go, unless you have types /startwork?
Re: RemovePlayerFromVehicle(playerid); problem -_- -
ikey07 - 06.02.2014
Jup , but you can freeze player if he is on the bike he shouldn't be, remove from vehicle, and again on PlayerStateChange, if old state was 2, and old vehicle is that pizza bike, unfreeze.
Re: RemovePlayerFromVehicle(playerid); problem -_- -
ross8839 - 06.02.2014
No i know how to do that, but I want to make it so when you work for the pizza stack, you get on the vehicle, it won't move... until you type /startwork
Re: RemovePlayerFromVehicle(playerid); problem -_- -
Vanter - 06.02.2014
pawn Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z+5);
Re: RemovePlayerFromVehicle(playerid); problem -_- -
MrTinder - 06.02.2014
Quote:
Originally Posted by ross8839
No i know how to do that, but I want to make it so when you work for the pizza stack, you get on the vehicle, it won't move... until you type /startwork
|
You can set vehicle engine to 0/false and then when player type command to set it to 1/true.
Re: RemovePlayerFromVehicle(playerid); problem -_- -
ross8839 - 06.02.2014
Okay so I got that working and now I have another problem, I have updated the topic with another problem instead of making a new thread, would really appreciate any help!