#1

how can I Disallow ENTER at job vehicles if player is doing job... so players can do job !!
Reply
#2

what do you mean ?
Reply
#3

Код:
#include <foreach> //at top if u don't have
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(!ispassenger)
    {
		    foreach(Player,i)
		    {
		       if( i != playerid && GetPlayerVehicleID(i) == vehicleid && GetPlayerState(i) == PLAYER_STATE_DRIVER && PlayerWithJob[i])
		       {

	new Float:x, Float:y, Float:z;
	GetPlayerPos(playerid, x , y , z);
	SetPlayerPos(playerid, x , y , z + 1);
						break;
		       }
		    }
	}
	return 1;
}
Hope it help you try it and if not work pm me
Reply
#4

I want to define PlayerWithJob with all job cars or something like that..could I?
Reply
#5

Well make that variable whenever player join any job set that = 1 and when he left any job set = 0.
Reply
#6

? I want enter to be disallowed??stop enter..
Reply
#7

I want or to stop enter or lock vehicle..
Reply
#8

how can I make it?? Disallow ENTER at job vehicles if player is doing job... so players can do job !!
Reply
#9

MBilal already posted the clear example about how to do it. Why are you repeating yourself?

If you don't know how to use variables, take your time reading this.
Reply
#10

Use OnPlayerEnterVehicle.
You can stop the player from entering the vehicle if he's not doing the job like this:
PHP код:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    new 
model GetVehicleModel(vehicleid);
    if(
model == 407){
        if(
Fireman[playerid] == 0){
        new 
Float:X,Float:Y,Float:Z;
        
GetPlayerPos(playerid,X,Y,Z);
        
SetPlayerPos(playerid,X,Y,Z);
        
SendClientMessage(playeridCOLOR_WHITE"You don't have the fireman job.");
        return 
1;
        }
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)