Jump to content

[ Problem ] They Cant see my haydra


Recommended Posts

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 by iMr.WiFi..!
Link to comment
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 by iMr.WiFi..!
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...