14.11.2013, 08:34
How I can make that? NPC train driver come to station, player will get teleported to train as passenger and he wont be able to exit this train? Thx
PutPlayerInVehicle(playerid, npctrain, 1);
TogglePlayerControllable(playerid, 0);
#define MAX_TRAIN_SEATS 20 //CHANGE THAT TO YOUR CUSTOM WISHES - THE MAX AMOUNTS OF SEATS THAT YOU TRAIN SHOULD HAVE
new blocked = 0; for(new n=1; n<=MAX_TRAIN_SEATS; n++) { blocked = 0; for(new i=0; i<GetMaxPlayers(); i++) { if(IsPlayerConnected(i) && GetPlayerVehicleID(i) == npctrain) { if(GetVehicleSeat(i) == n) { blocked = 1; } } } if(blocked == 0) { PutPlayerInVehicle(playerid, npctrain, n); TogglePlayerControllable(playerid, 0); } }