Alen141 Posted July 18, 2013 Share Posted July 18, 2013 hey guys I wanted to know how to set a new data name in the .map file called "team" and then using script check for team, if not in team he gets some message! Link to comment
xXMADEXx Posted July 18, 2013 Share Posted July 18, 2013 This would require alot of scripting (to add the argument) it could be done, but it would just be faster to make a scripted car. Link to comment
Alen141 Posted July 18, 2013 Author Share Posted July 18, 2013 This would require alot of scripting (to add the argument) it could be done, but it would just be faster to make a scripted car. I know that, but I know to do it only this way car1 = createvehicle (...) car2 = createvehicle (...) if ( source == car1 or source == car2 ) then ----CHECK IF TEAM and so on can u tell me how to make idk, maybe like table and then if source == tablename Link to comment
xXMADEXx Posted July 18, 2013 Share Posted July 18, 2013 To script it youll need this: car = createVehicle ( id, x, y, z ) addEventHandler ( "onVehicleStartEnter", car, function ( p ) if ( getTeamName ( getPlayerTeam ( p ) ) ~= "The Team Name" ) then cancelEvent ( ) end end ) Link to comment
Alen141 Posted July 18, 2013 Author Share Posted July 18, 2013 To script it youll need this: car = createVehicle ( id, x, y, z ) addEventHandler ( "onVehicleStartEnter", car, function ( p ) if ( getTeamName ( getPlayerTeam ( p ) ) ~= "The Team Name" ) then cancelEvent ( ) end end ) will this be ok too? robber1 = createVehicle ( 413, 755.619140625,1980.3388671875,5.3359375, 0,0,84.406494140625 ) robber2 = createVehicle ( 413, 756.6923828125,1985.634765625,5.3359375, 0,0,88.817565917969 ) function lockRob ( player, seat, jacked ) if ( source == robber1 or source == robber2 ) then local team = getPlayerTeam ( player ) local teamName = ( team and getTeamName ( team ) or "" ) if ( teamName ~= "Robber" ) then cancelEvent ( ) outputChatBox ( "Only Robbers are allowed to use this vehicle!", player, 255, 0, 0, true ) end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), lockRob ) Link to comment
Alen141 Posted July 18, 2013 Author Share Posted July 18, 2013 Yes, that'll work. It does , If you are reading this can you tell me what's best way to learn lua/mta scripting AND MOST of all GUIs Link to comment
Castillo Posted July 18, 2013 Share Posted July 18, 2013 I learnt by trial & error and used the forum/friends for questions. 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