Stop player from entering vehicle
#7

Quote:
Originally Posted by AmigaBlizzard
View Post
Everytime a player logs in, you can process all vehicles and set the doors locked/unlocked based on the ownership of the vehicle.
Actually, that wouldn't work because

Quote:
Originally Posted by Wiki
Note: From 0.3 you will have to re-apply this function when OnVehicleStreamIn is called!
while this refers to SetVehicleParamsForPlayer. Otherwise, a player will simply be able to enter any vehicle streams in for him/her after few seconds from logging in ('Spawning' I guess).

Hence the following code wouldn't work at all
pawn Code:
public OnPlayerSpawn(playerid) // or OnPlayerConnect
{
    for(new i = 0; i < MAX_VEHICLES; i ++)
    {
        print("executing");
        SetVehicleParamsForPlayer(i, playerid, 0, 1);
    }
    return 1;
}
But, this code would work perfectly
pawn Code:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
    SetVehicleParamsForPlayer(vehicleid, forplayerid, 0, 1);
    return 1;
}
Quote:
Originally Posted by SEnergy
View Post
it should lock/unlock doors when I use command /dvere, however I can enter vehicle even if I locked it
Just use the method I posted above with SetVehicleParamsForPlayer and OnVehicleStreamIn.



Quote:
Originally Posted by SEnergy
View Post
how can I show that little message box at the left of the screen, not dialog box, but some kind of message box, I hope you know what I mean
You gotta create textdraws.
Reply


Messages In This Thread
Stop player from entering vehicle - by SEnergy - 27.07.2012, 18:10
Re: Stop player from entering vehicle - by maramizo - 27.07.2012, 18:14
Re: Stop player from entering vehicle - by SEnergy - 27.07.2012, 18:21
Re: Stop player from entering vehicle - by [KHK]Khalid - 27.07.2012, 18:25
Re: Stop player from entering vehicle - by AmigaBlizzard - 27.07.2012, 18:25
Re: Stop player from entering vehicle - by SEnergy - 27.07.2012, 18:40
Re: Stop player from entering vehicle - by [KHK]Khalid - 27.07.2012, 19:05
Re: Stop player from entering vehicle - by Universal - 27.07.2012, 19:07
Re: Stop player from entering vehicle - by [KHK]Khalid - 27.07.2012, 19:17
Re: Stop player from entering vehicle - by Universal - 27.07.2012, 19:41

Forum Jump:


Users browsing this thread: 2 Guest(s)