Jump to content

كود الرتبة مايضبط


Recommended Posts

سلام عليكم

هالرتبة الي بوزعها بي سطر اكتبها

-- ( ***************************** ) -- 
-- ( Give Player Rank ) -- 
-- ( Created By Sm0ke Or iMr.Omar ) -- 
-- ( Skype : live:omarnone ) --
-- ( ***************************** ) --


-- Settings 


commandtogive = 'رتبة' 


----- Functions 


function isPlayerInACL ( player , acl )
if ( getElementType ( player ) == 'player' and type ( acl ) == 'string') then 
if ( not isGuestAccount ( getPlayerAccount ( player ) ) ) then 
if isObjectInACLGroup ( 'user.'..getAccountName(getPlayerAccount(player)), aclGetGroup ( acl ) ) then
return true 
else
return false 
							end
					end	
		end
end

function addPlayerToGroup ( player , acl )
if ( getElementType ( player ) == 'player' and type ( acl ) == 'string' ) then 
if ( not isGuestAccount ( getPlayerAccount ( player ) ) ) then 
aclGroupAddObject ( aclGetGroup ( acl ), 'user.'..getAccountName(getPlayerAccount(player)) )
				end
		end
end

------- Code

addCommandHandler('gift', function (player,_,group)
local Groupname = table.concat({ group }, " ")
if ( Groupname ) then
setElementData(resourceRoot,'Status',true)
setElementData(resourceRoot,'Rank',Groupname)
outputChatBox('* يـوجد توزيع رتبه : '..Groupname..' | أكتب بـ اف 8 : '..commandtogive..' لـ استلام الرتبة !',root,0,255,0,true)
else
outputChatBox('* الرجاء كتابة اسم القروب ',player,255,0,0,true)
end
end
)

addCommandHandler('stopgift', function (player)
if ( getElementData ( resourceRoot , 'Status' ) == true ) then 
setElementData (resourceRoot,'Status',false)
setElementData(resourceRoot,'Rank','None')
outputChatBox('* تـم إيقاف التوزيع !',root,0,255,0,true)
else
outputChatBox('* لأيوجد توزيع لـ إيقافه',player,255,0,0,true)
		end
end
)


addCommandHandler(commandtogive, function (player)
if ( getElementData ( resourceRoot , 'Status' ) == true ) then 
if ( not isGuestAccount ( getPlayerAccount ( player ) ) ) then 
if ( not isPlayerInACL ( player , getElementData ( resourceRoot , 'Rank' ) ) ) then 
addPlayerToGroup ( player , getElementData ( resourceRoot , 'Rank' ) ) 
outputChatBox('* تـم إستلأم الرتبة بنجاح ',player,0,255,0,true)
else
outputChatBox('* لديك هاذي الرتبة من قبل !',player,255,0,0,true)
end
else
outputChatBox('* الرجأء تسجيل الدخول , لـ تاخذ الهدية ',player,255,0,0,true)
end
else
outputChatBox('* لايوجد توزيع !',player,255,0,0,true)
end
end
)

--- # Event

addEventHandler('onResourceStart',resourceRoot, function (		)
for k,g in ipairs ( getElementsByType('player') ) do 
outputChatBox('توزيع',g,255,255,255,true)
		end
end
)


addEventHandler('onResourceStop',resourceRoot, function (	)
setElementData ( resourceRoot , 'Status' , false )
setElementData ( resourceRoot , 'Rank', 'None')
end
)


--- Thanks To Download This Script 
-- Please Add This Script at Admin Group 
-- Ex : resource.resourceName
-- See You

 

Link to comment
3 hours ago, GTA San said:

سلام عليكم

هالرتبة الي بوزعها بي سطر اكتبها


-- ( ***************************** ) -- 
-- ( Give Player Rank ) -- 
-- ( Created By Sm0ke Or iMr.Omar ) -- 
-- ( Skype : live:omarnone ) --
-- ( ***************************** ) --


-- Settings 


commandtogive = 'رتبة' 


----- Functions 


function isPlayerInACL ( player , acl )
if ( getElementType ( player ) == 'player' and type ( acl ) == 'string') then 
if ( not isGuestAccount ( getPlayerAccount ( player ) ) ) then 
if isObjectInACLGroup ( 'user.'..getAccountName(getPlayerAccount(player)), aclGetGroup ( acl ) ) then
return true 
else
return false 
							end
					end	
		end
end

function addPlayerToGroup ( player , acl )
if ( getElementType ( player ) == 'player' and type ( acl ) == 'string' ) then 
if ( not isGuestAccount ( getPlayerAccount ( player ) ) ) then 
aclGroupAddObject ( aclGetGroup ( acl ), 'user.'..getAccountName(getPlayerAccount(player)) )
				end
		end
end

------- Code

addCommandHandler('gift', function (player,_,group)
local Groupname = table.concat({ group }, " ")
if ( Groupname ) then
setElementData(resourceRoot,'Status',true)
setElementData(resourceRoot,'Rank',Groupname)
outputChatBox('* يـوجد توزيع رتبه : '..Groupname..' | أكتب بـ اف 8 : '..commandtogive..' لـ استلام الرتبة !',root,0,255,0,true)
else
outputChatBox('* الرجاء كتابة اسم القروب ',player,255,0,0,true)
end
end
)

addCommandHandler('stopgift', function (player)
if ( getElementData ( resourceRoot , 'Status' ) == true ) then 
setElementData (resourceRoot,'Status',false)
setElementData(resourceRoot,'Rank','None')
outputChatBox('* تـم إيقاف التوزيع !',root,0,255,0,true)
else
outputChatBox('* لأيوجد توزيع لـ إيقافه',player,255,0,0,true)
		end
end
)


addCommandHandler(commandtogive, function (player)
if ( getElementData ( resourceRoot , 'Status' ) == true ) then 
if ( not isGuestAccount ( getPlayerAccount ( player ) ) ) then 
if ( not isPlayerInACL ( player , getElementData ( resourceRoot , 'Rank' ) ) ) then 
addPlayerToGroup ( player , getElementData ( resourceRoot , 'Rank' ) ) 
outputChatBox('* تـم إستلأم الرتبة بنجاح ',player,0,255,0,true)
else
outputChatBox('* لديك هاذي الرتبة من قبل !',player,255,0,0,true)
end
else
outputChatBox('* الرجأء تسجيل الدخول , لـ تاخذ الهدية ',player,255,0,0,true)
end
else
outputChatBox('* لايوجد توزيع !',player,255,0,0,true)
end
end
)

--- # Event

addEventHandler('onResourceStart',resourceRoot, function (		)
for k,g in ipairs ( getElementsByType('player') ) do 
outputChatBox('توزيع',g,255,255,255,true)
		end
end
)


addEventHandler('onResourceStop',resourceRoot, function (	)
setElementData ( resourceRoot , 'Status' , false )
setElementData ( resourceRoot , 'Rank', 'None')
end
)


--- Thanks To Download This Script 
-- Please Add This Script at Admin Group 
-- Ex : resource.resourceName
-- See You

 

طيب وش المشكله

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