Jump to content

مساعدة


Recommended Posts

شباب بدي لما أكتب

/setbounty "إسم لاعب"

يكتب

X set bounty on Z

function setbounty(thePlayer)
local player = getPlayerName(thePlayer)
if player then
					outputChatBox(""..name.." set bounty on "..player.."", root, 255, 255, 255, true)
else
					outputChatBox("لاعب غير موجود", root, 255, 255, 255, true)
					end
					end
			addCommandHandler("setbounty",setbounty)

 

Link to comment
Just now, Snakegold said:

X set bounty on Z

مش فاهم اكس وزيد دي

المهم

1 -  كويس لانك حاطط اول ارقيومنت بلاير تمام بس البلاير دا هو  addCommandHandler اقراء الاساينتكس حق الايفينت  

اللي كتب الكوماند

player playerSource, string commandName [, string arg1, string arg2, ... ] 

وبيصير كودك كذا

function setbounty( player , command , name )
	if ( name ~= nil and getPlayerFromName( name ) ~= false ) then
		outputChatBox( getPlayerName( player ) .. ' set Bounty on ' .. name , root , 255 , 255 , 255 , true )  
	else
		outputChatBox( 'لاعب غير موجود' , root , 255 , 255 , 255 , true )
	end
end

addCommandHandler("setbounty",setbounty)

 

Link to comment

كودك صعب و معقد شوي عليا لأني مازلت ممبتدأ

	function setbounty(thePlayer, playername)
			local player = getPlayerFromNamePart(playername or "")
			local name = getPlayerName(thePlayer)
			if player then
					outputChatBox(""..name.." وضع مبلغ على "..getPlayerName(player).."", root, 255, 255, 255, true)
				else
    					outputChatBox("إسم اللاعب غير موجود", root, 255, 255, 255, true)
    end
  end
addCommandHandler("setbounty", setbounty)


    function getPlayerFromNamePart(name)
    if name then
        for i, player in ipairs(getElementsByType("player")) do
            if string.find(getPlayerName(player):lower(), tostring(name):lower(), 1, true) then
                return player
            end
        end
    end
    return false
end

 

ايش مشكلته هذا؟

Link to comment
Just now, Snakegold said:

كودك صعب و معقد شوي عليا لأني مازلت ممبتدأ


	function setbounty(thePlayer, playername)
			local player = getPlayerFromNamePart(playername or "")
			local name = getPlayerName(thePlayer)
			if player then
					outputChatBox(""..name.." وضع مبلغ على "..getPlayerName(player).."", root, 255, 255, 255, true)
				else
    					outputChatBox("إسم اللاعب غير موجود", root, 255, 255, 255, true)
    end
  end
addCommandHandler("setbounty", setbounty)


    function getPlayerFromNamePart(name)
    if name then
        for i, player in ipairs(getElementsByType("player")) do
            if string.find(getPlayerName(player):lower(), tostring(name):lower(), 1, true) then
                return player
            end
        end
    end
    return false
end

 

ايش مشكلته هذا؟

مب معقد ولا شئ يبيلك تقرا الويكي وشوية تجارب

كودك بيصير كدا

function setbounty( player , _ , name )
    if ( name ~= nil and getPlayerFromNamePart( name ) ~= false ) then
        outputChatBox( getPlayerName( player ) .. ' وضع مبلغ علي ' .. getPlayerName( getPlayerFromNamePart( name ) ) , root , 0 , 255 , 0 , true)
    else
        outputChatBox( 'اسم الاعب غير موجود' , player , 255 , 0 , 0 , true )
    end
end

addCommandHandler( 'setbounty' , setbounty )


function getPlayerFromNamePart( name )
    if( name ) then
        for i, player in ipairs(getElementsByType("player")) do
            if string.find(getPlayerName(player):lower(), tostring(name):lower(), 1, true) then
                return player
            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...