Feche1320 Posted March 7, 2012 Share Posted March 7, 2012 function checkPlayersVehicles() for i, player in ipairs(getElementsByType("player")) do if not isPedInVehicle(player) then warpPedIntoVehicle(player, __playerVehicles[player], 0) outputDebugString("Warping " ..getPlayerName(player).. " into vehicle " ..getVehicleName(__playerVehicles[player])) end end end warpPedIntoVehicle is just doing nothing.. and the function is in a timer. Link to comment
Feche1320 Posted March 7, 2012 Author Share Posted March 7, 2012 function checkPlayersVehicles() for i, player in ipairs(getElementsByType("player")) do if not isPedInVehicle(player) and getElementData(player, "State") == "alive" and isElement(__playerVehicles[player]) then local result = warpPedIntoVehicle(player, __playerVehicles[player], 0) outputDebugString("'warpPedIntoVehicle' player = " ..getPlayerName(player).. ", vehicle = " ..getVehicleName(__playerVehicles[player]).. ", result = " ..tostring(result)) end end end [2012-03-07 03:47:03] INFO: 'warpPedIntoVehicle' player = ~[ERU]~Feche, vehicle = RC Bandit, result = false [2012-03-07 03:47:05] INFO: 'warpPedIntoVehicle' player = ~[ERU]~Feche, vehicle = RC Bandit, result = false [2012-03-07 03:47:06] INFO: 'warpPedIntoVehicle' player = ~[ERU]~Feche, vehicle = RC Bandit, result = false [2012-03-07 03:47:08] INFO: 'warpPedIntoVehicle' player = ~[ERU]~Feche, vehicle = RC Bandit, result = false __playerVehicles[player] it's a variable that creates a vehicle when a player joins addEventHandler("onPlayerJoin", g_Root, function() __playerVehicles[source] = createVehicle(math.random(400, 611), 0, 0, 2) setElementSyncer(__playerVehicles[source], false) end ) So, there is no reason to return false.. plus I can't get it working. Link to comment
arezu Posted March 7, 2012 Share Posted March 7, 2012 I dont think you can create a vehicle and then warp ped into the vehicle when using race gamemode, because race has a timer that check player vehicles and removes and puts the players into them when needed. So even if you got it to work, it wont work in the end. Link to comment
Feche1320 Posted March 7, 2012 Author Share Posted March 7, 2012 Nonon, I am making a new race gamemode. So that isn't the problem. Link to comment
arezu Posted March 7, 2012 Share Posted March 7, 2012 Nonon, I am making a new race gamemode. So that isn't the problem. oh, ok.. then i have no idea Link to comment
Castillo Posted March 7, 2012 Share Posted March 7, 2012 I've tested the code you've posted and it worked fine, I got warped to the vehicle. Link to comment
Feche1320 Posted March 7, 2012 Author Share Posted March 7, 2012 I've tested the code you've posted and it worked fine, I got warped to the vehicle. Lollllll, so why it isn't working on my private server? It's a Linux VPS, but it doesn't work on my pc either, and it's Windows, so I guess that it isn't an OS problem.. What release is the server that you tested it? Link to comment
Castillo Posted March 7, 2012 Share Posted March 7, 2012 I've downloaded the latest nightly build of 1.3. Link to comment
Feche1320 Posted March 7, 2012 Author Share Posted March 7, 2012 I've downloaded the latest nightly build of 1.3. I am using that one, and it doesn't work Looks that I'm unlucky.. anyways, is there another way to put a ped in a vehicle? Link to comment
Castillo Posted March 7, 2012 Share Posted March 7, 2012 No as far as I know, but you must have something that is messing around with warpPedIntoVehicle. Link to comment
Feche1320 Posted March 7, 2012 Author Share Posted March 7, 2012 Not sure what it could be.. I stopped all resources and the problem persists.. should I cry? Link to comment
arezu Posted March 7, 2012 Share Posted March 7, 2012 Not sure what it could be.. I stopped all resources and the problem persists.. should I cry? cry after first reinstalling mta Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now