Jump to content

تحت التطوير :كود - Useful Arab functions


Booo

Recommended Posts

event onPlayerMoneyChanged

addEventHandler('onPlayerLogin',root,function()
local acc=getPlayerAccount(source)
if not getAccountData(acc,'money') then
setAccountData(acc,'money',getPlayerMoney(source))
end
end)
setTimer(function()
for k,plr in ipairs(getElementsByType('player'))do
if getElementType(plr)=='player' then
if getPlayerMoney(plr)~=tonumber(getAccountData(getPlayerAccount(plr),'money')) then
local acc=getPlayerAccount(plr)
if not isGuestAccount(acc) then
setAccountData(acc,'money',money)
triggerEvent('onPlayerMoneyChanged',root,getAccountName(acc),getPlayerMoney(plr),plr)
end
end
end
end
end,1000,0)
addEvent('onPlayerMoneyChanged',true)

parameters:

string accname,number money, player plr

accname=اسم حساب  اللي تغيرت فلوسه

money=الفلوس الجديده بعد التغير

plr=اللاعب اللي تغيرت فلوسه

مثال:

Example:

addEventHandler('onPlayerMoneyChanged',root,function(accname,money,plr)
setAccountData(getAccount(accname),'mymoney',money)
end)

بالتوفيق للجميع

Link to comment
Just now, Master_MTA said:

event onPlayerMoneyChanged


addEventHandler('onPlayerLogin',root,function()
local acc=getPlayerAccount(source)
if not getAccountData(acc,'money') then
setAccountData(acc,'money',getPlayerMoney(source))
end
end)
setTimer(function()
for k,plr in ipairs(getElementsByType('player'))do
if getElementType(plr)=='player' then
if getPlayerMoney(plr)~=tonumber(getAccountData(getPlayerAccount(plr),'money')) then
local acc=getPlayerAccount(plr)
if not isGuestAccount(acc) then
setAccountData(acc,'money',money)
triggerEvent('onPlayerMoneyChanged',root,getAccountName(acc),getPlayerMoney(plr),plr)
end
end
end
end
end,1000,0)
addEvent('onPlayerMoneyChanged',true)

parameters:

string accname,number money, player plr

accname=اسم حساب  اللي تغيرت فلوسه

money=الفلوس الجديده بعد التغير

plr=اللاعب اللي تغيرت فلوسه

مثال:

Example:


addEventHandler('onPlayerMoneyChanged',root,function(accname,money,plr)
setAccountData(getAccount(accname),'mymoney',money)
end)

بالتوفيق للجميع

موجودة من قبل

Link to comment
Just now, #_iMr.[E]coo said:

موجودة من قبل

والله مدري انا صنعتها لنفسي وقلت خلني اشاركها معكم على العموم منك نستفيد يا مستر ايكو

لكني بحثت عنها يا عسل ولم اجدها تقدر توريني وين موجوده +_+

Link to comment
1 minute ago, Master_MTA said:

والله مدري انا صنعتها لنفسي وقلت خلني اشاركها معكم على العموم منك نستفيد يا مستر ايكو

لكني بحثت عنها يا عسل ولم اجدها تقدر توريني وين موجوده +_+

https://forum.multitheftauto.com/topic/42698-تحت-التطوير-كود-useful-arab-functions/?do=findComment&comment=770503

Link to comment
Just now, #_iMr.[E]coo said:

كمان في كود الوحش تحت رده بنفس الصفحة ، تقدر تستفيد منه 

يعطيك العافيه والله لو اني ادري ما كنت سويتها لاني بحثت عنها في اليوزفل فنكشن ما حصلتها على العموم مشكور +_+

Link to comment
17 hours ago, Default said:

رائعه الوظيفة صراحتاً , بس لو تعدل عليها مو شرط لوحة اي شيء من العناصر الي بـ gui

شكرا على رايك :*


 

local Check = { 
	[ 'window' ] = true ,
	[ 'button' ] = true ,
	[ 'label' ] = true ,
	[ 'memo' ] = true ,
	[ 'combobox' ] = true ,
	[ 'radiobutton' ] = true ,
	[ 'edit' ] = true ,
	[ 'tab' ] = true ,
	[ 'tabpanel' ] = true 
}

function guiGetElement ( Name , Type )
	if ( type ( Name ) == 'string' and Check [ Type ] ) then 
		for _ , v in ipairs ( getElementsByType ( 'gui-' .. Type ) ) do 
			if ( guiGetText ( v ) == Name ) then 
				return v
			end
		end
	end
	return false 
end

 

Edited by #Soking
  • Like 2
Link to comment
aBlip , aCounter = { } , { }

function createFlashingBlip ( Player , iCon , xPos , yPos , Number ) 
if ( getElementType ( Player ) == 'player' and type ( iCon ) == 'number' and type ( xPos ) == 'number' and type ( yPos ) == 'number' and type ( Number ) == 'number' ) then 
	aBlip [ Player ] , aCounter [ Player ] = nil , 0
		setTimer ( function ( Player )
			setTimer ( function ( Player ) 
				if ( isElement ( aBlip [ Player ] ) ) then destroyElement ( aBlip [ Player ] ) aCounter [ Player ] = aCounter [ Player ] + 1
					if ( aCounter [ Player ] == 20 ) then 
						aBlip [ Player ] = createBlip ( xPos , yPos , 0 , iCon ) 
						setElementData ( aBlip [ Player ] , 'Owner' , Player )
						setElementData ( aBlip [ Player ] , 'Number' , Number )
					end 
				end
			end , 50 , 1 , Player )
		aBlip [ Player ] = createBlip ( xPos , yPos , 0 , iCon )
	end , 200 , 20 , Player )
end 

	-------------
	  -----------
		----
		
		
function getFlashingBlip ( Player , iCon , Number ) 
	if ( getElementType ( Player ) == 'player' and type ( iCon ) == 'number' and type ( Number ) == 'number' ) then 
		for _ , v in ipairs ( getElementsByType ( 'blip' ) ) do 
			local Owner , aNumber = getElementData ( v , 'Owner' ) , getElementData ( v , 'Number' ) 
				if ( getBlipIcon ( v ) == iCon and Owner == Player and aNumber == Number ) then 
					return v 
				end
			end
		end
	return false 
end 

سلام عليكم اليوم اطرح لكم وظيفتين 

بمناسبه حلول شهر رمضان الكريم , بالبدايه كل عام وانتم بخير , واسف لو في اخطاء ( جوال )- المهم
 

الفكره أنها تسوي لك بليب ( علامه ) تختفي و تظهر بسرعه بغرض لفت نظر الاعب لهأ 

 

Server Side

 

ولكل علامه تسوي لها رقم معين عشان تستدعي العلامه عبرهأ 

مثل مأ تلاحظون في 

xPos , yPos

مأفي z

لآنه مأله أهميه للعلآمه , :D
 

المهم


 

createFlashingBlip ( Player , iCon , xPos , yPos , Number ) 

الاعب و اي دي العلامه و الاحدثيات و الرقم الخاص عشان تستدعي العلامه 

 

و عشان تستدعيها مثلا

destroyElement ( getFlashingBlip ( Player , iCon , Number ) )

و تعبي الباينات

أترككم للتجربه

 

يا ليت اي خطء او بق خبروني

Edited by #Soking
  • Like 3
Link to comment
9 hours ago, #Soking said:

aBlip , aCounter = { } , { }

function createFlashingBlip ( Player , iCon , xPos , yPos , Number ) 
if ( getElementType ( Player ) == 'player' and type ( iCon ) == 'number' and type ( xPos ) == 'number' and type ( yPos ) == 'number' and type ( Number ) == 'number' ) then 
	aBlip [ Player ] , aCounter [ Player ] = nil , 0
		setTimer ( function ( Player )
			setTimer ( function ( Player ) 
				if ( isElement ( aBlip [ Player ] ) ) then destroyElement ( aBlip [ Player ] ) aCounter [ Player ] = aCounter [ Player ] + 1
					if ( aCounter [ Player ] == 20 ) then 
						aBlip [ Player ] = createBlip ( xPos , yPos , 0 , iCon ) 
						setElementData ( aBlip [ Player ] , 'Owner' , Player )
						setElementData ( aBlip [ Player ] , 'Number' , Number )
					end 
				end
			end , 50 , 1 , Player )
		aBlip [ Player ] = createBlip ( xPos , yPos , 0 , iCon )
	end , 200 , 20 , Player )
end 

	-------------
	  -----------
		----
		
		
function getFlashingBlip ( Player , iCon , Number ) 
	if ( getElementType ( Player ) == 'player' and type ( iCon ) == 'number' and type ( Number ) == 'number' ) then 
		for _ , v in ipairs ( getElementsByType ( 'blip' ) ) do 
			local Owner , aNumber = getElementData ( v , 'Owner' ) , getElementData ( v , 'Number' ) 
				if ( getBlipIcon ( v ) == iCon and Owner == Player and aNumber == Number ) then 
					return v 
				end
			end
		end
	return false 
end 

سلام عليكم اليوم اطرح لكم وظيفتين 

بمناسبه حلول شهر رمضان الكريم , بالبدايه كل عام وانتم بخير , واسف لو في اخطاء ( جوال )- المهم
 

الفكره أنها تسوي لك بليب ( علامه ) تختفي و تظهر بسرعه بغرض لفت نظر الاعب لهأ 

 

Server Side

 

ولكل علامه تسوي لها رقم معين عشان تستدعي العلامه عبرهأ 

مثل مأ تلاحظون في 

xPos , yPos

مأفي z

لآنه مأله أهميه للعلآمه , :D
 

المهم


 


createFlashingBlip ( Player , iCon , xPos , yPos , Number ) 

الاعب و اي دي العلامه و الاحدثيات و الرقم الخاص عشان تستدعي العلامه 

 

و عشان تستدعيها مثلا


destroyElement ( getFlashingBlip ( Player , iCon , Number ) )

و تعبي الباينات

أترككم للتجربه

 

يا ليت اي خطء او بق خبروني

رآئع ,
لكن ناقص إيند لسطر 4 ..
@#Soking

Link to comment
1 minute ago, MR.StoRm said:

لا بس ناقص إيند لسطر خمسة آسف مب اربعة ض
بالتوفيق

اوك براجعه ولو في خطء بصلحه

19 minutes ago, MR.StoRm said:

لا بس ناقص إيند لسطر خمسة آسف مب اربعة ض
بالتوفيق

aBlip , aCounter = { } , { }

function createFlashingBlip ( Player , iCon , xPos , yPos , Number ) 
if ( getElementType ( Player ) == 'player' and type ( iCon ) == 'number' and type ( xPos ) == 'number' and type ( yPos ) == 'number' and type ( Number ) == 'number' ) then 
	aBlip [ Player ] , aCounter [ Player ] = nil , 0
		setTimer ( function ( Player )
			setTimer ( function ( Player ) 
				if ( isElement ( aBlip [ Player ] ) ) then destroyElement ( aBlip [ Player ] ) aCounter [ Player ] = aCounter [ Player ] + 1
					if ( aCounter [ Player ] == 20 ) then 
						aBlip [ Player ] = createBlip ( xPos , yPos , 0 , iCon ) 
						setElementData ( aBlip [ Player ] , 'Owner' , Player )
						setElementData ( aBlip [ Player ] , 'Number' , Number )
					end 
				end
			end , 50 , 1 , Player )
		aBlip [ Player ] = createBlip ( xPos , yPos , 0 , iCon )
		end , 200 , 20 , Player )
	end 
end

	-------------
	  -----------
		----
		
		
function getFlashingBlip ( Player , iCon , Number ) 
	if ( getElementType ( Player ) == 'player' and type ( iCon ) == 'number' and type ( Number ) == 'number' ) then 
		for _ , v in ipairs ( getElementsByType ( 'blip' ) ) do 
			local Owner , aNumber = getElementData ( v , 'Owner' ) , getElementData ( v , 'Number' ) 
				if ( getBlipIcon ( v ) == iCon and Owner == Player and aNumber == Number ) then 
					return v 
				end
			end
		end
	return false 
end 

شكرا على الملاحظه تم التعديل

Link to comment
2 hours ago, #Soking said:

اوك براجعه ولو في خطء بصلحه


aBlip , aCounter = { } , { }

function createFlashingBlip ( Player , iCon , xPos , yPos , Number ) 
if ( getElementType ( Player ) == 'player' and type ( iCon ) == 'number' and type ( xPos ) == 'number' and type ( yPos ) == 'number' and type ( Number ) == 'number' ) then 
	aBlip [ Player ] , aCounter [ Player ] = nil , 0
		setTimer ( function ( Player )
			setTimer ( function ( Player ) 
				if ( isElement ( aBlip [ Player ] ) ) then destroyElement ( aBlip [ Player ] ) aCounter [ Player ] = aCounter [ Player ] + 1
					if ( aCounter [ Player ] == 20 ) then 
						aBlip [ Player ] = createBlip ( xPos , yPos , 0 , iCon ) 
						setElementData ( aBlip [ Player ] , 'Owner' , Player )
						setElementData ( aBlip [ Player ] , 'Number' , Number )
					end 
				end
			end , 50 , 1 , Player )
		aBlip [ Player ] = createBlip ( xPos , yPos , 0 , iCon )
		end , 200 , 20 , Player )
	end 
end

	-------------
	  -----------
		----
		
		
function getFlashingBlip ( Player , iCon , Number ) 
	if ( getElementType ( Player ) == 'player' and type ( iCon ) == 'number' and type ( Number ) == 'number' ) then 
		for _ , v in ipairs ( getElementsByType ( 'blip' ) ) do 
			local Owner , aNumber = getElementData ( v , 'Owner' ) , getElementData ( v , 'Number' ) 
				if ( getBlipIcon ( v ) == iCon and Owner == Player and aNumber == Number ) then 
					return v 
				end
			end
		end
	return false 
end 

شكرا على الملاحظه تم التعديل

 

2 hours ago, #Soking said:

اوك براجعه ولو في خطء بصلحه


aBlip , aCounter = { } , { }

function createFlashingBlip ( Player , iCon , xPos , yPos , Number ) 
if ( getElementType ( Player ) == 'player' and type ( iCon ) == 'number' and type ( xPos ) == 'number' and type ( yPos ) == 'number' and type ( Number ) == 'number' ) then 
	aBlip [ Player ] , aCounter [ Player ] = nil , 0
		setTimer ( function ( Player )
			setTimer ( function ( Player ) 
				if ( isElement ( aBlip [ Player ] ) ) then destroyElement ( aBlip [ Player ] ) aCounter [ Player ] = aCounter [ Player ] + 1
					if ( aCounter [ Player ] == 20 ) then 
						aBlip [ Player ] = createBlip ( xPos , yPos , 0 , iCon ) 
						setElementData ( aBlip [ Player ] , 'Owner' , Player )
						setElementData ( aBlip [ Player ] , 'Number' , Number )
					end 
				end
			end , 50 , 1 , Player )
		aBlip [ Player ] = createBlip ( xPos , yPos , 0 , iCon )
		end , 200 , 20 , Player )
	end 
end

	-------------
	  -----------
		----
		
		
function getFlashingBlip ( Player , iCon , Number ) 
	if ( getElementType ( Player ) == 'player' and type ( iCon ) == 'number' and type ( Number ) == 'number' ) then 
		for _ , v in ipairs ( getElementsByType ( 'blip' ) ) do 
			local Owner , aNumber = getElementData ( v , 'Owner' ) , getElementData ( v , 'Number' ) 
				if ( getBlipIcon ( v ) == iCon and Owner == Player and aNumber == Number ) then 
					return v 
				end
			end
		end
	return false 
end 

شكرا على الملاحظه تم التعديل

العفو حياك الله ,
وظيفة رائعة !

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