tim260 Posted October 26, 2011 Share Posted October 26, 2011 Can i do like restrict the car to one person and the car id in my map file is : vehicle (Bullet) (1) and only the persons in the skin 29 dealerVehicles = { vehicle (Bullet) (1)]=true} dealerTeams = {[29]=true} function dealerenterVehicle ( player, seat, jacked ) if ( dealerVehicles[getElementModel ( source )] ) and ( not dealerTeams[getElementModel(player)] ) and ( seat == 0 ) then outputChatBox ( "You aren't dealer , you can't drive this.", player ) --and tell the player why cancelEvent() end end addEventHandler ( "onVehicleStartEnter", getRootElement(), dealerenterVehicle ) Link to comment
Aibo Posted October 26, 2011 Share Posted October 26, 2011 you'll need getElementID: dealerVehicles = { ["vehicle (Bullet) (1)"] = true } dealerTeams = { [29] = true } function dealerenterVehicle ( player, seat, jacked ) if ( dealerVehicles[getElementID(source)] ) and ( not dealerTeams[getElementModel(player)] ) and ( seat == 0 ) then outputChatBox ( "You aren't dealer , you can't drive this.", player) --and tell the player why cancelEvent() end end addEventHandler ( "onVehicleStartEnter", getRootElement(), dealerenterVehicle ) Link to comment
Phat Looser Posted October 26, 2011 Share Posted October 26, 2011 What you are talking about is, just modifying the model of one single car, without modifying all other models. This is not possible at the moment. Link to comment
tim260 Posted October 26, 2011 Author Share Posted October 26, 2011 Not posssible thats a lie The server SAES:RPG is using it Link to comment
mjau Posted October 26, 2011 Share Posted October 26, 2011 well your title says lock car to players is that what u mean or replacing model ? Link to comment
tim260 Posted October 26, 2011 Author Share Posted October 26, 2011 I mean like there is a bullet in the base of the speed demons clan the id of the bullet is " vehicle (Bullet) (1)" and the acl group of this clan is called dealers i want the car (" vehicle (Bullet) (1)") only able to enter by the dealers acl group of if not possible with acl with skin. but not ALL bullets only that ONE, so vehicle (Bullet) (1) Link to comment
mjau Posted October 26, 2011 Share Posted October 26, 2011 oh ok well idk how to do it this way but when i lock cars i do like this .. Hunter1 = createVehicle ( 425, 362.26513671875, 1997.4976806641, 21.543445587158, 0, 0, 91.75 ) function lockTheHydras(player, seat, jacked) if source == Hunter1 then local accountname = getAccountName (getPlayerAccount(player)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "AR-AirForce" ) ) then return end cancelEvent() outputChatBox ( "Only Airforce or Special Forces can enter this vehicle", player, 255, 0, 0, true ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), lockTheHydras ) The difference i just take cordinates and create the vehicle in the lua file instead and wellchange the acl group to whatever u want BTW serverside script Link to comment
Castillo Posted October 26, 2011 Share Posted October 26, 2011 Do this: Set a new data name in the .map file called "acl" and then in the script check for that ACL group. Link to comment
tim260 Posted October 26, 2011 Author Share Posted October 26, 2011 Please explain this furhter i dont understand in the mean while why is this script not working the gate is created but not moving gate1 = createObject ( 980, 2061.8999023438, 2464.8000488281, 12.60000038147, 0, 0, 180.24719238281 ) col = createColCircle ( 2061.8999023438, 2464.8000488281, 12.60000038147, 7 ) function opena51gates(thePlayer) if getElementModel( thePlayer ) == 71 then moveObject (gate1, 3000, 2061.8999023438, 2464.8000488281, 17.200000762939 ) end end addEventHandler( "onColShapeHit", col, opena51gates ) function closea51gates(thePlayer) if getElementModel( thePlayer ) == 29 then moveObject (gate1, 3000, 2061.8999023438, 2464.8000488281, 12.60000038147 ) end end addEventHandler( "onColShapeLeave", col, closea51gates ) Link to comment
mjau Posted October 26, 2011 Share Posted October 26, 2011 Why does he have different skin when leaving 71 to open 29 to leave ? Link to comment
tim260 Posted October 26, 2011 Author Share Posted October 26, 2011 thats something i edited later nvm that, its just ( even when the skins are the same ) not opening Link to comment
mjau Posted October 26, 2011 Share Posted October 26, 2011 You sure you created the col circle right ? Link to comment
tim260 Posted October 26, 2011 Author Share Posted October 26, 2011 i think so im not pro yk any comments ? Link to comment
mjau Posted October 27, 2011 Share Posted October 27, 2011 Hm try this with debugscript 3 on if it says colshape when you go to it then the colshape is right gate1 = createObject ( 980, 2061.8999023438, 2464.8000488281, 12.60000038147, 0, 0, 180.24719238281 ) col = createColCircle ( 2061.8999023438, 2464.8000488281, 12.60000038147, 7 ) function opena51gates(thePlayer) outputDebugString ( "Colshape." ) if getElementModel( thePlayer ) == 71 then moveObject (gate1, 3000, 2061.8999023438, 2464.8000488281, 17.200000762939 ) end end addEventHandler( "onColShapeHit", col, opena51gates ) function closea51gates(thePlayer) if getElementModel( thePlayer ) == 29 then moveObject (gate1, 3000, 2061.8999023438, 2464.8000488281, 12.60000038147 ) end end addEventHandler( "onColShapeLeave", col, closea51gates ) Link to comment
tim260 Posted October 27, 2011 Author Share Posted October 27, 2011 Yeah it gives me the colshape ! so whats wrong then Link to comment
mjau Posted October 27, 2011 Share Posted October 27, 2011 I tried this in my server it works and to get the gate down change the skins to same value make sure u have skin 71 .... Link to comment
tim260 Posted October 27, 2011 Author Share Posted October 27, 2011 trolol i changed the coords and skins the same now thanks for helping me kimmis i own you something lol Link to comment
tim260 Posted October 27, 2011 Author Share Posted October 27, 2011 Still can you help me with the script for restricting one car ? i had to use getElementByID right ? im gonna make a script ( TRY to make ) you can see whats wrong then EDIT oh btw whats wrong with this one : dealerVehicles = { ["vehicle (Bullet) (1)"] = true } dealerTeams = { [29] = true } function dealerenterVehicle ( player, seat, jacked ) if ( dealerVehicles[getElementID(source)] ) and ( not dealerTeams[getElementModel(player)] ) and ( seat == 0 ) then outputChatBox ( "You aren't dealer , you can't drive this.", player) --and tell the player why cancelEvent() end end addEventHandler ( "onVehicleStartEnter", getRootElement(), dealerenterVehicle ) Link to comment
mjau Posted October 27, 2011 Share Posted October 27, 2011 Well idk how to do it this way i just create the vehicle with createVehicle function then i know how to lock them... so if you want it this way i cant help if you are willing to copy paste some cordinates well then i can help you ... Link to comment
tim260 Posted October 27, 2011 Author Share Posted October 27, 2011 Yeah if you know a way tell me mate , but you say lock and with what you lock acl group, team, skin ? Link to comment
mjau Posted October 27, 2011 Share Posted October 27, 2011 You can lock to whatveer u want by editing 2 lines but give some time im busy setting up my new gameserver host ... Link to comment
tim260 Posted October 27, 2011 Author Share Posted October 27, 2011 Fine i will take a look again after i cleaned up my room lol EDIT L to let you know: this is the car where is it about : "vehicle-bullet" paintjob="3" model="541" plate="Y799UHE" interior="0" dimension="0" color="54,14,0,0" posX="2099" posY="2479.5" posZ="10.5" rotX="0" rotY="0" rotZ="179.99462890625"> 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