iMr.WiFi..! Posted June 1, 2017 Share Posted June 1, 2017 (edited) hey guys, i had problem in code, problem is when i create hydra for players were join the mission the create is sucess but they can't see my hydra and i can't see their hydra for information : the code in server-side, i try to use ( setElementVisibleTo ) but not working the code : Spoiler local x,y,z = 0,0,3 HydraVehicles = { createVehicle (520,x,y,z), createVehicle (520,x,y,z), createVehicle (520,x,y,z), createVehicle (520,x,y,z), createVehicle (520,x,y,z), createVehicle (520,x,y,z), createVehicle (520,x,y,z), createVehicle (520,x,y,z), createVehicle (520,x,y,z), createVehicle (520,x,y,z) } function CheckStart( ) if getElementData(root,"MissionStart") == true then if getElementData(root,"Freez") == true then if getElementData(root,"MissionStartRem") == false then if getElementData(root,"TypeMission") == "Hydra" then if Hydra > 1 then setTimer(outputChatBox,1000,1,"* [ Hydra-Mission ] : بقي 5 ثواني لبدء المهمة ",root,255,255,0) setTimer(outputChatBox,2000,1,"* [ Hydra-Mission ] : بقي 4 ثواني لبدء المهمة ",root,255,255,0) setTimer(outputChatBox,3000,1,"* [ Hydra-Mission ] : بقي 3 ثواني لبدء المهمة ",root,255,255,0) setTimer(outputChatBox,4000,1,"* [ Hydra-Mission ] : بقي 2 ثواني لبدء المهمة ",root,255,255,0) setTimer(outputChatBox,5000,1,"* [ Hydra-Mission ] : بقي 1 ثواني لبدء المهمة ",root,255,255,0) setTimer(function ( ) for i,v in pairs (InMiss) do outputChatBox ( "* [ Hydra-Mission ] : تم بدء المهمة جد مكانك الخاص, احذر من ان تبعد اكثر من 3000 متر عن المركز وألا سوف تتفجر طائرتك",v,255,0,0) outputChatBox ( "* [ Hydra-Mission ] : ستجد كافة معلوماتك على اليمين",v,255,255,0) setElementFrozen(v,false) setElementData(root,"Freez",false) local x,y,z = getElementPosition ( v ) setElementHealth(HydraVehicles[i],1000) setElementPosition(HydraVehicles[i],x,y,z) warpPedIntoVehicle (v,HydraVehicles[i]) setElementRotation(HydraVehicles[i],0,0,313) toggleControl(v,"vehicle_fire",false) toggleControl(v,"vehicle_secondary_fire",false) toggleControl(v,"enter_exit",false) outputChatBox("* [ Hydra-Mission ] : لن يمكنك الاطلاق الا بعد 20 ثانية من الأن",v,255,255,0) setTimer(function ( ) toggleControl(v,"vehicle_fire",true) toggleControl(v,"vehicle_secondary_fire",true) outputChatBox("* [ Hydra-Mission ] : يمكنك الاطلاق الان",v,255,255,0) end,20*1000,1) outputChatBox ( "* [ Hydra-Mission ] : اضغط باستمرار على رقم 8 الموجود بالازرار التي على اليمين لتحويل الطيارة الى هجومية ",v,255,255,0) end outputChatBox ("* [ Hydra-Mission ] : تم أغلاق المهمة !!",root,255,122,0) end,5001,1) setElementData(root,"MissionStart",false) setElementData(root,"MissionStartRem",nil) else outputChatBox ("* [ Hydra-Mission ] : لم يتم بدء المهمة بسبب عدم وجود اللاعبين",root,255,122,0) for i,v in pairs (InMiss) do setElementFrozen (v,false) setElementDimension(v,0) table.remove(InMiss,i) end setElementData(root,"MissionStartRem",nil) setElementData(root,"MissionStart",false) setMarkerColor(HydraWar,255,122,0,122) end end end end end end if you see errors in my words this because im not good in english < > Edited June 2, 2017 by iMr.WiFi..! Link to comment
Administrators Lpsd Posted June 2, 2017 Administrators Share Posted June 2, 2017 Double check your meta.xml, make sure this script is set to serverside. Link to comment
iMr.WiFi..! Posted June 2, 2017 Author Share Posted June 2, 2017 (edited) 2 hours ago, LopSided_ said: Double check your meta.xml, make sure this script is set to serverside. <meta> <script type="server" src="server.lua"/> <script type="client" cache="false" srce="client.lua"/> </meta> the code in server.lua .. Edited June 2, 2017 by iMr.WiFi..! Link to comment
iMr.WiFi..! Posted June 2, 2017 Author Share Posted June 2, 2017 close the topic please , i found the problem .. this because i create vehicle in another world , and players in another world .. 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