Jump to content

مشكلة في لوحة الادمنية


Recommended Posts

addEvent ( "aServer", true ) 
addEventHandler ( "aServer", _root, function ( action, data, data2 ) 
    if checkClient( "command."..action, source, 'aServer', action ) then return end 
    if ( hasObjectPermissionTo ( source, "command."..action ) ) then 
        local mdata = tostring ( data ) 
        local mdata2 = "" 
        if ( action == "setgame" ) then 
            if ( not setGameType ( tostring ( data ) ) ) then 
                action = nil 
                exports["topbarchat"]:sendClientMessage ( "Error setting game type.", source, 255, 0, 0 ) 
            end 
            triggerEvent ( "aSync", source, "server" ) 
        elseif ( action == "setmap" ) then 
            if ( not setMapName ( tostring ( data ) ) ) then 
                action = nil 
                exports["topbarchat"]:sendClientMessage ( "Error setting map name.", source, 255, 0, 0 ) 
            end 
            triggerEvent ( "aSync", source, "server" ) 
        elseif ( action == "setwelcome" ) then 
            if ( ( not data ) or ( data == "" ) ) then 
                action = "resetwelcome" 
                aRemoveSetting ( "welcome" ) 
            else 
                aSetSetting ( "welcome", tostring ( data ) ) 
                mdata = data 
            end 
        elseif ( action == "settime" ) then 
            if ( not setTime ( tonumber ( data ), tonumber ( data2 ) ) ) then 
                action = nil 
                exports["topbarchat"]:sendClientMessage ( "Error setting time.", source, 255, 0, 0 ) 
            end 
            mdata = data..":"..data2 
        elseif ( action == "shutdown" ) then 
            setTimer(shutdown, 2000, 1, data) 
        elseif ( action == "setpassword" ) then 
            if ( not data or data == "" ) then 
                setServerPassword ( nil ) 
                action = "resetpassword" 
            elseif ( string.len ( data ) > 32 ) then 
                exports["topbarchat"]:sendClientMessage ( "Set password: 32 characters max", source, 255, 0, 0 ) 
            elseif ( not setServerPassword ( data ) ) then 
                action = nil 
                exports["topbarchat"]:sendClientMessage ( "Error setting password", source, 255, 0, 0 ) 
            end 
            triggerEvent ( "aSync", source, "server" ) 
        elseif ( action == "setweather" ) then 
            if ( not setWeather ( tonumber ( data ) ) ) then 
                action = nil 
                exports["topbarchat"]:sendClientMessage ( "Error setting weather.", source, 255, 0, 0 ) 
            end 
            mdata = data.." "..getWeatherNameFromID ( tonumber ( data ) ) 
        elseif ( action == "blendweather" ) then 
            if ( not setWeatherBlended ( tonumber ( data ) ) ) then 
                action = nil 
                exports["topbarchat"]:sendClientMessage ( "Error setting weather.", source, 255, 0, 0 ) 
            end 
        elseif ( action == "setgamespeed" ) then 
            if ( not setGameSpeed ( tonumber ( data ) ) ) then 
                action = nil 
                exports["topbarchat"]:sendClientMessage ( "Error setting game speed.", source, 255, 0, 0 ) 
            end 
        elseif ( action == "setgravity" ) then 
            if ( setGravity ( tonumber ( data ) ) ) then 
                for id, player in ipairs ( getElementsByType ( "player" ) ) do 
                    setPedGravity ( player, getGravity() ) 
                end 
            else 
                action = nil 
                exports["topbarchat"]:sendClientMessage ( "Error setting gravity.", source, 255, 0, 0 ) 
            end 
        elseif ( action == "setwaveheight" ) then 
            if ( not setWaveHeight ( data ) ) then 
                exports["topbarchat"]:sendClientMessage ( "Error setting wave height.", source, 255, 0, 0 ) 
                action = nil 
            else 
                mdata = data 
            end 
        elseif ( action == "setfpslimit" ) then 
            if ( not setFPSLimit ( tonumber ( data ) ) ) then 
                action = nil 
                exports["topbarchat"]:sendClientMessage ( "Error setting FPS Limit.", source, 255, 0, 0 ) 
            end 
        else 
            action = nil 
        end 
        if ( action ~= nil ) then aAction ( "server", action, source, false, mdata, mdata2 ) end 
        return true 
    end 
    exports["topbarchat"]:sendClientMessage ( "Access denied for '"..tostring ( action ).."'", source, 255, 168, 0 ) 
    return false 
end ) 

مااقدر اشيل الباس يكتب

password has been reset بس ما يصير شيئ

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