Jump to content

roaddog

Members
  • Posts

    346
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by roaddog

  1. Well hello guys. so I have got a question for you, This seems easy for me but, yet i haven't figured it out. So the question is how can I find number in a string for example "Vehicle (ID: 100)" or "Some string 10 lines" and I need just the number from that string, how to get the numbers that's it. Thanks.
  2. Hello all. So recently I always use SQL for storing data. Sometimes i want to insert a new column into an existing table if I want to update table, but the only way i can seem to do that is if i drop the table and re-create the table with the added column which results in all the data in the table being lost. I was wondering if anyone knows how to add a column to the table without having to drop it and re-create it? Thanks
  3. you could set timer for the screen to fade out. like this. function registerHandler(player, username, password) local account = getAccount(username, password) if (account ~= false) then triggerClientEvent(player, "registerTaken", getRootElement()) else account = addAccount(username, password) if (logIn(player, account, password) == true) then fadeCamera(source, false) outputChatBox("Welcome to 'Zombie Apocalypse 1.0', Enjoy the BETA!", player, 0, 255, 0) outputChatBox("Author(s): RaysMTA", player, 0, 255, 0) triggerClientEvent(player, "hideLoginWindow", getRootElement()) spawnPlayer(source, 1959.55, -1714.46, 10) setCameraTarget (source, source) setTimer(fadeCamera, 2000, 1, source, true) else triggerClientEvent(player, "unknownError", getRootElement()) end end end
  4. Hello, I need a little help here, so I was making a script, and I got a problem. the problem is when I clicked the ped, nothing happens. function elementClicked( theButton, theState, thePlayer ) if theButton == "left" and theState == "down" then if getElementType( source) == "ped" then outputChatBox("Ped clicked", thePlayer) -- doesn't reach this line triggerClientEvent(thePlayer, "onPedClicked", thePlayer) end end end addEventHandler("onMarkerHit", getRootElement(), function(hitElement, matchingDimension) if source == thismarker then if not isPedInVehicle(hitElement) then outputChatBox("Click the ped to talk!", hitElement, 200, 200, 0) addEventHandler( "onElementClicked", getRootElement(), elementClicked ) -- I trigger the event here but when I try clicking the ped, nothing happens? else outputChatBox("get out of the vehicle", hitElement, 200,0,0) end end end) ped = createPed(206, -537.8759765625, -98.71875, 63.296875, -90, 0) -- I created the ped on clientside. setElementFrozen(ped, true) function cancelPedDamage() cancelEvent() end addEventHandler("onClientPedDamage", ped, cancelPedDamage) addEvent("onPedClicked", true) addEventHandler("onPedClicked", root, function() windows() end)
  5. roaddog

    Help Menu

    I guess you could stop helpmanager resource
  6. Original by 50p https://community.multitheftauto.com/ind ... ails&id=54 Fake one https://community.multitheftauto.com/ind ... s&id=10278 DONE
  7. Try now Client: GUIEditor = { tab = {}, tabpanel = {}, edit = {}, button = {}, window = {}, label = {}, memo = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(321, 107, 626, 612, "GTs Login or Register Panel", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.tabpanel[1] = guiCreateTabPanel(9, 312, 607, 290, false, GUIEditor.window[1]) GUIEditor.tab[1] = guiCreateTab("Updates", GUIEditor.tabpanel[1]) GUIEditor.memo[1] = guiCreateMemo(10, 10, 582, 241, "", false, GUIEditor.tab[1]) GUIEditor.button[1] = guiCreateButton(9, 142, 121, 61, "Login", false, GUIEditor.window[1]) GUIEditor.button[2] = guiCreateButton(194, 142, 121, 61, "Register", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(11, 30, 96, 34, "UserName : ", false, GUIEditor.window[1]) GUIEditor.label[2] = guiCreateLabel(11, 92, 96, 34, "Password : ", false, GUIEditor.window[1]) GUIEditor.edit[1] = guiCreateEdit(125, 30, 161, 38, "", false, GUIEditor.window[1]) GUIEditor.edit[2] = guiCreateEdit(125, 88, 161, 38, "", false, GUIEditor.window[1]) end) local localPlayer = getLocalPlayer ( ) function windowHandler( ) local playername = getPlayerName(localPlayer) guiSetText(GUIEditor.edit[1], "") guiSetText(GUIEditor.edit[2], "") guiSetText(GUIEditor.edit[1], playername) guiSetVisible ( GUIEditor.window[1], true ) guiSetInputEnabled(true) showCursor ( true ) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), windowHandler ) function login () if (source == GUIEditor.button[1]) then triggerServerEvent ( "onLogin",getRootElement(), localPlayer, guiGetText(GUIEditor.edit[1]), guiGetText(GUIEditor.edit[2]) ) end end addEventHandler ( "onClientGUIClick", guiRoot, login ) function register () if (source == GUIEditor.button[2]) then triggerServerEvent ( "onRegister",getRootElement(), localPlayer, guiGetText(GUIEditor.edit[1]), guiGetText(GUIEditor.edit[2])) end end addEventHandler ( "onClientGUIClick", guiRoot, register) function hideLoginWindow() guiSetInputEnabled(false) guiSetVisible ( GUIEditor.window[1], false ) showCursor ( false ) end addEvent( "hideLoginWindow", true ) addEventHandler( "hideLoginWindow", getRootElement(), hideLoginWindow )
  8. Replace your client side with this GUIEditor = { tab = {}, tabpanel = {}, edit = {}, button = {}, window = {}, label = {}, memo = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(321, 107, 626, 612, "GTs Login or Register Panel", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.tabpanel[1] = guiCreateTabPanel(9, 312, 607, 290, false, GUIEditor.window[1]) GUIEditor.tab[1] = guiCreateTab("Updates", GUIEditor.tabpanel[1]) GUIEditor.memo[1] = guiCreateMemo(10, 10, 582, 241, "", false, GUIEditor.tab[1]) GUIEditor.button[1] = guiCreateButton(9, 142, 121, 61, "Login", false, GUIEditor.window[1]) GUIEditor.button[2] = guiCreateButton(194, 142, 121, 61, "Register", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(11, 30, 96, 34, "UserName : ", false, GUIEditor.window[1]) GUIEditor.label[2] = guiCreateLabel(11, 92, 96, 34, "Password : ", false, GUIEditor.window[1]) GUIEditor.edit[1] = guiCreateEdit(125, 30, 161, 38, "", false, GUIEditor.window[1]) GUIEditor.edit[2] = guiCreateEdit(125, 88, 161, 38, "", false, GUIEditor.window[1]) end ) local localPlayer = getLocalPlayer ( ) function windowHandler( ) local playername = getPlayerName(localPlayer) guiSetText(GUIEditor.edit[1], "") guiSetText(GUIEditor.edit[2], "") guiSetText(GUIEditor.edit[1], playername) guiSetText(GUIEditor.edit[2], playername) guiSetVisible ( GUIEditor.window[1], true ) guiSetInputEnabled(true) showCursor ( true ) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), windowHandler ) function login ( button, state ) if (source == GUIEditor.button[1]) then triggerServerEvent ( "onLogin", getRootElement(), localPlayer, guiGetText(GUIEditor.edit[1]), guiGetText(GUIEditor.edit[2]) ) end end addEventHandler ( "onClientGUIClick", guiRoot, login, false ) function register ( button, state ) if (source == GUIEditor.button[2]) then triggerServerEvent ( "onRegister", getRootElement(), localPlayer, guiGetText(GUIEditor.edit[1]), guiGetText(GUIEditor.edit[2])) end end addEventHandler ( "onClientGUIClick", guiRoot, register, false ) function hideLoginWindow() guiSetInputEnabled(false) guiSetVisible ( GUIEditor.window[1], false ) showCursor ( false ) end addEvent( "hideLoginWindow", true ) addEventHandler( "hideLoginWindow", getRootElement(), hideLoginWindow )
  9. This user https://community.multitheftauto.com/in ... &id=377995 keeps on uploading none description resources and they are stolen. DONE
  10. roaddog

    [[text]]

    Ooo, Many thanks.
  11. roaddog

    [[text]]

    Oh Thanks could you explain what %s and %d do?
  12. roaddog

    [[text]]

    guiSetText ( GUIEditor.label[1], [[Name: "..playername.." UpTime:"..getElementData(thePlayer, "UpTime").." Occupation: "..getElementData(thePlayer, "Occupation")" Health: "..getElementHealth(thePlayer).." Group: "..getElementData(thePlayer, "Group")" Group Rank: Cash: "..getPlayerMoney(thePlayer)" Wanted Level: "..getPlayerWantedLevel(thePlayer).." nCountry: ]]) Hai How to do this thing? can anyone correct me ?
  13. Vehicle mods https://community.multitheftauto.com/in ... ls&id=9891 https://community.multitheftauto.com/in ... ls&id=9892 DONE
  14. roaddog

    Need help!

    You can use playSound to play the music and use onClientPlayerJoin event to trigger it and make sure its client side on meta
  15. Alright gonna try it.
  16. Hai guys, could you guide me how to make something like this, When cursor enter, text will be bigger.. Thanks
  17. roaddog

    Lags :O

    OMG, Thank you guys your info has saved my life. I didn't know 'bout stack overflow, useful info.
  18. roaddog

    Lags :O

    Heya, so why if i run this script, server will be frozen and shutting down automaticly ? exports [ "scoreboard" ]:addScoreboardColumn ( "Gang",getRootElement() ,40,80, "Gang" ) function getgang() local group = exports.groupsystem:getPlayerGroup(source) if group then ---outputChatBox(group) setElementData(source, "Gang", group) end setTimer ( getgang, 2500, 0 ) end addCommandHandler("gang", getgang) addEventHandler( "onPlayerLogin", getRootElement(), getgang )
  19. I got some issues in this script, could you guys help me out? the warning shows whenever new player register, or first time login function saveWeaponStats(player) if (not player or not isElement(player)) then return end local account = getPlayerAccount(player) if (account and not isGuestAccount(account)) then local stats = "" for stat=69, 81 do local value = getPedStat(player, stat) stats = stats ..",".. stat ..";".. value end setAccountData(account, "weaponStats", stats) end end addEventHandler("onPlayerQuit",root,function () saveWeaponStats(source) end) function loadWeaponStats(player) if (not player or not isElement(player)) then return end local account = getPlayerAccount(player) if (account and not isGuestAccount(account)) then local statsData = getAccountData(account,"weaponStats") local stats = split(statsData, ",") for k, v in ipairs(stats) do local stat = split(v, ";") setPedStat(player, tonumber(stat[1]), tonumber(stat[2])) end end end addEventHandler("onPlayerLogin",root,function () loadWeaponStats(source) end) [2014-08-02 18:02:29] WARNING: login\server.lua:641: Bad argument @ 'split' [Expected string at argument 1, got boolean] [2014-08-02 18:02:29] ERROR: login\server.lua:642: bad argument #1 to 'ipairs' (table expected, got string)
  20. roaddog

    Question

    1000+ viewers and they didn't answer... Anyway thank you, that's helped me though.
  21. roaddog

    Question

    IP Address : 216.120.248.18 Location : United States (95% accuracy) Host Name : init-test.com
  22. roaddog

    Question

    Hey MTA, What is exactly the causes of server getting automatically shutdown or been frozen? is that because alot of database uses? error in debugscript? too much resources running? What would I do to solve it ?
  23. roaddog

    outputting

    Yes Edit: Nvm, I fixed it by myself, thank you anyway.
×
×
  • Create New...