Jump to content

مساعده بكود


Recommended Posts

شباب وش الخطا هنا 
يطلعلي الثاني هو الاول 

طبعا السيرفر شوتر

function giveMoneyWinDie ( )
	local account = getPlayerAccount ( source );
	local playersAlive = getAliveGuys ( 2 );
	local playersDead = getDeadGuys ( );
	local pAll = playersAlive + playersDead;
	local checkYourPos = pAll - playersDead;
	local pos = nil;
	if tonumber ( checkYourPos ) == 1 then pos = 1 else pos = checkYourPos+1 ; end
	if tonumber ( checkYourPos ) == 2 then pos = 2; end
	if pos == 1 or pos == 21 or pos == 31 then
		posName = "st";
	elseif pos == 2 or pos == 22 or pos == 32 then
		posName = "nd";
	elseif pos == 3 or pos == 23 or pos == 33 then
		posName = "rd";
	
	else
		posName = "th";
	end
	if not getElementData ( source, "gotMoney" ) then
		local money = math.ceil ( getPlayerCount ( ) * 50 / pos );
		givePlayerMoney ( source, money );
		outputChatBox ( "* You were #abcdef[#ff0000" .. pos .. posName .. "#abcdef]#ffffff and #abcdefearned #ffffff" .. money .. "#00ff00$!", source, 255, 255, 255, true );
		setElementData ( source, "gotMoney", true );
		if account then
			setAccountData ( account, "money", tostring ( getPlayerMoney ( source ) ) );
			
		end
	end
end
addEventHandler ( "onPlayerWasted", root , giveMoneyWinDie )

 

Link to comment

مود يعطي لاعب فلوس لما يفوز بسيرفر شوتر على حسب مرتبته

 

الكود كامل


function sortCompareFunction ( s1, s2 )
	if type ( s1 ) == "table" and type ( s2 ) == "table" then
		s1, s2 = s1.name, s2.name;
	end
    s1, s2 = s1:lower ( ), s2:lower( );
    if s1 == s2 then
        return false
    end
    local byte1, byte2 = string.byte ( s1:sub ( 1, 1 ) ), string.byte ( s2:sub ( 1, 1 ) );
    if not byte1 then
        return true
    elseif not byte2 then
        return false
    elseif byte1 < byte2 then
        return true
    elseif byte1 == byte2 then
        return sortCompareFunction ( s1:sub ( 2 ), s2:sub ( 2 ) );
    else
        return false
    end
end

function getAliveGuys ( mode )
	if not mode then return end
	pAlive = { };
	for _, player in ipairs ( getElementsByType ( "player" ) ) do
		if ( getElementData ( player, "state" ) == "alive" ) then
			table.insert ( pAlive, player );
		end
	end	
	if mode == 1 then
		return pAlive;
	elseif mode == 2 then
		return #pAlive;
	elseif mode == 3 then
		if pAlive then
			pAlive = nil;
		end
		return false
	end
end

function getDeadGuys ( )
	local pDead = 0
	for _, player in ipairs ( getElementsByType ( "player" ) ) do
		if getElementData ( player, "state" ) == "dead" then
			pDead = pDead + 1;
		end
	end
	return pDead;
end

function giveMoneyWinDie ( )
	local account = getPlayerAccount ( source );
	local playersAlive = getAliveGuys ( 2 );
	local playersDead = getDeadGuys ( );
	local pAll = playersAlive + playersDead;
	local checkYourPos = pAll - playersDead;
	local pos = nil;
	if tonumber ( checkYourPos ) == 1 then pos = 1 else pos = checkYourPos+1 ; end
	if tonumber ( checkYourPos ) == 2 then pos = 2; end
	if pos == 1 or pos == 21 or pos == 31 then
		posName = "st";
	elseif pos == 2 or pos == 22 or pos == 32 then
		posName = "nd";
	elseif pos == 3 or pos == 23 or pos == 33 then
		posName = "rd";
	
	else
		posName = "th";
	end
	if not getElementData ( source, "gotMoney" ) then
		local money = math.ceil ( getPlayerCount ( ) * 50 / pos );
		givePlayerMoney ( source, money );
		outputChatBox ( "* You were #abcdef[#ff0000" .. pos .. posName .. "#abcdef]#ffffff and #abcdefearned #ffffff" .. money .. "#00ff00$!", source, 255, 255, 255, true );
		setElementData ( source, "gotMoney", true );
		if account then
			setAccountData ( account, "money", tostring ( getPlayerMoney ( source ) ) );
			
		end
	end
end
addEventHandler ( "onPlayerWasted", root , giveMoneyWinDie )

 

Link to comment
42 minutes ago, Master_MTA said:

مود يعطي لاعب فلوس لما يفوز بسيرفر شوتر على حسب مرتبته

 

الكود كامل


function sortCompareFunction ( s1, s2 )	if type ( s1 ) == "table" and type ( s2 ) == "table" then		s1, s2 = s1.name, s2.name;	end    s1, s2 = s1:lower ( ), s2:lower( );    if s1 == s2 then        return false    end    local byte1, byte2 = string.byte ( s1:sub ( 1, 1 ) ), string.byte ( s2:sub ( 1, 1 ) );    if not byte1 then        return true    elseif not byte2 then        return false    elseif byte1 < byte2 then        return true    elseif byte1 == byte2 then        return sortCompareFunction ( s1:sub ( 2 ), s2:sub ( 2 ) );    else        return false    endendfunction getAliveGuys ( mode )	if not mode then return end	pAlive = { };	for _, player in ipairs ( getElementsByType ( "player" ) ) do		if ( getElementData ( player, "state" ) == "alive" ) then			table.insert ( pAlive, player );		end	end		if mode == 1 then		return pAlive;	elseif mode == 2 then
		return #pAlive;
	elseif mode == 3 then
		if pAlive then
			pAlive = nil;
		end
		return false
	end
end

function getDeadGuys ( )
	local pDead = 0
	for _, player in ipairs ( getElementsByType ( "player" ) ) do
		if getElementData ( player, "state" ) == "dead" then
			pDead = pDead + 1;
		end
	end
	return pDead;
end

function giveMoneyWinDie ( )
	local account = getPlayerAccount ( source );
	local playersAlive = getAliveGuys ( 2 );
	local playersDead = getDeadGuys ( );
	local pAll = playersAlive + playersDead;
	local checkYourPos = pAll - playersDead;
	local pos = nil;
	if tonumber ( checkYourPos ) == 1 then pos = 1 else pos = checkYourPos+1 ; end
	if tonumber ( checkYourPos ) == 2 then pos = 2; end
	if pos == 1 or pos == 21 or pos == 31 then
		posName = "st";
	elseif pos == 2 or pos == 22 or pos == 32 then
		posName = "nd";
	elseif pos == 3 or pos == 23 or pos == 33 then
		posName = "rd";
	
	else
		posName = "th";
	end
	if not getElementData ( source, "gotMoney" ) then
		local money = math.ceil ( getPlayerCount ( ) * 50 / pos );
		givePlayerMoney ( source, money );
		outputChatBox ( "* You were #abcdef[#ff0000" .. pos .. posName .. "#abcdef]#ffffff and #abcdefearned #ffffff" .. money .. "#00ff00$!", source, 255, 255, 255, true );
		setElementData ( source, "gotMoney", true );
		if account then
			setAccountData ( account, "money", tostring ( getPlayerMoney ( source ) ) );
			
		end
	end
end
addEventHandler ( "onPlayerWasted", root , giveMoneyWinDie )

 




function sortCompareFunction ( s1, s2 )

if type ( s1 ) == "table" and type ( s2 ) == "table" then

s1, s2 = s1.name, s2.name;

end

s1, s2 = s1:lower ( ), s2:lower( );

if s1 == s2 then

return false

end

local byte1, byte2 = string.byte ( s1:sub ( 1, 1 ) ), string.byte ( s2:sub ( 1, 1 ) );

if not byte1 then

return true

elseif not byte2 then

return false

elseif byte1 < byte2 then

return true

elseif byte1 == byte2 then

return sortCompareFunction ( s1:sub ( 2 ), s2:sub ( 2 ) );

else

return false

end

end



function getAliveGuys ( mode )

if not mode then return end

pAlive = { };

for _, player in ipairs ( getElementsByType ( "player" ) ) do

if ( getElementData ( player, "state" ) == "alive" ) then

table.insert ( pAlive, player );

end

end

if mode == 1 then

return pAlive;

elseif mode == 2 then

return #pAlive;

elseif mode == 3 then

if pAlive then

pAlive = nil;

end

return false

end

end



function getDeadGuys ( )

local pDead = 0

for _, player in ipairs ( getElementsByType ( "player" ) ) do

if getElementData ( player, "state" ) == "dead" then

pDead = pDead + 1;

end

end

return pDead;

end



function giveMoneyWinDie ( )

local account = getPlayerAccount ( source );

local playersAlive = getAliveGuys ( 2 );

local playersDead = getDeadGuys ( );

local pAll = playersAlive + playersDead;

local checkYourPos = pAll - playersDead;

local pos = nil;

if tonumber ( checkYourPos ) == 1 then pos = 1 ; end

if tonumber ( checkYourPos ) == 2 then pos = 2; end

if pos == 1 or pos == 21 or pos == 31 then

posName = "st";

elseif pos == 2 or pos == 22 or pos == 32 then

posName = "nd";

elseif pos == 3 or pos == 23 or pos == 33 then

posName = "rd";



else

posName = "th";

end

if not getElementData ( source, "gotMoney" ) then

local money = math.ceil ( getPlayerCount ( ) * 50 / pos );

givePlayerMoney ( source, money );

outputChatBox ( "* You were #abcdef[#ff0000" .. pos .. posName .. "#abcdef]#ffffff and #abcdefearned #ffffff" .. money .. "#00ff00$!", source, 255, 255, 255, true );

setElementData ( source, "gotMoney", true );

if account then

setAccountData ( account, "money", tostring ( getPlayerMoney ( source ) ) );



end

end

end

addEventHandler ( "onPlayerWasted", root , giveMoneyWinDie )

جرب ... 

تغير الموقع كتيير !!

Edited by iMr.WiFi..!
Link to comment
51 minutes ago, Master_MTA said:

مود يعطي لاعب فلوس لما يفوز بسيرفر شوتر على حسب مرتبته

 

الكود كامل


function sortCompareFunction ( s1, s2 )
	if type ( s1 ) == "table" and type ( s2 ) == "table" then
		s1, s2 = s1.name, s2.name;
	end
    s1, s2 = s1:lower ( ), s2:lower( );
    if s1 == s2 then
        return false
    end
    local byte1, byte2 = string.byte ( s1:sub ( 1, 1 ) ), string.byte ( s2:sub ( 1, 1 ) );
    if not byte1 then
        return true
    elseif not byte2 then
        return false
    elseif byte1 < byte2 then
        return true
    elseif byte1 == byte2 then
        return sortCompareFunction ( s1:sub ( 2 ), s2:sub ( 2 ) );
    else
        return false
    end
end

function getAliveGuys ( mode )
	if not mode then return end
	pAlive = { };
	for _, player in ipairs ( getElementsByType ( "player" ) ) do
		if ( getElementData ( player, "state" ) == "alive" ) then
			table.insert ( pAlive, player );
		end
	end	
	if mode == 1 then
		return pAlive;
	elseif mode == 2 then
		return #pAlive;
	elseif mode == 3 then
		if pAlive then
			pAlive = nil;
		end
		return false
	end
end

function getDeadGuys ( )
	local pDead = 0
	for _, player in ipairs ( getElementsByType ( "player" ) ) do
		if getElementData ( player, "state" ) == "dead" then
			pDead = pDead + 1;
		end
	end
	return pDead;
end

function giveMoneyWinDie ( )
	local account = getPlayerAccount ( source );
	local playersAlive = getAliveGuys ( 2 );
	local playersDead = getDeadGuys ( );
	local pAll = playersAlive + playersDead;
	local checkYourPos = pAll - playersDead;
	local pos = nil;
	if tonumber ( checkYourPos ) == 1 then pos = 1 else pos = checkYourPos+1 ; end
	if tonumber ( checkYourPos ) == 2 then pos = 2; end
	if pos == 1 or pos == 21 or pos == 31 then
		posName = "st";
	elseif pos == 2 or pos == 22 or pos == 32 then
		posName = "nd";
	elseif pos == 3 or pos == 23 or pos == 33 then
		posName = "rd";
	
	else
		posName = "th";
	end
	if not getElementData ( source, "gotMoney" ) then
		local money = math.ceil ( getPlayerCount ( ) * 50 / pos );
		givePlayerMoney ( source, money );
		outputChatBox ( "* You were #abcdef[#ff0000" .. pos .. posName .. "#abcdef]#ffffff and #abcdefearned #ffffff" .. money .. "#00ff00$!", source, 255, 255, 255, true );
		setElementData ( source, "gotMoney", true );
		if account then
			setAccountData ( account, "money", tostring ( getPlayerMoney ( source ) ) );
			
		end
	end
end
addEventHandler ( "onPlayerWasted", root , giveMoneyWinDie )

 

ما زبط عرفت الاتاكر برضو ما زبط

Link to comment
function sortCompareFunction ( s1, s2 )
	if type ( s1 ) == "table" and type ( s2 ) == "table" then
		s1, s2 = s1.name, s2.name;
	end
    s1, s2 = s1:lower ( ), s2:lower( );
    if s1 == s2 then
        return false
    end
    local byte1, byte2 = string.byte ( s1:sub ( 1, 1 ) ), string.byte ( s2:sub ( 1, 1 ) );
    if not byte1 then
        return true
    elseif not byte2 then
        return false
    elseif byte1 < byte2 then
        return true
    elseif byte1 == byte2 then
        return sortCompareFunction ( s1:sub ( 2 ), s2:sub ( 2 ) );
    else
        return false
    end
end

function getAliveGuys ( mode )
	if not mode then return end
	pAlive = { };
	for _, player in ipairs ( getElementsByType ( "player" ) ) do
		if ( getElementData ( player, "state" ) == "alive" ) then
			table.insert ( pAlive, player );
		end
	end	
	if mode == 1 then
		return pAlive;
	elseif mode == 2 then
		return #pAlive;
	elseif mode == 3 then
		if pAlive then
			pAlive = nil;
		end
		return false
	end
end

function getDeadGuys ( )
	local pDead = 0
	for _, player in ipairs ( getElementsByType ( "player" ) ) do
		if getElementData ( player, "state" ) == "dead" then
			pDead = pDead + 1;
		end
	end
	return pDead;
end

function giveMoneyWinDie ( )
	local account = getPlayerAccount ( source );
	local playersAlive = getAliveGuys ( 2 );
	local playersDead = getDeadGuys ( );
	local pAll = playersAlive + playersDead;
	local checkYourPos = pAll - playersDead;
	local pos = nil;
	if tonumber ( checkYourPos ) == 1 then pos = 1; end --  else pos = checkYourPos+1  انا اشوف هنا انه راح يزيد واحد ويخلي الثاني ,,فحذفته
	if tonumber ( checkYourPos ) == 2 then pos = 2; end
	if pos == 1 or pos == 21 or pos == 31 then
		posName = "st";
	elseif pos == 2 or pos == 22 or pos == 32 then
		posName = "nd";
	elseif pos == 3 or pos == 23 or pos == 33 then
		posName = "rd";
	
	else
		posName = "th";
	end
	if not getElementData ( source, "gotMoney" ) then
		local money = math.ceil ( getPlayerCount ( ) * 50 / pos );
		givePlayerMoney ( source, money );
		outputChatBox ( "* You were #abcdef[#ff0000" .. pos .. posName .. "#abcdef]#ffffff and #abcdefearned #ffffff" .. money .. "#00ff00$!", source, 255, 255, 255, true );
		setElementData ( source, "gotMoney", true );
		if account then
			setAccountData ( account, "money", tostring ( getPlayerMoney ( source ) ) );
			
		end
	end
end
addEventHandler ( "onPlayerWasted", root , giveMoneyWinDie )

 

Link to comment
On ١‏/١١‏/٢٠١٦ at 9:16 PM, iMr.WiFi..! said:

function sortCompareFunction ( s1, s2 )
	if type ( s1 ) == "table" and type ( s2 ) == "table" then
		s1, s2 = s1.name, s2.name;
	end
    s1, s2 = s1:lower ( ), s2:lower( );
    if s1 == s2 then
        return false
    end
    local byte1, byte2 = string.byte ( s1:sub ( 1, 1 ) ), string.byte ( s2:sub ( 1, 1 ) );
    if not byte1 then
        return true
    elseif not byte2 then
        return false
    elseif byte1 < byte2 then
        return true
    elseif byte1 == byte2 then
        return sortCompareFunction ( s1:sub ( 2 ), s2:sub ( 2 ) );
    else
        return false
    end
end

function getAliveGuys ( mode )
	if not mode then return end
	pAlive = { };
	for _, player in ipairs ( getElementsByType ( "player" ) ) do
		if ( getElementData ( player, "state" ) == "alive" ) then
			table.insert ( pAlive, player );
		end
	end	
	if mode == 1 then
		return pAlive;
	elseif mode == 2 then
		return #pAlive;
	elseif mode == 3 then
		if pAlive then
			pAlive = nil;
		end
		return false
	end
end

function getDeadGuys ( )
	local pDead = 0
	for _, player in ipairs ( getElementsByType ( "player" ) ) do
		if getElementData ( player, "state" ) == "dead" then
			pDead = pDead + 1;
		end
	end
	return pDead;
end

function giveMoneyWinDie ( )
	local account = getPlayerAccount ( source );
	local playersAlive = getAliveGuys ( 2 );
	local playersDead = getDeadGuys ( );
	local pAll = playersAlive + playersDead;
	local checkYourPos = pAll - playersDead;
	local pos = nil;
	if tonumber ( checkYourPos ) == 1 then pos = 1; end --  else pos = checkYourPos+1  انا اشوف هنا انه راح يزيد واحد ويخلي الثاني ,,فحذفته
	if tonumber ( checkYourPos ) == 2 then pos = 2; end
	if pos == 1 or pos == 21 or pos == 31 then
		posName = "st";
	elseif pos == 2 or pos == 22 or pos == 32 then
		posName = "nd";
	elseif pos == 3 or pos == 23 or pos == 33 then
		posName = "rd";
	
	else
		posName = "th";
	end
	if not getElementData ( source, "gotMoney" ) then
		local money = math.ceil ( getPlayerCount ( ) * 50 / pos );
		givePlayerMoney ( source, money );
		outputChatBox ( "* You were #abcdef[#ff0000" .. pos .. posName .. "#abcdef]#ffffff and #abcdefearned #ffffff" .. money .. "#00ff00$!", source, 255, 255, 255, true );
		setElementData ( source, "gotMoney", true );
		if account then
			setAccountData ( account, "money", tostring ( getPlayerMoney ( source ) ) );
			
		end
	end
end
addEventHandler ( "onPlayerWasted", root , giveMoneyWinDie )

 

اخي خطا

#Edit:

شباب للان مافي رد

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