Jump to content

مساعدة بـ تصحيح الاكواد


Recommended Posts

السلام عليكم ورحمة الله وبركاته .

شخباركم ؟ عساكم طيبين , عندي مشكلة بـ مود * الساعات * وهي أن لو واحد بياخذ التوزيع يجيبه أنه اخذه قبل ! وهو م أستلم التوزيع + فيكم كم خطاء للحين مب عارفهم , هاذي الاكواد .. الي يعرف يحل المشكلة يساعدني , والله يعطيه الف عافية ..

 

exports.scoreboard:addScoreboardColumn('PlayTime')

local t = { }
local Groups = { "Console", "a" }

function isPlayerAdmin(player)
    for k,v in ipairs ( Groups ) do
        if ( isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(player)), aclGetGroup(v)) ) then
		    return true
		end
	end
end

function checkValues( source,arg1,arg2)
    if (arg2 >= 60) then
        t[ source ][ 'min' ] = tonumber( t[ source ][ 'min' ] or 0 ) + 1
        t[ source ][ 'sec' ] = 0
    end
    if (arg1 >= 60) then
        t[ source ][ 'min' ] = 0
        t[ source ][ 'hour' ] = tonumber( t[ source ][ 'hour' ] or 0 ) + 1
    end
    return arg1, arg2
end

setTimer(
    function( )
        for _, v in pairs( getElementsByType( "player" ) ) do
            if (not t[ v ]) then
                t[ v ] = {
                            ["hour"] = 0,
                             ["min"] = 0,
                             ["sec"] = 0
                            }
            end

            t[ v ][ 'sec' ] = tonumber( t[ v ][ 'sec' ] or 0 ) + 1
            local min,sec = checkValues (
                    v,
                    t[ v ][ 'min' ] or 0,
                    t[ v ][ 'sec' ] or 0
						)
	local hour = tonumber( t[ v ][ 'hour' ] or 0 )

            setElementData(
                v,
                "PlayTime",
                tostring( hour )..':'..tostring( min )..':'..tostring( sec )
            )
        end
    end,
    1000, 0
)

function onPlayerQuit ( )
    local playeraccount = getPlayerAccount ( source )
    if ( playeraccount ) and not isGuestAccount ( playeraccount ) then
        local sValue = getElementData( source,'PlayTime' )
	local hour = tonumber( t[ source ][ 'hour' ] or 0 )
	local min = tonumber( t[ source ][ 'min' ] or 0 )
	local sec = tonumber( t[ source ][ 'sec' ] or 0 )
        setAccountData ( playeraccount, "PlayTime-hour", tostring(hour) )
        setAccountData ( playeraccount, "PlayTime-min", tostring(min) )
        setAccountData ( playeraccount, "PlayTime-sec", tostring(sec) )
        setAccountData ( playeraccount, "PlayTime", tostring(sValue) )
        local row = executeSQLQuery ( "SELECT * FROM TopTime WHERE serial = ?", getPlayerSerial ( source ) )
	    if ( #row ~= 0 ) then
		    executeSQLQuery("UPDATE TopTime SET hour = ?, min = ?, scou = ? WHERE serial = ?", tostring ( t [ source ] [ "hour" ] ), tostring ( t [ source ] [ "min" ] ), tostring ( t [ source ] [ "sec" ] ), tostring ( getPlayerSerial ( source ) ) )
	    end
    end
    t[ source ] = nil
end

function onPlayerLogin (_, playeraccount )
    if ( playeraccount ) then
        local time = getAccountData ( playeraccount, "PlayTime" )
	    local hou = getAccountData ( playeraccount, "PlayTime-hour")
	    local min = getAccountData ( playeraccount, "PlayTime-min")
	    local sec = getAccountData ( playeraccount, "PlayTime-sec")
        if ( time ) then
            setElementData ( source, "PlayTime", time )
            t[ source ]["hour"] = tonumber(hou)
            t[ source ]["min"] = tonumber(min)
            t[ source ]["sec"] = tonumber(sec)
        else
            setElementData ( source, "PlayTime",0 )
            setAccountData ( playeraccount, "PlayTime",0 )
			t[ source ]["hour"] = 0
            t[ source ]["min"] = 0
            t[ source ]["sec"] = 0
        end
    end
end
addEventHandler ( "onPlayerQuit", root, onPlayerQuit )
addEventHandler ( "onPlayerLogin", root, onPlayerLogin )

addEventHandler ( "onPlayerLogout", root, function ( acc )
    local sValue = getElementData( source,'PlayTime' )
	local hour = tonumber( t[ source ][ 'hour' ] or 0 )
	local min = tonumber( t[ source ][ 'min' ] or 0 )
	local sec = tonumber( t[ source ][ 'sec' ] or 0 )
    setAccountData ( acc, "PlayTime-hour", tostring(hour) )
    setAccountData ( acc, "PlayTime-min", tostring(min) )
    setAccountData ( acc, "PlayTime-sec", tostring(sec) )
    setAccountData ( acc, "PlayTime", tostring(sValue) )
	local row = executeSQLQuery ( "SELECT * FROM TopTime WHERE serial = ?", getPlayerSerial ( source ) )
	if ( #row ~= 0 ) then
		executeSQLQuery("UPDATE TopTime SET hour = ?, min = ?, scou = ? WHERE serial = ?", tostring ( t [ source ] [ "hour" ] ), tostring ( t [ source ] [ "min" ] ), tostring ( t [ source ] [ "sec" ] ), tostring ( getPlayerSerial ( source ) ) )
	end
    t[ source ]["hour"] = 0
    t[ source ]["min"] = 0
    t[ source ]["sec"] = 0
end )

addEventHandler("onResourceStart", resourceRoot, function ()
    for k,v in ipairs ( getElementsByType ( "player" ) ) do
	    if not ( isGuestAccount ( getPlayerAccount ( v ) ) ) then
		    if ( getAccountData ( getPlayerAccount ( v ), "PlayTime" ) ) then
			    local hou = getAccountData ( getPlayerAccount ( v ), "PlayTime-hour")
	            local min = getAccountData ( getPlayerAccount ( v ), "PlayTime-min")
	            local sec = getAccountData ( getPlayerAccount ( v ), "PlayTime-sec")
				if not ( t [ v ] ) then 
				    t[ v ] = {
                        ["hour"] = 0,
                        ["min"] = 0,
                        ["sec"] = 0
                    }
				end
				t[ v ]["hour"] = tonumber(hou)
            	t[ v ]["min"] = tonumber(min)
            	t[ v ]["sec"] = tonumber(sec)
			end
		end
	end
end)

addEventHandler("onResourceStop", resourceRoot, function ()
    for k,v in ipairs ( getElementsByType ( "player" ) ) do
	    if not ( isGuestAccount ( getPlayerAccount ( v ) ) ) then
            local sValue = getElementData( v,'PlayTime' )
	        local hour = tonumber( t[ v ][ 'hour' ] or 0 )
	        local min = tonumber( t[ v ][ 'min' ] or 0 )
	        local sec = tonumber( t[ v ][ 'sec' ] or 0 )
            setAccountData ( getPlayerAccount ( v ), "PlayTime-hour", tostring(hour) )
            setAccountData ( getPlayerAccount ( v ), "PlayTime-min", tostring(min) )
            setAccountData ( getPlayerAccount ( v ), "PlayTime-sec", tostring(sec) )
            setAccountData ( getPlayerAccount ( v ), "PlayTime", tostring(sValue) )
			local row = executeSQLQuery ( "SELECT * FROM TopTime WHERE serial = ?", getPlayerSerial ( v ) )
			if ( #row ~= 0 ) then
				executeSQLQuery("UPDATE TopTime SET hour = ?, min = ?, scou = ? WHERE serial = ?", tostring ( t [ v ] [ "hour" ] ), tostring ( t [ v ] [ "min" ] ), tostring ( t [ v ] [ "sec" ] ), tostring ( getPlayerSerial ( v ) ) )
			end
		end
	end
end)

function setPlayerTime ( Player, Type, Hour )
	if ( Type == "-" ) then
	    t[ Player ][ "hour" ] = t [ Player ][ "hour" ] - tonumber ( Hour )
	else
	    t[ Player ][ "hour" ] = t [ Player ][ "hour" ] + tonumber ( Hour )
	end
end

function getPlayerHours ( Player )
    return t [ Player ][ "hour" ] or 0
end

addCommandHandler("giveTimeacc", function ( player, _, accname, time )
    if ( accname ) then
        if ( time ) then
	        if ( tonumber ( time ) <= 9000 ) then
		        if not ( isGuestAccount ( getPlayerAccount ( player ) ) ) then
			        if ( isPlayerAdmin ( player ) ) then
				        if ( getAccount ( tostring ( accname ) ) ) then
						    setAccountData ( getAccount ( tostring ( accname ) ), "PlayTime-hour", tostring ( time ) )
							for k,v in ipairs ( getElementsByType("player") ) do
							    if not ( isGuestAccount ( getPlayerAccount ( v ) ) ) then
								    if ( getAccountName ( getPlayerAccount ( v ) ) == tostring ( accname ) ) then
									    t [ v ] [ "hour" ] = tonumber ( time )
									end
								end
							end
							outputChatBox("* ok", player, 255, 255, 0, true)
						else
						    outputChatBox("* No Account With This Name !", player, 255, 0, 0, true)
						end
					else
					    outputChatBox("* You Are Not Admin !", player, 255, 0, 0, true)
					end
				else
				    outputChatBox("* Please Login To Use This Command !", player, 255, 0, 0, true)
				end
			else
			    outputChatBox("* U Can't Give Time More 100 Hour !", player, 255, 0, 0, true)
			end
		else
		    outputChatBox("* Please Write a Hour !", player, 255, 0, 0, true)
		end
	else
	    outputChatBox("* Please Write Name of Account !", player, 255, 0, 0, true)
	end
end)

addCommandHandler("TimeF", function ( player, _, enable, time )
    if ( enable ) then
	    if ( time ) then
		    if ( tonumber ( time ) <= 100 ) then
                if not ( isGuestAccount ( getPlayerAccount ( player ) ) ) then
	                if ( isPlayerAdmin ( player ) ) then
		                if ( enable == "true" ) then
		                    if ( getElementData ( resourceRoot, "enabledTwaged" ) == true ) then
			                    for k,v in ipairs ( getAccounts () ) do
						            setAccountData ( v, "getatime", false )
					            end
								setElementData ( resourceRoot, "hoursTwaged", tonumber ( time ) )
								outputChatBox ("* Ok !", player, 255, 255, 0, true)
							else
							    setElementData ( resourceRoot, "enabledTwaged", true )
								 for k,v in ipairs ( getAccounts () ) do
						            setAccountData ( v, "getatime", false )
					            end
								setElementData ( resourceRoot, "hoursTwaged", tonumber ( time ) )
								outputChatBox ("* Ok !", player, 255, 255, 0, true)
							end
						else
						    setElementData ( resourceRoot, "enabledTwaged", false )
						end
					else
					    outputChatBox("* You Are Not Admin !", player, 255, 0, 0, true)
					end
				else
				    outputChatBox("* Please Login To Use This Command !", player, 255, 0, 0, true)
				end
			else
			    outputChatBox("* U Can't Give Time More 100 Hour !", player, 255, 0, 0, true)
			end
		else
		    outputChatBox("* Please Write a Hours !", player, 255, 0, 0, true)
		end
	else
	    outputChatBox("* Please Write a Type of Give Time !", player, 255, 0, 0, true)
	end
end)

addCommandHandler("تواجد", function ( player )
    if not ( isGuestAccount ( getPlayerAccount ( player ) ) ) then
	    if ( getAccountData ( getPlayerAccount ( player ), "getatime" ) == false ) then
		    if ( getElementData ( resourceRoot, "enabledTwaged" ) == true ) then
			    setPlayerTime ( player, "+", getElementData ( resourceRoot, "hoursTwaged" ) )
				setAccountData ( getPlayerAccount ( player ), "getatime", true )
				outputChatBox("* You Have Been Get " .. getElementData ( resourceRoot, "hoursTwaged" ) .." Hours !", player, 255, 255, 0, true)
			else
			    outputChatBox("* This Command Not Enabled !", player, 255, 0, 0, true)
			end
		else
		    outputChatBox("* You Already Use This Command !", player, 255, 0, 0, true)
		end
	else
	    outputChatBox("* Please Register To Use This Command !", player, 255, 0, 0, true)
	end
end)

 

Edited by Sk2rEz
Link to comment
14 minutes ago, Sk2rEz said:

السلام عليكم ورحمة الله وبركاته .

شخباركم ؟ عساكم طيبين , عندي مشكلة بـ مود * الساعات * وهي أن لو واحد بياخذ التوزيع يجيبه أنه اخذه قبل ! وهو م أستلم التوزيع + فيكم كم خطاء للحين مب عارفهم , هاذي الاكواد .. الي يعرف يحل المشكلة يساعدني , والله يعطيه الف عافية ..

 


exports.scoreboard:addScoreboardColumn('PlayTime')

local t = { }
local Groups = { "Console", "a" }

function isPlayerAdmin(player)
    for k,v in ipairs ( Groups ) do
        if ( isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(player)), aclGetGroup(v)) ) then
		    return true
		end
	end
end

function checkValues( source,arg1,arg2)
    if (arg2 >= 60) then
        t[ source ][ 'min' ] = tonumber( t[ source ][ 'min' ] or 0 ) + 1
        t[ source ][ 'sec' ] = 0
    end
    if (arg1 >= 60) then
        t[ source ][ 'min' ] = 0
        t[ source ][ 'hour' ] = tonumber( t[ source ][ 'hour' ] or 0 ) + 1
    end
    return arg1, arg2
end

setTimer(
    function( )
        for _, v in pairs( getElementsByType( "player" ) ) do
            if (not t[ v ]) then
                t[ v ] = {
                            ["hour"] = 0,
                             ["min"] = 0,
                             ["sec"] = 0
                            }
            end

            t[ v ][ 'sec' ] = tonumber( t[ v ][ 'sec' ] or 0 ) + 1
            local min,sec = checkValues (
                    v,
                    t[ v ][ 'min' ] or 0,
                    t[ v ][ 'sec' ] or 0
						)
	local hour = tonumber( t[ v ][ 'hour' ] or 0 )

            setElementData(
                v,
                "PlayTime",
                tostring( hour )..':'..tostring( min )..':'..tostring( sec )
            )
        end
    end,
    1000, 0
)

function onPlayerQuit ( )
    local playeraccount = getPlayerAccount ( source )
    if ( playeraccount ) and not isGuestAccount ( playeraccount ) then
        local sValue = getElementData( source,'PlayTime' )
	local hour = tonumber( t[ source ][ 'hour' ] or 0 )
	local min = tonumber( t[ source ][ 'min' ] or 0 )
	local sec = tonumber( t[ source ][ 'sec' ] or 0 )
        setAccountData ( playeraccount, "PlayTime-hour", tostring(hour) )
        setAccountData ( playeraccount, "PlayTime-min", tostring(min) )
        setAccountData ( playeraccount, "PlayTime-sec", tostring(sec) )
        setAccountData ( playeraccount, "PlayTime", tostring(sValue) )
        local row = executeSQLQuery ( "SELECT * FROM TopTime WHERE serial = ?", getPlayerSerial ( source ) )
	    if ( #row ~= 0 ) then
		    executeSQLQuery("UPDATE TopTime SET hour = ?, min = ?, scou = ? WHERE serial = ?", tostring ( t [ source ] [ "hour" ] ), tostring ( t [ source ] [ "min" ] ), tostring ( t [ source ] [ "sec" ] ), tostring ( getPlayerSerial ( source ) ) )
	    end
    end
    t[ source ] = nil
end

function onPlayerLogin (_, playeraccount )
    if ( playeraccount ) then
        local time = getAccountData ( playeraccount, "PlayTime" )
	    local hou = getAccountData ( playeraccount, "PlayTime-hour")
	    local min = getAccountData ( playeraccount, "PlayTime-min")
	    local sec = getAccountData ( playeraccount, "PlayTime-sec")
        if ( time ) then
            setElementData ( source, "PlayTime", time )
            t[ source ]["hour"] = tonumber(hou)
            t[ source ]["min"] = tonumber(min)
            t[ source ]["sec"] = tonumber(sec)
        else
            setElementData ( source, "PlayTime",0 )
            setAccountData ( playeraccount, "PlayTime",0 )
			t[ source ]["hour"] = 0
            t[ source ]["min"] = 0
            t[ source ]["sec"] = 0
        end
    end
end
addEventHandler ( "onPlayerQuit", root, onPlayerQuit )
addEventHandler ( "onPlayerLogin", root, onPlayerLogin )

addEventHandler ( "onPlayerLogout", root, function ( acc )
    local sValue = getElementData( source,'PlayTime' )
	local hour = tonumber( t[ source ][ 'hour' ] or 0 )
	local min = tonumber( t[ source ][ 'min' ] or 0 )
	local sec = tonumber( t[ source ][ 'sec' ] or 0 )
    setAccountData ( acc, "PlayTime-hour", tostring(hour) )
    setAccountData ( acc, "PlayTime-min", tostring(min) )
    setAccountData ( acc, "PlayTime-sec", tostring(sec) )
    setAccountData ( acc, "PlayTime", tostring(sValue) )
	local row = executeSQLQuery ( "SELECT * FROM TopTime WHERE serial = ?", getPlayerSerial ( source ) )
	if ( #row ~= 0 ) then
		executeSQLQuery("UPDATE TopTime SET hour = ?, min = ?, scou = ? WHERE serial = ?", tostring ( t [ source ] [ "hour" ] ), tostring ( t [ source ] [ "min" ] ), tostring ( t [ source ] [ "sec" ] ), tostring ( getPlayerSerial ( source ) ) )
	end
    t[ source ]["hour"] = 0
    t[ source ]["min"] = 0
    t[ source ]["sec"] = 0
end )

addEventHandler("onResourceStart", resourceRoot, function ()
    for k,v in ipairs ( getElementsByType ( "player" ) ) do
	    if not ( isGuestAccount ( getPlayerAccount ( v ) ) ) then
		    if ( getAccountData ( getPlayerAccount ( v ), "PlayTime" ) ) then
			    local hou = getAccountData ( getPlayerAccount ( v ), "PlayTime-hour")
	            local min = getAccountData ( getPlayerAccount ( v ), "PlayTime-min")
	            local sec = getAccountData ( getPlayerAccount ( v ), "PlayTime-sec")
				if not ( t [ v ] ) then 
				    t[ v ] = {
                        ["hour"] = 0,
                        ["min"] = 0,
                        ["sec"] = 0
                    }
				end
				t[ v ]["hour"] = tonumber(hou)
            	t[ v ]["min"] = tonumber(min)
            	t[ v ]["sec"] = tonumber(sec)
			end
		end
	end
end)

addEventHandler("onResourceStop", resourceRoot, function ()
    for k,v in ipairs ( getElementsByType ( "player" ) ) do
	    if not ( isGuestAccount ( getPlayerAccount ( v ) ) ) then
            local sValue = getElementData( v,'PlayTime' )
	        local hour = tonumber( t[ v ][ 'hour' ] or 0 )
	        local min = tonumber( t[ v ][ 'min' ] or 0 )
	        local sec = tonumber( t[ v ][ 'sec' ] or 0 )
            setAccountData ( getPlayerAccount ( v ), "PlayTime-hour", tostring(hour) )
            setAccountData ( getPlayerAccount ( v ), "PlayTime-min", tostring(min) )
            setAccountData ( getPlayerAccount ( v ), "PlayTime-sec", tostring(sec) )
            setAccountData ( getPlayerAccount ( v ), "PlayTime", tostring(sValue) )
			local row = executeSQLQuery ( "SELECT * FROM TopTime WHERE serial = ?", getPlayerSerial ( v ) )
			if ( #row ~= 0 ) then
				executeSQLQuery("UPDATE TopTime SET hour = ?, min = ?, scou = ? WHERE serial = ?", tostring ( t [ v ] [ "hour" ] ), tostring ( t [ v ] [ "min" ] ), tostring ( t [ v ] [ "sec" ] ), tostring ( getPlayerSerial ( v ) ) )
			end
		end
	end
end)

function setPlayerTime ( Player, Type, Hour )
	if ( Type == "-" ) then
	    t[ Player ][ "hour" ] = t [ Player ][ "hour" ] - tonumber ( Hour )
	else
	    t[ Player ][ "hour" ] = t [ Player ][ "hour" ] + tonumber ( Hour )
	end
end

function getPlayerHours ( Player )
    return t [ Player ][ "hour" ] or 0
end

addCommandHandler("giveTimeacc", function ( player, _, accname, time )
    if ( accname ) then
        if ( time ) then
	        if ( tonumber ( time ) <= 9000 ) then
		        if not ( isGuestAccount ( getPlayerAccount ( player ) ) ) then
			        if ( isPlayerAdmin ( player ) ) then
				        if ( getAccount ( tostring ( accname ) ) ) then
						    setAccountData ( getAccount ( tostring ( accname ) ), "PlayTime-hour", tostring ( time ) )
							for k,v in ipairs ( getElementsByType("player") ) do
							    if not ( isGuestAccount ( getPlayerAccount ( v ) ) ) then
								    if ( getAccountName ( getPlayerAccount ( v ) ) == tostring ( accname ) ) then
									    t [ v ] [ "hour" ] = tonumber ( time )
									end
								end
							end
							outputChatBox("* ok", player, 255, 255, 0, true)
						else
						    outputChatBox("* No Account With This Name !", player, 255, 0, 0, true)
						end
					else
					    outputChatBox("* You Are Not Admin !", player, 255, 0, 0, true)
					end
				else
				    outputChatBox("* Please Login To Use This Command !", player, 255, 0, 0, true)
				end
			else
			    outputChatBox("* U Can't Give Time More 100 Hour !", player, 255, 0, 0, true)
			end
		else
		    outputChatBox("* Please Write a Hour !", player, 255, 0, 0, true)
		end
	else
	    outputChatBox("* Please Write Name of Account !", player, 255, 0, 0, true)
	end
end)

addCommandHandler("TimeF", function ( player, _, enable, time )
    if ( enable ) then
	    if ( time ) then
		    if ( tonumber ( time ) <= 100 ) then
                if not ( isGuestAccount ( getPlayerAccount ( player ) ) ) then
	                if ( isPlayerAdmin ( player ) ) then
		                if ( enable == "true" ) then
		                    if ( getElementData ( resourceRoot, "enabledTwaged" ) == true ) then
			                    for k,v in ipairs ( getAccounts () ) do
						            setAccountData ( v, "getatime", false )
					            end
								setElementData ( resourceRoot, "hoursTwaged", tonumber ( time ) )
								outputChatBox ("* Ok !", player, 255, 255, 0, true)
							else
							    setElementData ( resourceRoot, "enabledTwaged", true )
								 for k,v in ipairs ( getAccounts () ) do
						            setAccountData ( v, "getatime", false )
					            end
								setElementData ( resourceRoot, "hoursTwaged", tonumber ( time ) )
								outputChatBox ("* Ok !", player, 255, 255, 0, true)
							end
						else
						    setElementData ( resourceRoot, "enabledTwaged", false )
						end
					else
					    outputChatBox("* You Are Not Admin !", player, 255, 0, 0, true)
					end
				else
				    outputChatBox("* Please Login To Use This Command !", player, 255, 0, 0, true)
				end
			else
			    outputChatBox("* U Can't Give Time More 100 Hour !", player, 255, 0, 0, true)
			end
		else
		    outputChatBox("* Please Write a Hours !", player, 255, 0, 0, true)
		end
	else
	    outputChatBox("* Please Write a Type of Give Time !", player, 255, 0, 0, true)
	end
end)

addCommandHandler("تواجد", function ( player )
    if not ( isGuestAccount ( getPlayerAccount ( player ) ) ) then
	    if ( getAccountData ( getPlayerAccount ( player ), "getatime" ) == false ) then
		    if ( getElementData ( resourceRoot, "enabledTwaged" ) == true ) then
			    setPlayerTime ( player, "+", getElementData ( resourceRoot, "hoursTwaged" ) )
				setAccountData ( getPlayerAccount ( player ), "getatime", true )
				outputChatBox("* You Have Been Get " .. getElementData ( resourceRoot, "hoursTwaged" ) .." Hours !", player, 255, 255, 0, true)
			else
			    outputChatBox("* This Command Not Enabled !", player, 255, 0, 0, true)
			end
		else
		    outputChatBox("* You Already Use This Command !", player, 255, 0, 0, true)
		end
	else
	    outputChatBox("* Please Register To Use This Command !", player, 255, 0, 0, true)
	end
end)

 

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

Link to comment
3 minutes ago, JustP said:

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

عشان أعرف وين الخطاء بـ الضبط .

 

 

addCommandHandler("تواجد", function ( player )
    if not ( isGuestAccount ( getPlayerAccount ( player ) ) ) then
	    if ( getAccountData ( getPlayerAccount ( player ), "getatime" ) == false ) then
		    if ( getElementData ( resourceRoot, "enabledTwaged" ) == true ) then
			    setPlayerTime ( player, "+", getElementData ( resourceRoot, "hoursTwaged" ) )
				setAccountData ( getPlayerAccount ( player ), "getatime", true )
				outputChatBox("* You Have Been Get " .. getElementData ( resourceRoot, "hoursTwaged" ) .." Hours !", player, 255, 255, 0, true)
			else
			    outputChatBox("* This Command Not Enabled !", player, 255, 0, 0, true)
			end
		else
		    outputChatBox("* You Already Use This Command !", player, 255, 0, 0, true)
		end
	else
	    outputChatBox("* Please Register To Use This Command !", player, 255, 0, 0, true)
	end
end)

 

Edited by Sk2rEz
Link to comment
1 minute ago, Sk2rEz said:

عشان أشوف وين الخطاء بـ الظبط .

 

 


addCommandHandler("تواجد", function ( player )    if not ( isGuestAccount ( getPlayerAccount ( player ) ) ) then	    if ( getAccountData ( getPlayerAccount ( player ), "getatime" ) == false ) then		    if ( getElementData ( resourceRoot, "enabledTwaged" ) == true ) then			    setPlayerTime ( player, "+", getElementData ( resourceRoot, "hoursTwaged" ) )				setAccountData ( getPlayerAccount ( player ), "getatime", true )				outputChatBox("* You Have Been Get " .. getElementData ( resourceRoot, "hoursTwaged" ) .." Hours !", player, 255, 255, 0, true)			else			    outputChatBox("* This Command Not Enabled !", player, 255, 0, 0, true)			end		else		    outputChatBox("* You Already Use This Command !", player, 255, 0, 0, true)		end	else	    outputChatBox("* Please Register To Use This Command !", player, 255, 0, 0, true)	endend)

 

جرب تغير اسم الداتا , احتمال انك مسوي توزيع من قبل والداتا باقية بالحساب

Link to comment
3 minutes ago, Sk2rEz said:

تقصد ؟ 

 


if ( getAccountData ( getPlayerAccount ( player ), "getatime" ) == false ) then

 

addCommandHandler("تواجد", function ( player )
    if not ( isGuestAccount ( getPlayerAccount ( player ) ) ) then
	    if ( getAccountData ( getPlayerAccount ( player ), "newdata" ) == false ) then
		    if ( getElementData ( resourceRoot, "enabledTwaged" ) == true ) then
			    setPlayerTime ( player, "+", getElementData ( resourceRoot, "hoursTwaged" ) )
				setAccountData ( getPlayerAccount ( player ), "newdata", true )
				outputChatBox("* You Have Been Get " .. getElementData ( resourceRoot, "hoursTwaged" ) .." Hours !", player, 255, 255, 0, true)
			else
			    outputChatBox("* This Command Not Enabled !", player, 255, 0, 0, true)
			end
		else
		    outputChatBox("* You Already Use This Command !", player, 255, 0, 0, true)
		end
	else
	    outputChatBox("* Please Register To Use This Command !", player, 255, 0, 0, true)
	end
end)

 

جرب هذا بيشتغل معك

Link to comment
34 minutes ago, JustP said:

addCommandHandler("تواجد", function ( player )
    if not ( isGuestAccount ( getPlayerAccount ( player ) ) ) then
	    if ( getAccountData ( getPlayerAccount ( player ), "newdata" ) == false ) then
		    if ( getElementData ( resourceRoot, "enabledTwaged" ) == true ) then
			    setPlayerTime ( player, "+", getElementData ( resourceRoot, "hoursTwaged" ) )
				setAccountData ( getPlayerAccount ( player ), "newdata", true )
				outputChatBox("* You Have Been Get " .. getElementData ( resourceRoot, "hoursTwaged" ) .." Hours !", player, 255, 255, 0, true)
			else
			    outputChatBox("* This Command Not Enabled !", player, 255, 0, 0, true)
			end
		else
		    outputChatBox("* You Already Use This Command !", player, 255, 0, 0, true)
		end
	else
	    outputChatBox("* Please Register To Use This Command !", player, 255, 0, 0, true)
	end
end)

 

جرب هذا بيشتغل معك

يعطيك العافية الكود شغال 

* You Have Been Get 50 Hours !
* You Have Been Get 50 Hours !
* You Have Been Get 50 Hours !
* You Have Been Get 50 Hours !
* You Have Been Get 50 Hours !
* You Have Been Get 50 Hours !

 

التوزيع ياخذونه أكثر من مره >> المود فيه لحسة مخ شوي ..

Edited by Sk2rEz
Link to comment
  • N3xT locked this topic
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...