diesel974 Posted May 30, 2014 Share Posted May 30, 2014 (edited) Hey all, i tried to make a taxi job using atleast all the knowledge i have about scriptin in Lua. So basically,my problem is when 2 or more players doing the job, the message player1 was supposed to see,player2 also can see it. Also,sometimes, the blip that was visible for player1 only, becomes visible also to player2 ((((( i tried to see where the bug was, but no idea. Everything i did seems to be perfectly alright but some bugs had to show there ugly faces So here is the code As you can see, i had to use setElementData and getElementData to avoid collisions with players. i used their names to differentiate them. (This is the serverside, the clientside contains only the gui, so no need to worry about the client side) The problem: [2014-05-30 10:08:46] [Output] : Please wait the clients to get into your taxi [2014-05-30 10:08:46] [Output] : Please wait the clients to get into your taxi [2014-05-30 10:08:53] [Output] : All passengers have already got into your taxi, now drive them to their destination [2014-05-30 10:08:53] [Output] : All passengers have already got into your taxi, now drive them to their destination [2014-05-30 10:09:55] [Output] : Wait for the passengers to get down now [2014-05-30 10:09:55] [Output] : Wait for the passengers to get down now [2014-05-30 10:09:58] [Output] : Ok,all the passengers have got down. Now go and take other passengers.Open your map to see them if needed [2014-05-30 10:09:58] [Output] : Ok,all the passengers have got down. Now go and take other passengers.Open your map to see them if needed Because 2 players where doing the job at that time, and i got 2 messages instead of 1 and i could see the marker's blip of the other player too. Help me guys, and thanks in advance Edited June 17, 2014 by Guest Link to comment
Den. Posted May 30, 2014 Share Posted May 30, 2014 I think the problem is on line 93: You are checking if the player's marker ( txJobMarker1[hitElement] ) belongs to the player, which is always true in all cases. So replace that with source, which is the marker hit, then you would be checking if the marker that was just hit by the player is truly his marker/customer. if (getElementData(source,"JobOwner") == getPlayerName(hitElement)) then I also don't understand what you are trying to do with the if on line 96. Link to comment
diesel974 Posted May 31, 2014 Author Share Posted May 31, 2014 if (getElementData(vehicle,"JobOwner") == getElementData(txJobMarker1[hitElement],"JobOwner" )) then This line is gonna check whether the current player is in the job vehicle given to him, which is infact a taxi, with element data "JobOwner" set to his name. So,if for example, the player decides to take another vehicle and drive directly to the marker,the passengers would not be warped in his vehicle because the vehicle does not contain the element data required. I think the problem is on line 93: You are checking if the player's marker ( txJobMarker1[hitElement] ) belongs to the player, which is always true in all cases.So replace that with source, which is the marker hit, then you would be checking if the marker that was just hit by the player is truly his marker/customer. if (getElementData(source,"JobOwner") == getPlayerName(hitElement)) then I also don't understand what you are trying to do with the if on line 96. oh God thats such a stupid error from my part. Lol, thanks Den, im sure thats the error. Thank you very much for your help 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