Jump to content

احتاج امر


Recommended Posts

Posted

السلام عليكم

 

ابي اذا شخص كتب كوماند يتسجل الداتا حقته الى ان يموت

مثلا

Ped1

واذا شخص ثاني بعده كتب نفس الامر

Ped2

وشكرا

Posted
addCommandHandler
setElementData
getElementData
-- tables
'onPlayerWasted'

 

Paid scripter / لطلبات البرمجة

Discord : D7ooM#7218

Posted

سوو داتا يوم يكتب الامر

ولما يموت خل قيمة الداتا فولس

 

 
 
 
 
 

 

Posted
local Table , Value = { } , 0

function setLocalData ( Element , Key , Value )
	Table [ Element ] = { [ Key ] = Value }
end 

function getLocalData ( Element , Key )
	return Table [ Element ] [ Key ] or false
end 

addCommandHandler ( 'Real-Madrid' ,
	function ( Player ) 
		setLocalData ( Player , 'Ped;'..Value , true )
		setLocalData ( Player , 'Player-Value' , Value )
		Value = Value + 1
	end 
)

addEventHandler ( 'onPlayerWasted' , root ,
	function ( )
		local DataValue = getLocalData ( source , 'Player-Value' )
		if ( DataValue == false ) then return end 
		setLocalData ( Player , 'Ped;'..DataValue , false )
		setLocalData ( Player , 'Player-Value' , false )
	end 
)

تفضل :-)

[Infinity War] Server - Soon .

Posted (edited)
3 hours ago, Infinity-War said:

local Table , Value = { } , 0

function setLocalData ( Element , Key , Value )
	Table [ Element ] = { [ Key ] = Value }
end 

function getLocalData ( Element , Key )
	return Table [ Element ] [ Key ] or false
end 

addCommandHandler ( 'Real-Madrid' ,
	function ( Player ) 
		setLocalData ( Player , 'Ped;'..Value , true )
		setLocalData ( Player , 'Player-Value' , Value )
		Value = Value + 1
	end 
)

addEventHandler ( 'onPlayerWasted' , root ,
	function ( )
		local DataValue = getLocalData ( source , 'Player-Value' )
		if ( DataValue == false ) then return end 
		setLocalData ( Player , 'Ped;'..DataValue , false )
		setLocalData ( Player , 'Player-Value' , false )
	end 
)

تفضل :-)

يعطيك العافيه

هل تفرق لو حطيتها كلنت او سيرفر ؟

Shared function
 
Edited by #Khaled
Posted
4 hours ago, #Khaled said:

يعطيك العافيه

هل تفرق لو حطيتها كلنت او سيرفر ؟

Shared function
 

الله يعافيك , 
اذا بدك تحولها كلاينت بدل حدث الموت , + في تعديل بسيط عليها , اعذرني :)

 

local Table , Value = { } , 0

function setLocalData ( Element , Key , Value )
	if ( not Table [ Element ] ) then 
		Table [ Element ] = { }
	end 
	Table [ Element ] [ Key ] = Value
	return true
end 

function getLocalData ( Element , Key )
	return Table [ Element ] [ Key ] or false
end 

addCommandHandler ( 'Real-Madrid' ,
	function ( Player ) 
		setLocalData ( Player , 'Ped;'..Value , true )
		setLocalData ( Player , 'Player-Value' , Value )
		Value = Value + 1
	end 
)

addEventHandler ( 'onPlayerWasted' , root ,
	function ( )
		local DataValue = getLocalData ( source , 'Player-Value' )
		if ( DataValue == false ) then return end 
		setLocalData ( Player , 'Ped;'..DataValue , false )
		setLocalData ( Player , 'Player-Value' , false )
	end 
)

 

[Infinity War] Server - Soon .

Posted
3 hours ago, Infinity-War said:

الله يعافيك , 
اذا بدك تحولها كلاينت بدل حدث الموت , + في تعديل بسيط عليها , اعذرني :)

 


local Table , Value = { } , 0

function setLocalData ( Element , Key , Value )
	if ( not Table [ Element ] ) then 
		Table [ Element ] = { }
	end 
	Table [ Element ] [ Key ] = Value
	return true
end 

function getLocalData ( Element , Key )
	return Table [ Element ] [ Key ] or false
end 

addCommandHandler ( 'Real-Madrid' ,
	function ( Player ) 
		setLocalData ( Player , 'Ped;'..Value , true )
		setLocalData ( Player , 'Player-Value' , Value )
		Value = Value + 1
	end 
)

addEventHandler ( 'onPlayerWasted' , root ,
	function ( )
		local DataValue = getLocalData ( source , 'Player-Value' )
		if ( DataValue == false ) then return end 
		setLocalData ( Player , 'Ped;'..DataValue , false )
		setLocalData ( Player , 'Player-Value' , false )
	end 
)

 

فيه مشكله واجهتني وهي

وقت ما حاولت استخدم warpPedIntoVehicle

مع الداتا حقت اللاعبين

طلع لي باد ارقمنت مع اني خليت صاحب الداتا يكون اسمه Ped0

Posted
12 hours ago, Abdul KariM said:

بالكلينت اول ارقمنت الأمر الي انكتب وليس الاعب وورينا كودك addCommandHandler بالنسبة ل

 

    local Table , Value = { } , 0

    function setLocalData ( Element , Key , Value )
    	if ( not Table [ Element ] ) then 
    		Table [ Element ] = { }
    	end 
    	Table [ Element ] [ Key ] = Value
    	return true
    end 

    function getLocalData ( Element , Key )
    	return Table [ Element ] [ Key ] or false
    end 

    addCommandHandler ( 'Test' ,
    	function ( Player ) 
    		setLocalData ( Player , 'Ped;'..Value , true )
    		setLocalData ( Player , 'Player-Value' , Value )
    		Value = Value + 1
    	end 
    )

    addEventHandler ( 'onPlayerWasted' , root ,
    	function ( )
    		local DataValue = getLocalData ( source , 'Player-Value' )
    		if ( DataValue == false ) then return end 
    		setLocalData ( Player , 'Ped;'..DataValue , false )
    		setLocalData ( Player , 'Player-Value' , false )
    	end 
    )

    ---- into -----

    function setupForRace ( )
    local RaceVehicle = createVehicle ( 411, 4, 0, 3 )      
    warpPedIntoVehicle ( Ped0, RaceVehicle0 )                 
     local RaceVehicle = createVehicle ( 411, 4, 0, 3 )           
    warpPedIntoVehicle ( Ped1, RaceVehicle1 )                 
     local RaceVehicle = createVehicle ( 411, 4, 0, 3 )         
    warpPedIntoVehicle ( Ped2, RaceVehicle2 )                
     local RaceVehicle = createVehicle ( 411, 4, 0, 3 )            
    warpPedIntoVehicle ( Ped3, RaceVehicle3 )         
end
addCommandHandler ( "STest", setupForRace )                  

 

Posted
1 hour ago, Infinity-War said:

ما في Ped0 , Ped1 , Ped2 , Ped3 .
:-)

مو مفروض يكون فيه Ped - والقيمه ؟

setLocalData ( Player , 'Ped;'..Value , true )
14 minutes ago, Abdul KariM said:

ايش تبي تسوي بالضبط

ان اللي كتب في اف 8 Test

تتسجل له داتا Pedوالقيمه

يعني اول شخص 1

ثاني شخص 2

الخ

 

وينتقل للسيارة حسب الداتا حقته

 

يعني اذا كان 1

يروح لسيارة 1

 

Posted (edited)
local Count = 0 

local vehicles = { }

for k=1,10 do 
vehicles[k] = createVehicle ( 411 , 0+k*3 , 0 , 3 )
end

addCommandHandler ( "wcar" , function ( player ) 
Count = Count + 1 
setElementData ( player , "Ped:"..tostring(Count) , true )
if ( isElement ( vehicles[Count] ) ) then 
warpPedIntoVehicle ( player , vehicles[Count] )
end 
end ) ; 

 

هذا مثال سويته لك وانت طبقه ع الي انت تبي تسويه

Edited by -Ilker.

Paid scripter / لطلبات البرمجة

Discord : D7ooM#7218

Posted
2 hours ago, -Ilker. said:

local Count = 0 

local vehicles = { }

for k=1,10 do 
vehicles[k] = createVehicle ( 411 , 0+k*3 , 0 , 3 )
end

addCommandHandler ( "wcar" , function ( player ) 
Count = Count + 1 
setElementData ( player , "Ped:"..tostring(Count) , true )
if ( isElement ( vehicles[Count] ) ) then 
warpPedIntoVehicle ( player , vehicles[Count] )
end 
end ) ; 

 

هذا مثال سويته لك وانت طبقه ع الي انت تبي تسويه

 المفروض يكون فيه تحقق ان الاعب ماعنده داتا 

لان الارقمنت سترنق بالاساسtostring ومايحتاج 

  • Like 1

[ Skype : kreee89 - Discord : Abdul_KariM#1326 / طلبات البرمجة

https://www.paypal.me/AbdulKariMx / اذا حاب تدعمني

Posted
53 minutes ago, Abdul KariM said:

 المفروض يكون فيه تحقق ان الاعب ماعنده داتا 

لان الارقمنت سترنق بالاساسtostring ومايحتاج 

متعود اكتبها ال tostring

وانا مسوي الكود فقط عشان يعرف كيف الطريقة ولا كلامك صحيح جزاك الله خير

Paid scripter / لطلبات البرمجة

Discord : D7ooM#7218

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