Jump to content

SAbJaN

Members
  • Posts

    59
  • Joined

  • Last visited

Everything posted by SAbJaN

  1. SAbJaN

    Doesn't work

    Oh sorry, Didn't realize, I feel stupid D:
  2. SAbJaN

    Doesn't work

    @Solidsnake14 That's a working scoreboard? He says it works fine.
  3. Yep I've done that now, But it's still not working. EDIT: I've got it working, I've replaced the rights to 'true' because all of them where 'false' Maybe that's why when I tried kicking someone, It didn't work.
  4. I don't think so, How do I make it so It does?
  5. SAbJaN

    MySQL bug?!

    Try putting this is settings.xml in the deathmatch folder <settings> <!-- MySQL Configuration --> <setting name="@sql.user" value="SQL USER"/> <setting name="@sql.password" value="PASSWORD"/> <setting name="@sql.database" value="DATABASE NAME"/> <setting name="@sql.hostname" value="HOST (Usually localhost if you're using XAMPP)"/> <setting name="@sql.port" value="PORT (Default is 3306"/> <!-- Only use this on Linux if the normal connection does fail even though using the correct username & password. --> <setting name="@sql.socket" value="/var/run/mysqld/mysqld.sock"/> </settings>
  6. Thank's for the reply, It works Good work! Lock thread please!
  7. SAbJaN

    MySQL bug?!

    Yeah well executing the query has things to do with the SQL, are you sure you've set it up correctly, Have you set it up in settings.xml in the deathmatch folder?
  8. SAbJaN

    MySQL bug?!

    Have a look at this first. viewtopic.php?f=148&t=39069 If that don't work, let us know.
  9. SAbJaN

    Doesn't work

    Client: local SCOREBOARD_WIDTH = 420 -- The scoreboard window width local SCOREBOARD_HEIGHT = 360 -- The scoreboard window height local SCOREBOARD_HEADER_HEIGHT = 25 -- Height for the header in what you can see the server info local SCOREBOARD_TOGGLE_CONTROL = "tab" -- Control/Key to toggle the scoreboard visibility local SCOREBOARD_PGUP_CONTROL = "mouse_wheel_up" -- Control/Key to move one page up local SCOREBOARD_PGDN_CONTROL = "mouse_wheel_down"-- Control/Key to move one page down local SCOREBOARD_DISABLED_CONTROLS = { "next_weapon", -- Controls that are disabled when the scoreboard is showing "previous_weapon", "aim_weapon", "radio_next", "radio_previous" } local SCOREBOARD_TOGGLE_TIME = 50 -- Time in miliseconds to make the scoreboard (dis)appear local SCOREBOARD_POSTGUI = true -- Set to true if it must be drawn over the GUI local SCOREBOARD_INFO_BACKGROUND = { 255,0,0, 200 } -- RGBA color for the info header background local SCOREBOARD_SERVER_NAME_COLOR = { 0, 255,50, 160 } -- RGBA color for the server name text local SCOREBOARD_PLAYERCOUNT_COLOR = { 255, 255,50, 160 } -- RGBA color for the server player count text local SCOREBOARD_BACKGROUND = { 0,0,0, 200} -- RGBA color for the background local SCOREBOARD_BACKGROUND_IMAGE = { 255, 255, 255, 0 } -- RGBA color for the background image local SCOREBOARD_HEADERS_COLOR = { 0, 0, 0, 255 } -- RGBA color for the headers local SCOREBOARD_SEPARATOR_COLOR = { 82, 82, 82, 140 } -- RGBA color for the separator line between headers and body content local SCOREBOARD_SCROLL_BACKGROUND = { 0, 10, 20, 0 } -- RGBA color for the scroll background local SCOREBOARD_SCROLL_FOREGROUND = { 15, 177, 253, 0 } -- RGBA color for the scroll foreground local SCOREBOARD_SCROLL_HEIGHT = 40 -- Size for the scroll marker local SCOREBOARD_COLUMNS_WIDTH = { 0.08, 0.74, 0.14, 0.04 } -- Relative width for each column: id, player name, ping and scroll position local SCOREBOARD_ROW_GAP = 0 -- Gap between rows = 0 -- Gap between rows --[[ Global variables to this context ]]-- local g_isShowing = false -- Marks if the scoreboard is showing local g_currentWidth = 0 -- Current window width. Used for the fade in/out effect. local g_currentHeight = 0 -- Current window height. Used for the fade in/out effect. local g_scoreboardDummy -- Will contain the scoreboard dummy element to gather info from. local g_windowSize = { guiGetScreenSize () } -- The window size local g_localPlayer = getLocalPlayer () -- The local player... local g_currentPage = 0 -- The current scroll page local g_players -- We will keep a cache of the conected player list local g_oldControlStates -- To save the old control states before disabling them for scrolling --[[ Pre-calculate some stuff ]]-- -- Scoreboard position local SCOREBOARD_X = math.floor ( ( g_windowSize[1] - SCOREBOARD_WIDTH ) / 2 ) local SCOREBOARD_Y = math.floor ( ( g_windowSize[2] - SCOREBOARD_HEIGHT ) / 2 ) -- Scoreboard colors SCOREBOARD_INFO_BACKGROUND = tocolor ( unpack ( SCOREBOARD_INFO_BACKGROUND ) ) SCOREBOARD_SERVER_NAME_COLOR = tocolor ( unpack ( SCOREBOARD_SERVER_NAME_COLOR ) ) SCOREBOARD_PLAYERCOUNT_COLOR = tocolor ( unpack ( SCOREBOARD_PLAYERCOUNT_COLOR ) ) SCOREBOARD_BACKGROUND = tocolor ( unpack ( SCOREBOARD_BACKGROUND ) ) SCOREBOARD_BACKGROUND_IMAGE = tocolor ( unpack ( SCOREBOARD_BACKGROUND_IMAGE ) ) SCOREBOARD_HEADERS_COLOR = tocolor ( unpack ( SCOREBOARD_HEADERS_COLOR ) ) SCOREBOARD_SCROLL_BACKGROUND = tocolor ( unpack ( SCOREBOARD_SCROLL_BACKGROUND ) ) SCOREBOARD_SCROLL_FOREGROUND = tocolor ( unpack ( SCOREBOARD_SCROLL_FOREGROUND ) ) SCOREBOARD_SEPARATOR_COLOR = tocolor ( unpack ( SCOREBOARD_SEPARATOR_COLOR ) ) -- Columns width in absolute units for k=1,#SCOREBOARD_COLUMNS_WIDTH do SCOREBOARD_COLUMNS_WIDTH[k] = math.floor ( SCOREBOARD_COLUMNS_WIDTH[k] * SCOREBOARD_WIDTH ) end -- Pre-calculate each row horizontal bounding box. local rowsBoundingBox = { { SCOREBOARD_X, -1 }, { -1, -1 }, { -1, -1 }, { -1, -1 } } -- ID rowsBoundingBox[1][2] = SCOREBOARD_X + SCOREBOARD_COLUMNS_WIDTH[1] -- Name rowsBoundingBox[2][1] = rowsBoundingBox[1][2] rowsBoundingBox[2][2] = rowsBoundingBox[2][1] + SCOREBOARD_COLUMNS_WIDTH[2] -- Ping rowsBoundingBox[3][1] = rowsBoundingBox[2][2] rowsBoundingBox[3][2] = rowsBoundingBox[3][1] + SCOREBOARD_COLUMNS_WIDTH[3] -- Scrollbar rowsBoundingBox[4][1] = rowsBoundingBox[3][2] rowsBoundingBox[4][2] = SCOREBOARD_X + SCOREBOARD_WIDTH --[[ Pre-declare some functions ]]-- local onRender local fadeScoreboard local drawBackground local drawScoreboard --[[ * clamp Clamps a value into a range. --]] local function clamp ( valueMin, current, valueMax ) if current < valueMin then return valueMin elseif current > valueMax then return valueMax else return current end end --[[ * createPlayerCache Generates a new player cache. --]] local function createPlayerCache ( ignorePlayer ) -- Optimize the function in case of not having to ignore a player if ignorePlayer then -- Clear the gloal table g_players = {} -- Get the list of connected players local players = getElementsByType ( "player" ) -- Dump them to the global table for k, player in ipairs(players) do if ignorePlayer ~= player then table.insert ( g_players, player ) end end else g_players = getElementsByType ( "player" ) end --[[ Uncomment to test with dummies ]]-- --[[ for k,v in ipairs(getElementsByType("playerDummy")) do table.insert(g_players, v) end --]] -- Sort the player list by their ID, giving priority to the local player table.sort ( g_players, function ( a, b ) local idA = getElementData ( a, "playerid" ) or 0 local idB = getElementData ( b, "playerid" ) or 0 -- Perform the checks to always set the local player at the beggining if a == g_localPlayer then idA = -1 elseif b == g_localPlayer then idB = -1 end return tonumber(idA) < tonumber(idB) end ) end --[[ * onClientResourceStart Handles the resource start event to create the initial player cache --]] addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), function () createPlayerCache () end, false ) --[[ * onClientElementDataChange Handles the element data changes event to update the player cache if the playerid was changed. --]] addEventHandler ( "onClientElementDataChange", root, function ( dataName, dataValue ) if dataName == "playerid" then createPlayerCache () end end ) --[[ * onClientPlayerQuit Handles the player quit event to update the player cache. --]] addEventHandler ( "onClientPlayerQuit", root, function () createPlayerCache ( source ) end ) --[[ * toggleScoreboard Toggles the visibility of the scoreboard. --]] local function toggleScoreboard ( show ) -- Force the parameter to be a boolean local show = show == true -- Check if the status has changed if show ~= g_isShowing then g_isShowing = show if g_isShowing and g_currentWidth == 0 and g_currentHeight == 0 then -- Handle the onClientRender event to start drawing the scoreboard. addEventHandler ( "onClientPreRender", root, onRender, false ) end -- Little hack to avoid switching weapons while moving through the scoreboard pages. if g_isShowing then g_oldControlStates = {} for k, control in ipairs ( SCOREBOARD_DISABLED_CONTROLS ) do g_oldControlStates[k] = isControlEnabled ( control ) toggleControl ( control, false ) end else for k, control in ipairs ( SCOREBOARD_DISABLED_CONTROLS ) do toggleControl ( control, g_oldControlStates[k] ) end g_oldControlStates = nil end end end --[[ * onToggleKey Function to bind to the appropiate key the function to toggle the scoreboard visibility. --]] local function onToggleKey ( key, keyState ) -- Check if the scoreboard element has been created if not g_scoreboardDummy then local elementTable = getElementsByType ( "scoreboard" ) if #elementTable > 0 then g_scoreboardDummy = elementTable[1] else return end end -- Toggle the scoreboard, and check that it's allowed. toggleScoreboard ( keyState == "down" and getElementData ( g_scoreboardDummy, "allow" ) ) end bindKey ( SCOREBOARD_TOGGLE_CONTROL, "both", onToggleKey ) --[[ * onScrollKey Function to bind to the appropiate key the function to change the current page. --]] local function onScrollKey ( direction ) if g_isShowing then if direction then g_currentPage = g_currentPage + 1 else g_currentPage = g_currentPage - 1 if g_currentPage < 0 then g_currentPage = 0 end end end end bindKey ( SCOREBOARD_PGUP_CONTROL, "down", function () onScrollKey ( false ) end ) bindKey ( SCOREBOARD_PGDN_CONTROL, "down", function () onScrollKey ( true ) end ) --[[ * onRender Event handler for onClientPreRender. It will forward the flow to the most appropiate function: fading-in, fading-out or drawScoreboard. --]] onRender = function ( timeshift ) -- Boolean to check if we must draw the scoreboard. local drawIt = false if g_isShowing then -- Check if the scoreboard has been disallowed if not getElementData ( g_scoreboardDummy, "allow" ) then
  10. SAbJaN

    MySQL bug?!

    What GameMode?
  11. Hey guys, I just need help, is this correct, I'm owner, on LVL 6, And it's not letting me /makeadmin [user] [rank] It's only letting me do it from the console.. addCommandHandler("gotoplace", teleportToPresetPoint, false, false) function makePlayerAdmin(thePlayer, commandName, who, rank) if ( hasObjectPermissionTo ( thePlayer, "command.aexec", true ) ) then if not (who) then outputChatBox("SYNTAX: /" .. commandName .. " [Player Partial Name/ID] [Rank]", thePlayer, 255, 194, 14) else local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(thePlayer, who) if (targetPlayer) then local username = getPlayerName(thePlayer) local accountID = getElementData(targetPlayer, "gameaccountid") exports['anticheat-system']:changeProtectedElementDataEx(targetPlayer, "adminlevel", tonumber(rank)) rank = tonumber(rank) if (rank<1337) then exports['anticheat-system']:changeProtectedElementDataEx(targetPlayer, "hiddenadmin", 0) end local query = mysql:query_free("UPDATE accounts SET admin='" .. mysql:escape_string(tonumber(rank)) .. "', hiddenadmin='0' WHERE id='" .. mysql:escape_string(accountID) .. "'") outputChatBox("You set " .. targetPlayerName .. "'s Admin rank to " .. rank .. ".", thePlayer, 0, 255, 0) local hiddenAdmin = getElementData(thePlayer, "hiddenadmin") -- Fix for scoreboard & nametags local targetAdminTitle = exports.global:getPlayerAdminTitle(targetPlayer) if (rank>0) or (rank==-999999999) then exports['anticheat-system']:changeProtectedElementDataEx(targetPlayer, "adminduty", 1) else exports['anticheat-system']:changeProtectedElementDataEx(targetPlayer, "adminduty", 0) end mysql:query_free("UPDATE accounts SET adminduty=" .. mysql:escape_string(getElementData(targetPlayer, "adminduty")) .. " WHERE id = " .. mysql:escape_string(getElementData(targetPlayer, "gameaccountid")) ) exports.global:updateNametagColor(targetPlayer) if (hiddenAdmin==0) then local adminTitle = exports.global:getPlayerAdminTitle(thePlayer) outputChatBox(adminTitle .. " " .. username .. " set your admin rank to " .. rank .. ".", targetPlayer, 255, 194, 14) exports.global:sendMessageToAdmins("AdmCmd: " .. tostring(adminTitle) .. " " .. username .. " set " .. targetPlayerName .. "'s admin level to " .. rank .. ".") else outputChatBox("Hidden admin set your admin rank to " .. rank .. ".", targetPlayer, 255, 194, 14) end end end end end addCommandHandler("makeadmin", makePlayerAdmin, false, false)
  12. Hey guys, I'm having a problem with setting ShoDown Rolepaly that Manishi released, I've put all the files in Resources, and edited the mtaserver.conf, (I didn't come with a ACL, I don't know if that's the problem) i've uploaded the sql and changed it settings, and this is what I've come to a conclusion with, (Also, It's denying me access from my MySQL, I don't know why, It's all correct in the settings.) Error:
  13. SAbJaN

    MTA jobs.

    I'm hosting MTA Paradise by Makobo, and I can't find any bus driver jobs, or any jobs, I have to create jobs, But.. do I have to script it or..
  14. Hey guys, I've been recently trying to install MTA Paradise on local host with XAMPP, and I don't know where all the files go and what to do with the MySQL, If theirs any tutorial that can help with putting in the files and setting it up that would be mostly appreciated. Thanks -Matt
  15. SAbJaN

    MTA: Paradise?

    Thanks mate, Do you have a full tutorial on how to set it up haha.
  16. Crusader Roleplay Hey guys, As Crusaders representative, I thought I'd advertise the server. What's Crusader Roleplay? Crusader Roleplay is basically like any other server, It's got the commands, vehicles, factions, anything that you can name.. But it's scripted by us. We have very intellectual staff, who will keep the server running, preventing the non-role-players, and the deathmatchers who like to ruin peoples game. What do we do in it? You would act as if you would as in real life basically, You drive normally, You talk to other players as if you would in real life, it's basically like that, You can join factions such as Los Santos Police Department, Los Santos Government, And you can even create your own faction, or gang, by applying on the forums (http://www.http://crusader.site88.net/f ... um.php?f=3) and maybe while you're there, you can make some suggestions. Where do I go to join? Well, that's easy! You can just goto the MTA client, and going to Server Browser. Either find the name Crusader Roleplay, or go to quick connect, and type in, or copy and paste this - mtasa://50.30.47.134:22026 ' and you should be connecting. ------------------------- We hope you have fun on Crusader MTA Roleplay and enjoy your staff, please, invite your friends also! -Crusader Staff
  17. SAbJaN

    MTA: Paradise?

    Short topic.. Where do I download Multi Theft Auto: Paradise, the RP game mode, I'm going to try set it up considering I've never done it.
  18. SAbJaN

    SQL help?

    Deleted it, Mistake.
  19. SAbJaN

    SQL help?

    Alright, I have setup a server, added all the files in the meta, and added the SQL, But not sure about this line? local server = get( "What goes here?" ) or "" -- server What goes in between them quotation marks, and then in the console it has errors like, Saying it can't start admin2 cause of the SQL error, when I enter my server, It just stays a black screen, and it's basically broken, Note that this is MTA: Paradise Roleplay.
  20. It's not really stolen if it was released on community.multitheftauto.com
  21. It's not showing the code properly, It's showing it like this.
  22. Hey, I just installed a login system where they can register and login as such, but when I try click the login button it don't work, and when I looked at the console it said this ERROR: Client triggered serverside event login, but event is not added serverside. What's this mean and what do I have to do?
  23. So, I've got a RPG, and when I enter my server, it's not spawning, it's showing a black screen saying it's been hosted by windows, then when I goto my console to restart it, it works, but all the commands fail.. Any help on how to spawn in Los Santos or something?
  24. SAbJaN

    AusRoleplay

    I've worked on the basics of the server, such as meta.xml, and some addons that could go well with it, other then that, I need to fix jobs, factions, etc.
×
×
  • Create New...