AHMAD1234 Posted June 19, 2013 Share Posted June 19, 2013 Hello guys the code, okay but the problem is the order only for the player who have the vehicle i want any player want to enter the vehicle he can't if he is not in the team and thanks. addEventHandler("onVehicleStartEnter", root, function ( player ) if ( source == veh[player] ) then if Settings["forFree"] == true then return end if getPlayerTeam ( player ) ~= getTeamFromName ( Settings["teamName"] ) then outputChatBox( "* #0069c7this vehicle for #ff0000team",player,255,0,0,true ) cancelEvent( ) end end end ) Link to comment
Castillo Posted June 19, 2013 Share Posted June 19, 2013 I don't understand what you mean. Link to comment
iPrestege Posted June 19, 2013 Share Posted June 19, 2013 I think he want any vehicle not a veh[player] only ? Link to comment
mcer Posted June 19, 2013 Share Posted June 19, 2013 He want to lock a vehicle for a specifc team. Link to comment
AHMAD1234 Posted June 19, 2013 Author Share Posted June 19, 2013 (edited) I don't understand what you mean. I think he mean you want any vehicle not a veh[player] only ? no actually i want any player who wants to enter the the Private vehicle he can't if he is not in the team Edited June 20, 2013 by Guest Link to comment
AHMAD1234 Posted June 19, 2013 Author Share Posted June 19, 2013 Id for the car? no not ID like this veh = {} Link to comment
mcer Posted June 19, 2013 Share Posted June 19, 2013 https://wiki.multitheftauto.com/wiki/SetVehicleLocked Use this in Clientside, and use it https://wiki.multitheftauto.com/wiki/CreateColCuboid Attach the car. Link to comment
AHMAD1234 Posted June 19, 2013 Author Share Posted June 19, 2013 https://wiki.multitheftauto.com/wiki/SetVehicleLockedUse this in Clientside, and use it https://wiki.multitheftauto.com/wiki/CreateColCuboid and attach the car. no not locked i mean for veh[player] only Link to comment
iMr.3a[Z]eF Posted June 19, 2013 Share Posted June 19, 2013 oh you mean you don't want anyone else team enter the vehicle? Link to comment
AHMAD1234 Posted June 19, 2013 Author Share Posted June 19, 2013 oh you mean you don't want anyone else team enter the vehicle? yes lol Link to comment
iMr.3a[Z]eF Posted June 20, 2013 Share Posted June 20, 2013 addEvent( "onVehicleStartEnter", true ) addEventHandler( "onVehicleStartEnter", getRootElement(), function( player ) if(source==C)then if (getPlayerTeam(player)~="yourteam")then cancelEvent() r,b,g = math.random(0, 255), math.random(0, 255), math.random(0, 255) outputChatBox( "* Only For Team !", player,r,b,g, true ) else r,b,g = math.random(0, 255), math.random(0, 255), math.random(0, 255) outputChatBox( "* Welcome Team", player, r,b,g, true ) end end end ) * C = the vehicle what you created and what you want it as Team's vehicle Link to comment
AHMAD1234 Posted June 20, 2013 Author Share Posted June 20, 2013 addEvent( "onVehicleStartEnter", true ) addEventHandler( "onVehicleStartEnter", getRootElement(), function( player ) if(source==C)then if (getPlayerTeam(player)~="yourteam")then cancelEvent() r,b,g = math.random(0, 255), math.random(0, 255), math.random(0, 255) outputChatBox( "* Only For Team !", player,r,b,g, true ) else r,b,g = math.random(0, 255), math.random(0, 255), math.random(0, 255) outputChatBox( "* Welcome Team", player, r,b,g, true ) end end end ) * C = the vehicle what you created and what you want it as Team's vehicle ok are you sure that any player other can't enter the vehicle if he is not in team..? Link to comment
iPrestege Posted June 20, 2013 Share Posted June 20, 2013 6ArHxiMr'3a[Z]eF's Your code is wrong. Link to comment
iMr.3a[Z]eF Posted June 20, 2013 Share Posted June 20, 2013 (edited) why that?, i post it in NotePad++ and all true EDIT: sorry my code is wrong as prestege said try this local team = getPlayerTeam ( player ) addEvent( "onVehicleStartEnter", true ) addEventHandler( "onVehicleStartEnter", getRootElement(), function( player ) if(source==C)then if (getTeamName( team ) == "yourTeam") then cancelEvent() r,b,g = math.random(0, 255), math.random(0, 255), math.random(0, 255) outputChatBox( "* Only For Team !", player,r,b,g, true ) else r,b,g = math.random(0, 255), math.random(0, 255), math.random(0, 255) outputChatBox( "* Welcome Team", player, r,b,g, true ) end end end ) Edited June 20, 2013 by Guest Link to comment
AHMAD1234 Posted June 20, 2013 Author Share Posted June 20, 2013 (edited) the code is okay but i ask if you sure that will by for all players Edit: Because I do not have server to test it Edited June 20, 2013 by Guest Link to comment
iMr.3a[Z]eF Posted June 20, 2013 Share Posted June 20, 2013 yes i'm sure and i try it all time Link to comment
iMr.3a[Z]eF Posted June 20, 2013 Share Posted June 20, 2013 so correct it i dont know what's wrong Link to comment
AHMAD1234 Posted June 20, 2013 Author Share Posted June 20, 2013 c == veh[player] true? Link to comment
iMr.3a[Z]eF Posted June 20, 2013 Share Posted June 20, 2013 is veh[player] = createVehicle ? Link to comment
AHMAD1234 Posted June 20, 2013 Author Share Posted June 20, 2013 is veh[player] = createVehicle ? yes Link to comment
iMr.3a[Z]eF Posted June 20, 2013 Share Posted June 20, 2013 so replace the veh[player] from C PUT IT LIKE THIS local team = getPlayerTeam ( player ) addEvent( "onVehicleStartEnter", true ) addEventHandler( "onVehicleStartEnter", getRootElement(), function( player ) if(source==veh[player])then if (getTeamName( team ) == "yourTeam")then cancelEvent() r,b,g = math.random(0, 255), math.random(0, 255), math.random(0, 255) outputChatBox( "* Only For Team !", player,r,b,g, true ) else r,b,g = math.random(0, 255), math.random(0, 255), math.random(0, 255) outputChatBox( "* Welcome Team", player, r,b,g, true ) end end end ) Link to comment
AHMAD1234 Posted June 20, 2013 Author Share Posted June 20, 2013 so replace the veh[player] from CPUT IT LIKE THIS local team = getPlayerTeam ( player ) addEvent( "onVehicleStartEnter", true ) addEventHandler( "onVehicleStartEnter", getRootElement(), function( player ) if(source==veh[player])then if (getTeamName( team ) == "yourTeam")then cancelEvent() r,b,g = math.random(0, 255), math.random(0, 255), math.random(0, 255) outputChatBox( "* Only For Team !", player,r,b,g, true ) else r,b,g = math.random(0, 255), math.random(0, 255), math.random(0, 255) outputChatBox( "* Welcome Team", player, r,b,g, true ) end end end ) yeah thanks man for 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