Jump to content

..:D&G:..

Members
  • Posts

    1,028
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by ..:D&G:..

  1. Thats good . Well... I have a problem, I can't create any faction. I put everything that the syntaxa says but nothing happens... and the faction is not created, even in the database..
  2. What about MTA Paradise? Am I allowed to use it or ask for help with the scripts?
  3. Hello, I didn't know where to post this so I just choose Server. I've seen people saying that Manishi released his gamemode by himself. Other people say that it is an illegal script... How is that illegal when a guy releases his own script?
  4. Ok, now how to I make check points, and when the train driver goes in it, it should disappear and the next one should pop up, and when the driver hits a check point he needs to get an ammout of money.
  5. Well, I think everyone knows, when someone tries to register, it says that I need to register on Valhalla forums first... How do I make it register in game?
  6. Many people will think that I want to make a server that is a copy of vG, but no, I am trying to make my own script. I just need this account system (Valhalla account-system) till I make my own. I tried to remove the things from the first line but I had no luck. addEventHandler("accounts:login:request", getRootElement(), function () setElementDimension ( getLocalPlayer(), 1 ) setElementInterior( getLocalPlayer(), 0 ) setCameraMatrix( 837.90606689453, -2066.2963867188, 16.712882995605, 0, -10000, 0) fadeCamera(true) guiSetInputEnabled(true) clearChat() LoginScreen_openLoginScreen() end ); --[[ LoginScreen_openLoginScreen( ) - Open the login screen ]]-- local wLogin, lUsername, tUsername, lPassword, tPassword, chkRememberLogin, bLogin, bRegister, updateTimer = nil function LoginScreen_openLoginScreen() local width, height = guiGetScreenSize() --wLogin = guiCreateWindow(0,0, width, height, "valhallaGaming - MTA Roleplay server", true) wLogin = nil --guiWindowSetSizable(wLogin, false) --guiWindowSetMovable(wLogin, false) lUsername = guiCreateLabel(width /6, height /4, 100, 50, "Username:", false, wLogin) guiSetFont(lUsername, "default-bold-small") tUsername = guiCreateEdit(width /4, height /4, 100, 17, "Username", false, wLogin) guiSetFont(tUsername, "default-bold-small") guiEditSetMaxLength(tUsername, 32) addEventHandler("onClientGUIAccepted", tUsername, LoginScreen_validateLogin, false) lPassword = guiCreateLabel(width /6, height /3.5, 100, 50, "Password:", false, wLogin) guiSetFont(lPassword, "default-bold-small") tPassword = guiCreateEdit(width /4, height /3.5, 100, 17, "Password", false, wLogin) guiSetFont(tPassword, "default-bold-small") guiEditSetMasked(tPassword, true) guiEditSetMaxLength(tPassword, 64) addEventHandler("onClientGUIAccepted", tPassword, LoginScreen_validateLogin, false) chkRememberLogin = guiCreateCheckBox(width /5, height /3.2, 175, 17, "Remember My Details", false, false, wLogin) guiSetFont(chkRememberLogin, "default-bold-small") bLogin = guiCreateButton(width /6, height /2.9, 75, 17, "Login", false, wLogin) guiSetFont(bLogin, "default-bold-small") addEventHandler("onClientGUIClick", bLogin, LoginScreen_validateLogin, false) bRegister = guiCreateButton(width /4, height /2.9, 75, 17, "Register", false, wLogin) guiSetFont(bRegister, "default-bold-small") addEventHandler("onClientGUIClick", bRegister, LoginScreen_startRegister, false) guiSetText(tUsername, tostring( loadSavedData("username", "") )) local tHash = tostring( loadSavedData("hashcode", "") ) guiSetText(tPassword, tHash) if #tHash > 1 then guiCheckBoxSetSelected(chkRememberLogin, true) end addEventHandler( "onClientRender", getRootElement(), LoginScreen_RunFX ) updateTimer = setTimer(LoginScreen_RefreshIMG, 7500, 0) triggerEvent("accounts:options:settings:updated", getLocalPlayer()) end local screenX, screenY = guiGetScreenSize() local alphaAction = 3 local alphaStep = 50 local screenX, screenY = guiGetScreenSize() local alphaAction = 3 local alphaStep = 50 local totalslides = 6 local currentslide = math.random(1, totalslides) function LoginScreen_RunFX() dxDrawRectangle(0, 0, screenX, screenY, tocolor(0, 0, 0, 150), false) dxDrawText( "Welcome at the Valhalla Gaming MTA:Role play server", screenX/2 - 300, screenY/10, 300, 200, tocolor ( 255, 255, 255, 255 ), 2, "default-bold" ) dxDrawText( "Please login to start playing on our server!", screenX/6, screenY/4.9, screenX, screenY, tocolor ( 255, 255, 255, 255 ), 1, "default-bold" ) alphaStep = alphaStep + alphaAction if (alphaStep > 200) or (alphaStep < 50) then alphaAction = alphaAction - alphaAction - alphaAction end -- Left side local startX, startY = screenX/15, screenY/2 local endX = screenX/2.3 - 15 dxDrawText( "News and such.. ", startX, startY, 2000, 2000, tocolor ( 255, 255, 255, 255 ), 1.5, "default-bold" ) startY = startY + 40 dxDrawText( getElementData(resourceRoot, "news:title") or "None \"{SMILIES_PATH}/icon_sad.gif\" alt=\"\" title=\"Sad\" />", startX, startY, endX, startY + 30, tocolor ( 255, 255, 255, 255 ), 1.2, "default-bold", "center", "top", true, false ) startY = startY + 16 dxDrawText( getElementData(resourceRoot, "news:sub") or "", startX, startY, endX, startY + 30, tocolor( 255, 255, 255, 200), 1, "default-bold", "center", "top", true, false ) startY = startY + 20 dxDrawText(getElementData(resourceRoot, "news:text") or "", startX, startY, endX, screenY, tocolor ( 255, 255, 255, 255 ), 1, "default-bold", "left", "top", true, true ) -- Right side local startX, startY = screenX/2.3, screenY/5 dxDrawText( "Welcome in this world,", startX, startY, 2000, 2000, tocolor ( 255, 255, 255, 255 ), 1.3, "default-bold" ) startY = startY + 20 dxDrawText( "the valhalla of role play.", startX+150, startY, 2000, 2000, tocolor ( 255, 255, 255, 255 ), 1.5, "default-bold" ) startY = startY + 50 dxDrawText( "Valhalla Gaming MTA Role Play is a role play gaming server using the Multi Theft Auto\nmultiplayer modification for Grand Theft Auto: San Andreas. Originally started in January\nof 2008 as MTA:RP the server has grown to 110,000+ lines of code.\n\nIf you're new here, you should know a few things. First of all, you need an account to\n play at our server. You can get one at our website, [url=http://www.mta.vg]http://www.mta.vg[/url] and look at the right side.\nWe are aiming for an as real as possible enviorment to roleplay in, thusfar we have\nsome rules that everyone need to stick to. You can view those rules by going to our\nsite, [url=http://mta.vg]http://mta.vg[/url] or pressing F1 ingame.\n\nIf you require any assistance in our server, hit F2 and ask your question straight away. Also\nthere it's possible to report another player if he or she doesn't follow the rules.\n\nWe hope that you have a good time at our server.\n\n- Valhalla Gaming MTA Team", startX, startY, screenX-startX, screenY-startY, tocolor ( 255, 255, 255, 255 ), 1, "default-bold" ) -- Upper right dxDrawImage(screenX - 140, 10, 131, 120, "img/valhalla1.png", 0, 0, 0, tocolor(255, 255, 255, alphaStep), false) dxDrawText("Version "..scriptVersion, screenX - 130, 130, 20, 120, tocolor ( 255, 255, 255, 150 ), 1, "default-bold" ) -- Banner down dxDrawImage(startX, 500, 542, 214, "banners/".. tostring(currentslide) ..".png", 0, 0, 0, tocolor(255, 255, 255, 200), false) end function LoginScreen_RefreshIMG() currentslide = currentslide + 1 if currentslide > totalslides then currentslide = 1 end end function LoginScreen_startRegister() LoginScreen_showWarningMessage( "You can register an account\nat [url=http://mta.vg]http://mta.vg[/url]! ) end --[[ LoginScreen_closeLoginScreen() - Close the loginscreen ]] function LoginScreen_closeLoginScreen() destroyElement(lUsername) destroyElement(tUsername) destroyElement(lPassword) destroyElement(tPassword) destroyElement(chkRememberLogin) destroyElement(bLogin) destroyElement(bRegister) --destroyElement(wLogin) killTimer(updateTimer) removeEventHandler( "onClientRender", getRootElement(), LoginScreen_RunFX ) end --[[ LoginScreen_validateLogin() - Used to validate and send the contents of the login screen ]]-- function LoginScreen_validateLogin() local username = guiGetText(tUsername) local password = guiGetText(tPassword) guiSetText(tPassword, "") appendSavedData("hashcode", "") if (string.len(username)<3) then outputChatBox("Your username is too short. You must enter 3 or more characters.", 255, 0, 0) else local saveInfo = guiCheckBoxGetSelected(chkRememberLogin) triggerServerEvent("accounts:login:attempt", getLocalPlayer(), username, password, saveInfo) if (saveInfo) then appendSavedData("username", tostring(username)) else appendSavedData("username", "") end end end local warningBox, warningMessage, warningOk = nil function LoginScreen_showWarningMessage( message ) if (isElement(warningBox)) then destroyElement(warningBox) end local x, y = guiGetScreenSize() warningBox = guiCreateWindow( x*.5-150, y*.5-65, 300, 120, "Attention!", false ) guiWindowSetSizable( warningBox, false ) warningMessage = guiCreateLabel( 40, 30, 220, 60, message, false, warningBox ) guiLabelSetHorizontalAlign( warningMessage, "center", true ) guiLabelSetVerticalAlign( warningMessage, "center" ) warningOk = guiCreateButton( 130, 90, 70, 20, "Ok", false, warningBox ) addEventHandler( "onClientGUIClick", warningOk, function() destroyElement(warningBox) end ) guiBringToFront( warningBox ) end addEventHandler("accounts:login:attempt", getRootElement(), function (statusCode, additionalData) if (statusCode == 0) then LoginScreen_closeLoginScreen() if (isElement(warningBox)) then destroyElement(warningBox) end -- Succesful login for _, theValue in ipairs(additionalData) do setElementData(getLocalPlayer(), theValue[1], theValue[2], false) end local newAccountHash = getElementData(getLocalPlayer(), "account:newAccountHash") appendSavedData("hashcode", newAccountHash or "") local characterList = getElementData(getLocalPlayer(), "account:characters") if #characterList == 0 then newCharacter_init() else Characters_showSelection() end elseif (statusCode > 0) and (statusCode < 5) then LoginScreen_showWarningMessage( additionalData ) elseif (statusCode == 5) then LoginScreen_showWarningMessage( additionalData ) -- TODO: show make app screen? end end ) local mysql = exports.mysql local salt = "" addEventHandler("accounts:login:request", getRootElement(), function () local seamless = getElementData(client, "account:seamless:validated") if seamless == true then outputChatBox("-- Migrated your session after a system restart", client, 0, 200, 0) setElementData(client, "account:seamless:validated", false, false, true) triggerClientEvent(client, "accounts:options", client) triggerClientEvent(client, "item:updateclient", client) return end triggerClientEvent(client, "accounts:login:request", client) end ); addEventHandler("accounts:login:attempt", getRootElement(), function (username, password, wantsLoginHash) local accountCheckQueryStr, accountData,newAccountHash,safeusername,safepassword = nil local cpypassword = password if (string.len(cpypassword) ~= 64) then password = md5(salt .. password) safeusername = mysql:escape_string(username) safepassword = mysql:escape_string(password) accountCheckQueryStr = "SELECT `id`,`username`,`banned`,`appstate`,`admin`,`adminduty`,`adminreports`,`hiddenadmin`,`adminjail`,`adminjail_time`,`adminjail_by`,`adminjail_reason`, `monitored` FROM `accounts` WHERE `username`='" .. safeusername .. "' AND `password`='" .. safepassword .. "'" else safeusername = mysql:escape_string(username) safepassword = mysql:escape_string(password) accountCheckQueryStr = "SELECT `id`,`username`,`banned`,`appstate`,`admin`,`adminduty`,`adminreports`,`hiddenadmin`,`adminjail`,`adminjail_time`,`adminjail_by`,`adminjail_reason`, `monitored` FROM `accounts` WHERE `username`='" .. safeusername .. "' AND `loginhash`='" .. safepassword .. "'" end local accountCheckQuery = mysql:query(accountCheckQueryStr) if (mysql:num_rows(accountCheckQuery) > 0) then accountData = mysql:fetch_assoc(accountCheckQuery) mysql:free_result(accountCheckQuery) -- Create a new safety hash, also used for autologin local newAccountHash = Login_calculateAutoLoginHash(safeusername) setElementDataEx(client, "account:seamlesshash", newAccountHash, false, true) if not (wantsLoginHash) then newAccountHash = "" end -- Check the account isn't already logged in local found = false for _, thePlayer in ipairs(exports.pool:getPoolElementsByType("player")) do local playerAccountID = tonumber(getElementData(thePlayer, "account:id")) if (playerAccountID) then if (playerAccountID == tonumber(accountData["id"])) and (thePlayer ~= client) then triggerClientEvent(client, "accounts:login:attempt", client, 1, "Account is already logged in." ) return false end end end -- Check if the account ain't banned if (tonumber(accountData["banned"]) == 1) then triggerClientEvent(client, "accounts:login:attempt", client, 2, "Account is disabled." ) return end -- Check the application state if (tonumber(accountData["appstate"]) == 0) then triggerClientEvent(client, "accounts:login:attempt", client, 5, "You need to send in an application to play on this server." ) return elseif (tonumber(accountData["appstate"]) == 1) then triggerClientEvent(client, "accounts:login:attempt", client, 4, "Your application is still pending." ) return elseif (tonumber(accountData["appstate"]) == 2) then triggerClientEvent(client, "accounts:login:attempt", client, 3, "Your application has been denied, you can remake one at [url=http://mta.vg]http://mta.vg[/url]. ) return end local forceAppCheckQuery = mysql:query("SELECT `username`,`appstate` FROM `accounts` WHERE `ip`='" .. mysql:escape_string(getPlayerIP(client)) .. "' OR `mtaserial`='" .. mysql:escape_string(getPlayerSerial(client)) .. "'") if forceAppCheckQuery then while true do local forceAppRow = mysql:fetch_assoc(forceAppQuery) if not forceAppRow then break end if (tonumber(forceAppRow["appstate"]) == 1) then triggerClientEvent(client, "accounts:login:attempt", client, 4, "Your application is still pending on account "..forceAppRow["username"].."." ) mysql:free_result(forceAppCheckQuery) return elseif (tonumber(forceAppRow["appstate"]) == 2) then triggerClientEvent(client, "accounts:login:attempt", client, 3, "Your application has been denied on account "..forceAppRow["username"]..", you can remake one at [url=http://mta.vg]http://mta.vg[/url]. ) mysql:free_result(forceAppCheckQuery) return end end end mysql:free_result(forceAppCheckQuery) -- Start the magic setElementDataEx(client, "account:loggedin", true, true) setElementDataEx(client, "account:id", tonumber(accountData["id"]), true) setElementDataEx(client, "account:username", accountData["username"], false) setElementDataEx(client, "adminreports", accountData["adminreports"], false) setElementDataEx(client, "hiddenadmin", accountData["hiddenadmin"], false) if (tonumber(accountData["admin"]) >= 0) then setElementDataEx(client, "adminlevel", tonumber(accountData["admin"]), false) setElementDataEx(client, "account:gmlevel", 0, false) setElementDataEx(client, "adminduty", accountData["adminduty"], false) setElementDataEx(client, "account:gmduty", false, true) else setElementDataEx(client, "adminlevel", 0, false) local GMlevel = -tonumber(accountData["admin"]) setElementDataEx(client, "account:gmlevel", GMlevel, false) if (tonumber(accountData["adminduty"]) == 1) then setElementDataEx(client, "account:gmduty", true, true) else setElementDataEx(client, "account:gmduty", false, true) end end if tonumber(accountData["adminjail"]) == 1 then setElementDataEx(client, "adminjailed", true, false) else setElementDataEx(client, "adminjailed", false, false) end setElementDataEx(client, "jailtime", tonumber(accountData["adminjail_time"]), false) setElementDataEx(client, "jailadmin", accountData["adminjail_by"], false) setElementDataEx(client, "jailreason", accountData["adminjail_reason"], false) if accountData["monitored"] ~= "" then setElementDataEx(client, "admin:monitor", accountData["monitored"], false) end local dataTable = { } table.insert(dataTable, { "account:newAccountHash", newAccountHash } ) table.insert(dataTable, { "account:characters", characterList( client ) } ) triggerClientEvent(client, "accounts:login:attempt", client, 0, dataTable ) local loginmethodstr = "manually" if (string.len(cpypassword) == 64) then loginmethodstr = "Autologin - "..cpypassword end exports.logs:dbLog("ac"..tostring(accountData["id"]), 27, "ac"..tostring(accountData["id"]), "Connected from "..getPlayerIP(client) .. " - "..getPlayerSerial(client) .. " (".. loginmethodstr ..")" ) mysql:query_free("UPDATE `accounts` SET `ip`='" .. mysql:escape_string(getPlayerIP(client)) .. "', `mtaserial`='" .. mysql:escape_string(getPlayerSerial(client)) .. "' WHERE `id`='".. mysql:escape_string(tostring(accountData["id"])) .."'") triggerEvent( "social:account", client, tonumber( accountData.id ) ) else mysql:free_result(accountCheckQuery) triggerClientEvent(client, "accounts:login:attempt", client, 1, "No combination found of the \nentered username/password." ) end end ); function Login_calculateAutoLoginHash(username) local finalhash = "" local chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" for i = 1, 64 do local rand = math.random(#chars) finalhash = finalhash .. chars:sub(rand, rand) end mysql:query_free("UPDATE `accounts` SET `loginhash`='".. finalhash .."' WHERE `username`='".. mysql:escape_string(username) .."'") return finalhash end function quitPlayer(quitReason, reason) local accountID = tonumber(getElementData(source, "account:id")) if accountID then local affected = { "ac"..tostring(accountID) } local dbID = getElementData(source,"dbid") if dbID then table.insert(affected, "ch"..tostring(dbID)) end exports.logs:dbLog("ac"..tostring(accountID), 27, affected, "Disconnected ("..quitReason or "Unknown reason"..") (Name: "..getPlayerName(source)..")" ) end end addEventHandler("onPlayerQuit",getRootElement(), quitPlayer) I brought this system from a guy for 2 euros, but he doesn't know how to fix it...
  7. --SERVER local jobMarker = createMarker (1942.57, 2184.79, 9.82, "cylinder", 1, 255, 0, 0, 127) local team = createTeam ( "Conductori de Locomotiva",255,255,0 ); addEventHandler ("onMarkerHit", jobMarker, function (hitPlayer) if (getElementType(hitPlayer) == "player") then triggerClientEvent ("viewGUI",source) outputChatBox ("Bun venit la gara Romana CFR.", hitPlayer, 255, 0, 0) end end ) addEvent("onAskToSetTeamAndSkin",true); addEventHandler("onAskToSetTeamAndSkin",root, function () spawnPlayer(source,-1937.09765625, 161.8310546875, 26.273441314697,0,61,0,0,team); end ); --CLIENT GUIEditor = { memo = {}, button = {}, window = {}, radiobutton = {}, tab = {}, label = {}, tabpanel = {}, } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(684, 215, 491, 334, "CFR - Sofer De Tren", false) guiSetVisible ( GUIEditor.window[1], false ) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 0.75) GUIEditor.button[1] = guiCreateButton(52, 169, 136, 65, "Angajeaza-te", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") GUIEditor.button[2] = guiCreateButton(299, 169, 136, 65, "Demisioneaza", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "default-bold-small") GUIEditor.button[3] = guiCreateButton(299, 259, 136, 65, "Închide", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[3], "default-bold-small") GUIEditor.memo[1] = guiCreateMemo(206, 180, 76, 85, "", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(252, 119, 70, 54, "", false, GUIEditor.window[1]) GUIEditor.memo[2] = guiCreateMemo(46, 35, 393, 124, " Bun venit la gara CFR!\nCautamt conductori de locomotiva, tot ce trebuie sa faci este sa conduci trenul si sa iei pasageri. Ia o colomotiva, o poti gasii pe sine, si incepeti slujba.\n\n Mult Succes!", false, GUIEditor.window[1]) guiMemoSetReadOnly(GUIEditor.memo[2], true) GUIEditor.tabpanel[1] = guiCreateTabPanel(178, 196, 60, 57, false, GUIEditor.memo[2]) GUIEditor.tab[1] = guiCreateTab("Tab", GUIEditor.tabpanel[1]) GUIEditor.radiobutton[1] = guiCreateRadioButton(191, 271, 75, 44, "", false, GUIEditor.window[1]) guiRadioButtonSetSelected(GUIEditor.radiobutton[1], true) end ) addEvent ("viewGUI", true) addEventHandler( "viewGUI" , root, function () guiSetVisible ( GUIEditor.window[1], true ) showCursor ( true ) end ) addEventHandler("onClientGUIClick", root, function() if ( source == GUIEditor.button[3] ) then guiSetVisible(GUIEditor.window[1], false) showCursor(false) end end ) addEventHandler("onClientGUIClick",GUIEditor.button[1], function () triggerServerEvent("onAskToSetTeamAndSkin",localPlayer); end ); Sorry for the late post, but I had a virus and I had to reinstall my windows. PS: I am a bit scared that people will steal the code, what can I do to protect it?
  8. Hm... for whatever reason when a player enters the marker, the GUI appear to every player from the server.
  9. I have been looking for the resouce J-Jobs like 2 months but I had no luck. I can't find it on the mta community or anywhere else. If someone have it or they know where I can find it please tell me. Thanks!
  10. Whats the function for spawning a train? Or to spawn a train and the player in it?
  11. No problem, I won't use the code. I want to learn and maybe make scripts by my own
  12. And this code works, thanks. ------- Now, I want to create a team, when a player clicks it, it shoud say, ''You are now an employed at the train station'' and the player should get a skin (I will decide what skin) and he also needs to be put in the specified team. Maybe a train should spawn on the rail. GUIEditor.button[1] = guiCreateButton(52, 169, 136, 65, "Angajeaza-te", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") And this is the button. Just give me an idea of how to make it, don't give me the whole function, I want to try on my own.
  13. Still nothing Thanks for helping me by the way...
  14. Hm.. it doesn't work.. GUIEditor = { memo = {}, button = {}, window = {}, tab = {}, label = {}, tabpanel = {}, } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(684, 215, 491, 334, "CFR - Sofer De Tren", false) guiSetVisible ( GUIEditor.window[1], false ) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 0.75) GUIEditor.button[1] = guiCreateButton(52, 169, 136, 65, "Angajeaza-te", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") GUIEditor.button[2] = guiCreateButton(299, 169, 136, 65, "Demisioneaza", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "default-bold-small") GUIEditor.button[3] = guiCreateButton(299, 259, 136, 65, "Închide", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[3], "default-bold-small") GUIEditor.label[1] = guiCreateLabel(252, 119, 70, 54, "", false, GUIEditor.window[1]) GUIEditor.memo[2] = guiCreateMemo(46, 35, 393, 124, " Bun venit la gara CFR!\nCautamt conductori de locomotiva, tot ce trebuie sa faci este sa conduci trenul si sa iei pasageri. Ia o colomotiva, o poti gasii pe sine, si incepeti slujba.\n\n Mult Succes!", false, GUIEditor.window[1]) guiMemoSetReadOnly(GUIEditor.memo[2], true) GUIEditor.tabpanel[1] = guiCreateTabPanel(178, 196, 60, 57, false, GUIEditor.memo[2]) GUIEditor.tab[1] = guiCreateTab("Tab", GUIEditor.tabpanel[1]) end ) addEvent ("viewGUI", true) addEventHandler( "viewGUI" , root, function () guiSetVisible ( GUIEditor.window[1], true ) showCursor ( true ) end ) addEventHandler("onClientGUIClick", GUIEditor.button[3], function() guiSetVisible(GUIEditor.window[1], false) showCursor(false) end ) Is the code right?
  15. It worked, thanks, now, how do I do this button GUIEditor.button[3] = guiCreateButton(299, 259, 136, 65, "Închide", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[3], "default-bold-small") A closing window button? PS: Just tell me what to do, I want to do the code by myself.
  16. ..:D&G:..

    [HELP] MySQL

    Yes, its my own computer, and I've used http://localhost, and I also setted up a username when I instaled mysql. I tried to re-install xampp but still no luck. -------EDITED------- Solved it! But I don't have any good gamemode, and I don't know scripting that much, and you also stoped working on your gamemode Thanks for your help!
  17. If I add the code to the client side, the marker will not appear at all...
  18. Non of this worked, I will try to fix it... I hope I will succed..
  19. Server: jobMarker = createMarker (-1973.02600, 117.74309, 27.68750, "cylinder", 1, 255, 0, 0, 127) addEvent ("viewGUI", true) function markerHit (hitPlayer, matchingDimension) if (source == jobMarker) then triggerClientEvent ("viewGUI", hitPlayer) outputChatBox ("Bun venit la gara Romana CFR.", hitPlayer, 255, 255, 0) end end addEventHandler ("onMarkerHit", getRootElement(), markerHit) Client: GUIEditor = { memo = {}, button = {}, window = {}, tab = {}, label = {}, tabpanel = {}, } function() theWindow = guiCreateWindow(684, 215, 491, 334, "CFR - Sofer De Tren", false) guiWindowSetSizable(theWindow, false) guiSetAlpha(theWindow, 0.75) GUIEditor.button[1] = guiCreateButton(52, 169, 136, 65, "Angajeaza-te", false, theWindow) guiSetFont(GUIEditor.button[1], "default-bold-small") GUIEditor.button[2] = guiCreateButton(299, 169, 136, 65, "Demisioneaza", false, theWindow) guiSetFont(GUIEditor.button[2], "default-bold-small") GUIEditor.button[3] = guiCreateButton(299, 259, 136, 65, "Închide", false, theWindow) guiSetFont(GUIEditor.button[3], "default-bold-small") GUIEditor.label[1] = guiCreateLabel(252, 119, 70, 54, "", false, theWindow) GUIEditor.memo[2] = guiCreateMemo(46, 35, 393, 124, " Bun venit la gara CFR!\nCautam conductori de locomotiva, tot ce trebuie sa faci este sa conduci trenul si sa iei pasageri. Ia o colomotiva, o poti gasii pe sine, si incepeti slujba.\n\n Mult Succes!", false, GUIEditor.window[1]) GUIEditor.tabpanel[1] = guiCreateTabPanel(178, 196, 60, 57, false, GUIEditor.memo[2]) GUIEditor.tab[1] = guiCreateTab("Tab", GUIEditor.tabpanel[1]) end addEventHandler ("onClientResourceStart", getRootElement(), resourceStart) function menuShow () visableornot = guiGetVisible (theWindow) if (visableornot == true) then guiSetVisible (theWindow, false) showCursor (false) end if (visableornot == false) then guiSetVisible (theWindow, true) showCursor (true) end end When I hit the marker, just the outputChatBox message shows, but the window doesn't... Whats wrong?
  20. Hello, I am trying to make a trian driver job, I have made the window, but I will need some help, I don't want no body to do it I just need some help. Window: GUIEditor = { memo = {}, button = {}, window = {}, radiobutton = {}, tab = {}, label = {}, tabpanel = {}, } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(684, 215, 491, 334, "CFR - Sofer De Tren", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 0.75) GUIEditor.button[1] = guiCreateButton(52, 169, 136, 65, "Angajeaza-te", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") GUIEditor.button[2] = guiCreateButton(299, 169, 136, 65, "Demisioneaza", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "default-bold-small") GUIEditor.button[3] = guiCreateButton(299, 259, 136, 65, "Închide", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[3], "default-bold-small") GUIEditor.memo[1] = guiCreateMemo(206, 180, 76, 85, "", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(252, 119, 70, 54, "", false, GUIEditor.window[1]) GUIEditor.memo[2] = guiCreateMemo(46, 35, 393, 124, " Bun venit la gara CFR!\nCautamt conductori de locomotiva, tot ce trebuie sa faci este sa conduci trenul si sa iei pasageri. Ia o colomotiva, o poti gasii pe sine, si incepeti slujba.\n\n Mult Succes!", false, GUIEditor.window[1]) guiMemoSetReadOnly(GUIEditor.memo[2], true) GUIEditor.tabpanel[1] = guiCreateTabPanel(178, 196, 60, 57, false, GUIEditor.memo[2]) GUIEditor.tab[1] = guiCreateTab("Tab", GUIEditor.tabpanel[1]) GUIEditor.radiobutton[1] = guiCreateRadioButton(191, 271, 75, 44, "", false, GUIEditor.window[1]) guiRadioButtonSetSelected(GUIEditor.radiobutton[1], true) end ) Now, first of all, I want to make it so when a player hits a marker the window pops up, I will try some functions from the wiki, but if you want to help me, thats fine. --------------------------EDITED!-------------------------- I have used this code for the server side. jobMarker = createMarker (1942.57, 2184.79, 9.82, "cylinder", 1, 255, 0, 0, 127) addEvent ("viewGUI", true) function markerHit (hitPlayer, matchingDimension) if (source == jobMarker) then triggerClientEvent ("viewGUI", hitPlayer) outputChatBox ("Bun venit la gara Romana CFR.", hitPlayer, 255, 0, 0) end end addEventHandler ("onMarkerHit", getRootElement(), markerHit) addEventHandler ("onClientResourceStart", getRootElement(), resourceStart) function menuShow () visableornot = guiGetVisible (theWindow) if (visableornot == true) then guiSetVisible (theWindow, false) showCursor (false) end if (visableornot == false) then guiSetVisible (theWindow, true) showCursor (true) end end I want to know if I need to add some more to it.
  21. ..:D&G:..

    [HELP] MySQL

    I have xampp instaled, it works fine, apache runs as it needs to ,but when I try to go on http://localhost it doesn't work. #1130 - Host '82.**.**.**' is not allowed to connect to this MySQL server Connection for controluser as defined in your configuration failed. PS: I won't show my IP..
  22. ..:D&G:..

    [HELP] MySQL

    Sorry for soo many questions. If I am annoying I am verry sorry, but I need help. So, I have a server, RPG, and I need a MySQL database for it. I have XAMPP, NAVICAT, and the Command Line, but I get some errors and I don't know how to solve them. I tried the many forums, and the apache forum, but I connot find a answer that explains clearly how to make a database from A to Z, or how to fix the errors, so if someone knows how to make it please tell me or you if you want to help me set it up from 0.
  23. Yes, because I use a resouce called flag, and that shows a flag of the country that a player is from, but I don't run it..
  24. Still the same thing.. [2013-03-07 19:41:53] ERROR: [admin]\admin\server\admin_ip2c.lua:20: attempt to perform arithmetic on a boolean value [2013-03-07 19:41:53] ERROR: call: failed to call 'admin:getPlayerCountry' [string "?"] -- This is a resource that shows a flag in scoreboard (country) [2013-03-07 19:41:53] WARNING: [admin]\admin\server\admin_ip2c.lua:15: Access denied @ 'getPlayerIP'
  25. You didn't help at all, but ''thanks'' any way...
×
×
  • Create New...