People can't play on foot only in car.
#1

Is there a method to do that the player can stay only in a car, no onfoot.
I need it please.
P.S. I need a Script

Best Regards
A.R.E.S.97

Sorry for my English but i'm italian.
Reply
#2

you mean whan player connecto to servar to be put in vehicle ?
Reply
#3

Quote:
Originally Posted by doreto
View Post
you mean whan player connecto to servar to be put in vehicle ?
No, after player spawned, he can stay only in a car no on foot.
Reply
#4

pawn Code:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    PutPlayerInVehicle(playerid, vehicleid, 0); //DRIVER
    return 1;
}
should be something like that
(not tested)
Reply
#5

PHP Code:
public OnPlayerExitVehicle(playeridvehicleid)
{
    
PutPlayerInVehicle(playerid,vehicleid,seatid);
    return 
1;

EDIT:to late
Reply
#6

I've tested the ones above, didn't work for me.

This works for me:
pawn Code:
new Vehicle[MAX_PLAYERS] = {-1,...};

public OnPlayerExitVehicle(playerid, vehicleid)
{
    Vehicle[playerid] = vehicleid;
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_ONFOOT && oldstate == PLAYER_STATE_DRIVER)
    {
        PutPlayerInVehicle(playerid, Vehicle[playerid], 0);
        SendClientMessage(playerid, -1, "You can't leave vehicles as driver!");
    }
    return 1;
}

public OnPlayerConnect(playerid)
{
    Vehicle[playerid] = -1;  //Player has no vehicle yet.
    return 1;
}
Jeffry
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)