Jump to content

تصليح كود


Recommended Posts



local marker = createMarker ( 2459.77466,-1661.70081,12.90843 , "cylinder" ,3 , 255 , 255 , 0 , 170)

function fixVehicle()

     	 getPlayerMoney ( source )
		
		if getPlayerMoney (source ) <= 500 then
		
		fixVehicle (vehicleValue)
		
		outputChatBox ( "تم تصليح سيارتك واخذ منك 500 دولار" )
		
		if getPlayerMoney ( source ) >= 500 then
		
		
		outputChatBox ( "السياره لتصليح كافي نقود يوجد معك لا" )
		
		end
	end
end

addEventHandler	("onClientMarkerHit",marker)

 

Edited by MR.President
Link to comment
local marker = createMarker ( 2459.77466,-1661.70081,12.90843 , "cylinder" ,3 , 255 , 255 , 0 , 170)
addEventHandler	("onClientMarkerHit",marker
function ()
cost = getPlayerMoney ()
if cost >= 500 then		
fixVehicle (vehicleValue)
takePlayerMoney (500)       
outputChatBox ( "تم تصليح سيارتك واخذ منك 500 دولار" )		
else			
outputChatBox ( "السياره لتصليح كافي نقود يوجد معك لا" )
end
end)

 

Link to comment
Just now, MR.President said:

ما ضبط يجبلي انه في مشكله بسطر الثاني ما في قوس 

سوي فاصلة امام marker

معي لاق ماقدرت اعدل

local marker = createMarker ( 2459.77466,-1661.70081,12.90843 , "cylinder" ,3 , 255 , 255 , 0 , 170)
addEventHandler	("onClientMarkerHit",marker,
function ()
cost = getPlayerMoney ()
if cost >= 500 then		
fixVehicle (vehicleValue)
takePlayerMoney (500)       
outputChatBox ( "تم تصليح سيارتك واخذ منك 500 دولار" )		
else			
outputChatBox ( "السياره لتصليح كافي نقود يوجد معك لا" )
end
end)

 

Link to comment
4 minutes ago, MR.President said:

بس اقرب على الماركر ما يصلح السياره بس ياخذ 500

local marker = createMarker ( 2459.77466,-1661.70081,12.90843 , "cylinder" ,3 , 255 , 255 , 0 , 170)
addEventHandler	("onClientMarkerHit",marker,
function ()
veh = getPedOccupiedVehicle (localPlayer)
cost = getPlayerMoney ()
if cost >= 500 then
if veh then
fixVehicle (veh)
takePlayerMoney (500)       
outputChatBox ( "تم تصليح سيارتك واخذ منك 500 دولار" )		
else			
outputChatBox ( "السياره لتصليح كافي نقود يوجد معك لا" )
else
outputChatBox ( "لست راكبا سيارة" )
end
      end
end)

 

Edited by #BrosS
Link to comment

جرب :
 

addEventHandler	( 'onClientMarkerHit',marker,
	function ( hitPlayer )
        if hitPlayer == localPlayer then
		local car = getPedOccupiedVehicle ( localPlayer )
			if car then
		local Money = getPlayerMoney ( localPlayer )
			if Money > 500 then
		fixVehicle ( car )
		takePlayerMoney ( 500 )
			outputChatBox ( "* Done Fix Car : "..Money.." ",0,255,0,true )
		else
			outputChatBox ( "* You Dont have moeny",255,0,0,true )
		end
      end
	 end
  end
)

 

Edited by Deativated
Link to comment
7 minutes ago, MR.President said:

لسا مب عارف  

مكتوب انه في السطر السابع في 

if

وما في الها

 end


جرب ذا وشوف


 

local marker = createMarker ( 2459.77466,-1661.70081,12.90843 , "cylinder" ,3 , 255 , 255 , 0 , 170)
addEventHandler	("onClientMarkerHit",marker,
	function ( DeveloperAhmed )
		if ( DeveloperAhmed == localPlayer )  then
		local PlayerCar	= getPedOccupiedVehicle ( DeveloperAhmed )
		local PlayerMoney	= getPlayerMoney ()
		if PlayerMoney >= 500 then
			if PlayerCar then
				fixVehicle ( PlayerCar )
				takePlayerMoney	( 500 )       
				outputChatBox ( "your car fixed - Cost: 500$" )
			else
				outputChatBox ( "you are not in vehicle" )
			end
		else
			outputChatBox ( "you have no money - your money < 500 $" )
		end
		end
	end
)



ملاحظة : اللعبة ما تشتغل عندي الاكواد اما اسويها بدون تجربة او اعدل عليها بدون تجربة

  • Like 1
Link to comment
11 minutes ago, Deativated said:

جرب :
 


addEventHandler	( 'onClientMarkerHit',marker,
	function ( hitPlayer )
        if hitPlayer == localPlayer then
		local car = getPedOccupiedVehicle ( localPlayer )
			if car then
		local Money = getPlayerMoney ( localPlayer )
			if Money > 500 then
		fixVehicle ( car )
		takePlayerMoney ( localPlayer, 500 )
			outputChatBox ( "* Done Fix Car : "..Money.." ",0,255,0,true )
		else
			outputChatBox ( "* You Dont have moeny",255,0,0,true )
		end
      end
	 end
  end
)

 

takePlayerMoney -- مافيه باراماتر اللاعب بالكلنت

  • Like 1
Link to comment
-- Client Side - 
addEventHandler	( 'onClientMarkerHit',marker,
function ( hitPlayer )
if hitPlayer == localPlayer then
triggerServerEvent ( "Fix", localPlayer )
end
end
)

-- Server Side --
addEvent ( "Fix", true )
addEventHandler ( "Fix", root,
function (  )
local car = getPedOccupiedVehicle ( source )
if car then
local Money = getPlayerMoney ( source )
if Money > 500 then
fixVehicle ( car )
takePlayerMoney ( source, 500 )
outputChatBox ( "You fix",source,255,0,0,true )
else
outputChatBox ( "* You Dont have moeny",source,255,0,0,true )
end
end
end
)

 

Edited by Deativated
Link to comment
outputChatBox ( " Text " , source , 0 , 255 , 0 , true )

-- " Text " بارمتر الكلام بالشات
-- source بارمتر لمين تظهر الرسالة ؟
-- 0 255 0 بارمتر الالوان احمر ، ازرق ، اخضر
-- true بارمتر تفعيل كود الالوان بالشات 

بين كل بارمتر تحط فاصلة ( , )

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...