Jump to content

Deadmau5

Members
  • Posts

    23
  • Joined

  • Last visited

Posts posted by Deadmau5

  1. You could for example do an easy achievement like "Getting Hunter on Vortex v11".

    So you go and check, where the player changes his vehicle by driving in an pickup.

    If the pickuptype is vehiclechange, continue and check if the vehiclemodel is a hunter.

    Then check, if the mapname contains vortex and v11 or something like that.

    Then set the achievement to 1 and give some money, for example.

  2. Subject says it all...

    local x, y = guiGetScreenSize () 
      
    local localPlayer = getLocalPlayer() 
      
    local spectators = {} 
      
    addEvent('addSpectator', true) 
    addEvent('removeSpectator', true) 
      
    addEventHandler('onClientResourceStart', root, 
        function() 
            triggerServerEvent ('addClient', localPlayer) 
             
            local screenWidth, screenHeight = guiGetScreenSize() 
            g_dxGUI = { 
                 
                spectators = dxText:create('Spectators:', 2, screenHeight - dxGetFontHeight(0.0, 'bankgothic')-40, false, 'default-bold', 1, 'left'), 
                spectatorsCount = dxText:create('0', 70, screenHeight - dxGetFontHeight(0.0, 'bankgothic')-40, false, 'default-bold', 1, 'left') 
            } 
            g_dxGUI.spectators:color(255, 128, 0, 255) 
            g_dxGUI.spectatorsCount:color(255, 255, 255, 255) 
        end 
    ) 
      
    addEventHandler('addSpectator', root, 
        function(spectator) 
            table.insert(spectators, spectator) 
        end 
    ) 
      
    addEventHandler('removeSpectator', root, 
        function(spectator) 
            for i, val in ipairs(spectators) do 
                if (val == spectator) then 
                    table.remove(spectators, i) 
                end 
            end 
        end 
    ) 
      
    function elementCheck (elem) 
        if elem then 
            if isElement (elem) then 
                if (getElementType (elem) == 'player') then 
                    return true 
                end 
            end 
        end 
        return false 
    end 
      
    function drawSpectators() 
        g_dxGUI.spectatorsCount:text(#spectators) 
    end 
    addEventHandler('onClientRender', root, drawSpectators) 
    

  3. So, I'm coding a command, that let's the current map play again.

    Now I want to make a new variable, that get's checked before g_ForcedNextMap....

    So, where can I find the g_ForceNextMap, where it is created?

    //EDIT: Edited title

  4. I want to "edit" the "internal.db" to make a new field, called "adminlevel".

    Now I configured the adminsystem new, to check, if the player has adminlevel 1 to open it.

    But I dont know, how to write or read variables out of an SQLite Database FILE...

  5. Hey guys,

    want to make a new variable in the internal.db to make a new Adminvariable.

    Isnt as easy as thought...

    Need to load and save it at dis-/connect...

    Please help at SQLite :(

    Greetings, Deadmau5.

  6. You mean

    resource.SERIAL?

    or user.SERIAL?

    //EDIT: So i need to make an extra mysql table for example where the serials are saved?

    //EDIT2: Why the f*ck i don't use user.SERIAL xD?

    Thnx at all :)

    //EDIT3: Any way to script-connect an user to his account?

    Like

    LoginPlayer(player thePlayer, account theAccount)?

    //EDIT4: Sry for the much edits, but now i have a big problem... It shows me anytime the USAGE text :S

    function adminCMD( player, otherplayer, level ) 
        if getElementData( player, "pptts.canusemakeadmin" ) then -- the shared logic 
            local otherplayer = findPlayer( otherplayer ) 
            if otherplayer then 
                local serial = getPlayerSerial( otherplayer ) 
                local thegroup = aclGetGroup( getElementData( otherplayer, "pptts.acl" ) ) 
                --local otherplayername = getPlayerName( otherplayer ) 
                local playername = getPlayerName( player ) 
                if level == "Nichts" then 
                    aclGroupRemoveObject ( thegroup, "user." ..serial ) 
                    removeAccount( serial ) 
                    outputChatBox( playername.. "hat dir deine Rechte entzogen!", otherplayer ) 
                    outputChatBox( "Du hast" ..otherplayername "die Rechte entzogen!",player ) 
                elseif level == "Member" then 
                    aclGroupRemoveObject ( thegroup, "user." ..serial ) 
                    removeAccount( serial ) 
                    addAccount( serial, "l0l7h15p455w0rd15uncr4ck4bl3" ) 
                    setElementData( otherplayer, "pptts.acl", "Member") 
                    aclGroupAddObject( aclGetGroup("Member"), "user."..otherplayername ) 
                    outputChatBox( playername.. "hat dich zum Member gemacht!", otherplayer ) 
                    outputChatBox( "Du hast" ..otherplayername "zum Member gemacht!",player ) 
                elseif level == "Moderator" then 
                    aclGroupRemoveObject ( thegroup, "user." ..serial ) 
                    removeAccount( serial ) 
                    addAccount( serial, "l0l7h15p455w0rd15uncr4ck4bl3" ) 
                    setElementData( otherplayer, "pptts.acl", "Moderator") 
                    aclGroupAddObject( aclGetGroup("Moderator"), "user."..otherplayername ) 
                    outputChatBox( playername.. "hat dich zum Moderator gemacht!", otherplayer ) 
                    outputChatBox( "Du hast" ..otherplayername "zum Moderator gemacht!",player ) 
                elseif level == "Admin" then 
                    aclGroupRemoveObject ( thegroup, "user." ..serial ) 
                    removeAccount( serial ) 
                    addAccount( serial, "l0l7h15p455w0rd15uncr4ck4bl3" ) 
                    setElementData(otherplayer, "pptts.acl", "Admin") 
                    aclGroupAddObject( aclGetGroup("Admin"), "user."..otherplayername ) 
                    outputChatBox( playername.. "hat dich zum Admin gemacht!", otherplayer ) 
                    outputChatBox( "Du hast" ..otherplayername "zum Admin gemacht!",player ) 
                elseif level == "VIP" then 
                    aclGroupRemoveObject ( thegroup, "user." ..serial ) 
                    removeAccount( serial ) 
                    addAccount( serial, "l0l7h15p455w0rd15uncr4ck4bl3" ) 
                    setElementData( otherplayer, "pptts.acl", "VIP" ) 
                    aclGroupAddObject( aclGetGroup("VIP"), "user."..otherplayername ) 
                    outputChatBox( playername.. "hat dich zum VIP gemacht!", otherplayer ) 
                    outputChatBox( "Du hast" ..otherplayername "zum VIP gemacht!",player ) 
                else 
                    outputChatBox( "NUTZUNG: /makeadmin [spieler] [Nichts/Member/Moderator/Admin/VIP]", player ) 
                end 
            else 
                outputChatBox( "NUTZUNG: /makeadmin [spieler] [Nichts/Member/Moderator/Admin/VIP]", player ) 
            end 
        end 
    end 
    addCommandHandler( "makeadmin", adminCMD ) 
    

  7. Muchas gracias :D

    //EDIT: Now i need a makeadmin command...

    But why this dont work?

    function adminCMD(player, otherplayer, level) 
        if getElementData(player, "pptts.canusemakeadmin") then -- the shared logic 
            if otherplayer then 
                local serial = getPlayerSerial(otherplayer) 
                local thegroup = aclGetGroup(getElementData(otherplayer, "pptts.acl")) 
                local otherplayername = getPlayerName( otherplayer ) 
                local playername = getPlayerName(player) 
                if level == "Nichts" then 
                    aclGroupRemoveObject ( thegroup, "serial." ..serial ) 
                    outputChatBox(playername.. "hat dir deine Rechte entzogen!", otherplayer) 
                    outputChatBox("Du hast" ..otherplayername "die Rechte entzogen!",player) 
                elseif level == "Member" then 
                    aclGroupRemoveObject ( thegroup, "serial." ..serial ) 
                    setElementData(otherplayer, "pptts.acl", "Member") 
                    aclGroupAddObject( aclGetGroup("Member"), "serial."..otherplayername) 
                    outputChatBox(playername.. "hat dich zum Member gemacht!", otherplayer) 
                    outputChatBox("Du hast" ..otherplayername "zum Member gemacht!",player) 
                elseif level == "Moderator" then 
                    aclGroupRemoveObject ( thegroup, "serial." ..serial ) 
                    setElementData(otherplayer, "pptts.acl", "Moderator") 
                    aclGroupAddObject( aclGetGroup("Moderator"), "serial."..otherplayername) 
                    outputChatBox(playername.. "hat dich zum Moderator gemacht!", otherplayer) 
                    outputChatBox("Du hast" ..otherplayername "zum Moderator gemacht!",player) 
                elseif level == "Admin" then 
                    aclGroupRemoveObject ( thegroup, "serial." ..serial ) 
                    setElementData(otherplayer, "pptts.acl", "Admin") 
                    aclGroupAddObject( aclGetGroup("Admin"), "serial."..otherplayername) 
                    outputChatBox(playername.. "hat dich zum Admin gemacht!", otherplayer) 
                    outputChatBox("Du hast" ..otherplayername "zum Admin gemacht!",player) 
                elseif level == "VIP" then 
                    aclGroupRemoveObject ( thegroup, "serial." ..serial ) 
                    setElementData(otherplayer, "pptts.acl", "VIP") 
                    aclGroupAddObject( aclGetGroup("VIP"), "serial."..otherplayername) 
                    outputChatBox(playername.. "hat dich zum VIP gemacht!", otherplayer) 
                    outputChatBox("Du hast" ..otherplayername "zum VIP gemacht!",player) 
                else 
                    outputChatBox("NUTZUNG: /makeadmin [spieler] [Nichts/Member/Moderator/Admin/VIP]", player) 
                end 
            else 
                outputChatBox("NUTZUNG: /makeadmin [spieler] [Nichts/Member/Moderator/Admin/VIP]", player) 
            end 
        end 
    end 
    addCommandHandler("makeadmin", adminCMD) 
    

  8. I have a big problem... my script always returns error if i use this

      
    function putplayerteamneu( ) 
        local serial = getPlayerSerial (source ) 
        if isObjectInACLGroup ( "serial." .. serial, aclGetGroup ( "Member" ) ) then 
            setPlayerTeam ( source, getTeamFromName( "Members" ) ) 
            setElementData( source, "pptts.acl", "Members") 
        else if isObjectInACLGroup ( "serial." .. serial, aclGetGroup ( "Moderator" ) ) then 
            setPlayerTeam ( source, getTeamFromName( "Moderators" ) ) 
            setElementData( source, "pptts.acl", "Moderator") 
        else if isObjectInACLGroup ( "serial." .. serial, aclGetGroup ( "Owner" ) ) then 
            setPlayerTeam ( source, getTeamFromName( "Server Owners" ) ) 
            setElementData( source, "pptts.acl", "Owner") 
            setElementData( source, "pptts.canusemakeadmin", true) 
        else if isObjectInACLGroup ( "serial." .. serial, aclGetGroup ( "Admin" ) ) then 
            setPlayerTeam ( source, getTeamFromName( "Admins" ) ) 
            setElementData( source, "pptts.acl", "Admin") 
        else if isObjectInACLGroup ( "serial." .. serial, aclGetGroup ( "VIP" ) ) then 
            setPlayerTeam ( source, getTeamFromName( "VIP" ) ) 
            setElementData( source, "pptts.acl", "VIP") 
        else 
            setPlayerTeam ( source, getTeamFromName( "Players" ) ) 
        end 
    end 
    addEventHandler ( "onPlayerJoin", getRootElement(), putplayerteamneu ) 
      
    

    Because don't i close it with the else if?

    Pls help with this =(

  9. I have a big problem...

    I made a new group, thats name is "Owner"...

    So, i added the acl "Admin" to it

    "Admin">
    

    But i can't use /spectate oder set a next map ingame :(

    Please help!

    //EDIT: It's the race gamemode...

  10. Works :)

    Now another problem...

    Why it spams the chat when i use this code?

    function setTheCarColors( ) 
        local playersteam = getTeamFromName( "Players" ) 
        local membersteam = getTeamFromName( "Members" ) 
        local moderatorsteam = getTeamFromName( "Moderators" ) 
        local adminsteam = getTeamFromName( "Admins" ) 
        local ownersteam = getTeamFromName( "Server Owners" ) 
         
        for i, car in ipairs( getElementsByType( "vehicle" ) ) do 
            local theplayer = getVehicleOccupant( car ) 
            local nowteam = getPlayerTeam( theplayer )         <------------- Always showing and spamming an error at this line... 
            if(nowteam == playersteam) then 
                setVehicleColor(car, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0) 
            end 
            if(nowteam == membersteam) then 
                setVehicleColor(car, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) 
            end 
            if(nowteam == moderatorsteam) then 
                setVehicleColor(car, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) 
            end 
            if(nowteam == adminsteam) then 
                setVehicleColor(car, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0) 
            end 
            if(nowteam == ownersteam) then 
                setVehicleColor(car, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) 
            end 
        end 
    end 
    addEvent("onVehColorChange",true) 
    addEventHandler("onVehColorChange",getRootElement(),setTheCarColors) 
      
    function timer() --Delay it a bit to allow players to warp in their vehicle... 
        setTimer(setTheCarColors,500,0) 
    end 
    addEventHandler("onMapStarting",getRootElement(),timer) 
    addCommandHandler ( "set_vehicle_color", setTheCarColors ) 
    

    The error:

    WARNING: putplayertoteamscript/script.lua:74: Bad argument @ 'getPlay

    erTeam'

    and that causes serverlags -.-

  11. I have a problem...

    Everyone that connects on my server, with namecolor, will be like this in TAB list:

    #FF0000Master#0000FFGamer

    Just an example...

    Any resource to fix this?

  12. Hey, mappers.

    I'm recently made a clan (for not only mta).

    Now, my server hasn't got enough maps :(

    So now it's your turn.

    It would be great, if YOU send me download links to your EPIC (and not so epic) maps :)

    Greetings from Germany, ([AEG]) Deadmau5.

×
×
  • Create New...