RemovePlayerFromVehicle function don't work?
#1

Hello sa-mp.com visiters! I started my own server and some players reported me about a bug in server. Then they don't work in job, they can drive this work cars and they don't get this message: SendClientMessage(playerid,0xFF0000FF,"This car only for police!");//Explained below.... And other players said that they can't do this. I think there is something wrong with function RemovePlayerFromVehicle(playerid); There is my code:

Код:
		if(JobVehicle[Job1][vehicleid])
		{
			if(Info[playerid][Job] == JOB1_JOB)
			{
				if(GetPlayerSkin(playerid) == JOB1_SKIN)
				{
					//There is some functions...
				}
				else
				{
					SendClientMessage(playerid,0xFF0000FF,"You have to wear police uniform!");
					RemovePlayerFromVehicle(playerid);
				}
			}
			else
			{
				SendClientMessage(playerid,0xFF0000FF,"This car only for police!");
				RemovePlayerFromVehicle(playerid);
			}
		}
This code under callback OnPlayerStateChange. Where can be problem?
Reply
#2

Does not work in OnPlayerEnterVehicle because the player isn't in the vehicle yet. Use OnPlayerStateChange.
Reply
#3

I use It in OnPlayerStateChange.
Reply
#4

What are you using?
Код:
if(newstate == PLAYER_STATE_DRIVER)
??
Reply
#5

Yes.
Reply
#6

You could just put:
Код:
if(Info[playerid][Job] != JOB1_JOB) return //Eject and Message here.
And you would be saving a line there
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)