Jump to content

K4stic

Members
  • Posts

    708
  • Joined

  • Last visited

Everything posted by K4stic

  1. K4stic

    gui help

    how i can updatable that items local getoccup = getElementData( getLocalPlayer(), "Occupation" ) local getmoney = getPlayerMoney(getLocalPlayer()) local getserial = getPlayerSerial(getLocalPlayer()) local totalkills = getElementData( getLocalPlayer(),"TK" ) or 0 local totaldeaths = getElementData( getLocalPlayer(),"TD" ) or 0 local totalkillsdeaths = getElementData( getLocalPlayer(),"KDR" ) or 0 function menuShow () visableornot = guiGetVisible (theWindow2) if (visableornot == true) then guiSetVisible (theWindow2, false) showCursor (false) guiSetText(label,"",true) guiSetText(label1,"",true) guiSetText(label2,"",true) guiSetText(label3,"",true) guiSetText(label4,"",true) guiSetText(label5,"",true) guiSetText(label6,"",true) elseif (visableornot == false) then guiSetVisible (theWindow2, true) showCursor (true) guiSetText(label,"Your Correct Occupation: "..getoccup,false) guiSetText(label1,"Your name: "..getPlayerName(getLocalPlayer()),false) guiSetText(label2,"Your name: $"..tostring(getmoney),false) guiSetText(label3,"Your Serial is: "..tostring(getserial),false) guiSetText(label4,"Your Total Kills: "..tostring(totalkills),false) guiSetText(label5,"Your Total Deaths: "..tostring(totaldeaths),false) guiSetText(label6,"Your Total KDR: "..tostring(totalkillsdeaths),false) end end --and last this for id, player in ipairs(getElementsByType("player")) do guiComboBoxAddItem(guicomboBox, getPlayerName(player)) end
  2. K4stic

    label help

    thx lol so easy just add a getLocalPlayer()
  3. K4stic

    label help

    function menushow () local getoccup = getElementData( source, "Occupation" ) visibleornot =guiGetVisible (theWindow2) if (Visibleornot == true) then guiSetVisible (theWindow2, false) showCursor (false) guiSetText(label,"",true) end if (Visibleornot == false) then guiSetVisible (theWindow2, true) showCursor (true) guiSetText(label,"Your Correct Occupation: "..getoccup,false) end end error line 12 and warning at line 2
  4. if need full code just say
  5. so you can help me yes or no Community PLS HELP me
  6. function blablabla (hitPlayer) local vehicle = getPedOccupiedVehicle(hitPlayer) local speed = getElementSpeed(vehicle,1) if speed < 30 then function getElementSpeed(element,unit) if (unit == nil) then unit = 0 end if (isElement(element)) then local x,y,z = getElementVelocity(element) if (unit=="mph" or unit==1 or unit =='1') then return (x^2 + y^2 + z^2) ^ 0.5 * 100 else return (x^2 + y^2 + z^2) ^ 0.5 * 1.61 * 100 end else return false end end on first 5 lines is the one part of all code so i just no add end to this 5 lines the error at line 5: attempt to compare boolean with number
  7. Thx you one ask how make it to then every 1 player join give to all 4k and every 10 players give 10k i mean like the Peak is 9 all have take per 1 joined player 4k and then joined the 10 to give all 10k Sorry for my bad english
  8. Try this code --Server Side jobMarker = createMarker (1942.57, 2184.79, 9.82, "cylinder", 1, 255, 0, 0, 127) 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)) --Client Side 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 ) function menuShow () visableornot = guiGetVisible (GUIEditor.window[1]) if (visableornot == true) then guiSetVisible (GUIEditor.window[1], false) showCursor (false) end if (visableornot == false) then guiSetVisible (GUIEditor.window[1], true) showCursor (true) end end addEvent ("viewGUI", true) addEventHandler( "viewGUI" , root, menuShow)
  9. So this is Ok? local peakPlayers = getPlayerCount() function playerCountUp () if peakPlayers < getPlayerCount() then peakPlayers = peakPlayers + 1 outputChatBox ( "New player peak reached, "..peakPlayers.."! Here is some bonus cash.", getRootElement(), 0, 0, 255) local players = getElementsByType ( "player" ) for theKey,thePlayer in ipairs(players) do if peakPlayers < 1000 then givePlayerMoney(thePlayer, 4000) end end end end addEventHandler ( "onPlayerLogin", getRootElement(), playerCountUp ) function resourceStartpeak() if getResourceFromName ( "peak" ) then getAccountData ( getAccount ( "Console" ), "playerPeak", number ) end addEventHandler( "onResourceStart", getRootElement(), resourceStartpeak ) addEventHandler ( "onResourceStop", root, function () if getResourceFromName ( "peak" ) then setAccountData ( getAccount ( "Console" ), "playerPeak", number ) end)
  10. but i don't know use Console as Account Data
  11. can you give me more example?
  12. i only know i need use onResourceStop and onResourceStart but how don't know so pls help me is a community PEAK Script by coolerchiller i wonna then the resource stop to save the peak of player and then resource start again to load that number of plyers --Server side local peakPlayers = getPlayerCount() function playerCountUp () if peakPlayers < getPlayerCount() then peakPlayers = peakPlayers + 1 outputChatBox ( "New player peak reached, "..peakPlayers.."! Here is some bonus cash.", getRootElement(), 0, 0, 255) local players = getElementsByType ( "player" ) for theKey,thePlayer in ipairs(players) do if peakPlayers < 1000 then givePlayerMoney(thePlayer, 4000) end end end end addEventHandler ( "onPlayerLogin", getRootElement(), playerCountUp )
  13. realy thx and thx for report bugs code fixed: http://pastebin.com/M181Tbf5
  14. K4stic

    HELP My_SQL

    WARNING: @mysql.lua:5: Bad argument @ 'dbPoll' [Expected db-query at argument 1, got boolean] WARNING: @mysql.lua:4: Bad argument @ 'dbQuery' [Expected string at argument 2, got nil] -- Exported functions function query( ... ) if connection then local qh = dbQuery( connection, ... ) local result = dbPoll( qh, -1 ) return result else return false end end -- DB exec as used function exec( str, ... ) if connection then local qh = dbExec( connection, str, ... ) return qh else return false end end i use the My_SQL with this method the dbExec: exports.SCGmysql:exec( "INSERT INTO `groups` (`name`, `leader`, `groupinfo`, `active`) VALUES (?, ?, ?, ?)", group, account, "This group has no info", 1) exports.SCGmysql:exec( "UPDATE `users` SET `group` =? WHERE `account` =?", group, account) exports.SCGmysql:exec( "UPDATE `users` SET `groupL` =? WHERE `account` =?", 2, account) and it output me error => WARNING: @mysql.lua:15: dbExec failed; Table 'db_945.groups' doesn't exist
  15. K4stic

    1337land

    Map Perfect like and your Others where i can download it?
  16. K4stic

    help

    your welcome!
  17. K4stic

    help

    try this function giveMoney ( thePlayer, thevehicle ) local id = getElementModel ( thevehicle ) if id == 431 or 437 then local gpm = getElementData ( thePlayer, "buszp" ) if ((gpm) > 0 ) then givePlayerMoney ( thePlayer, tonumber( gpm ) ) outputChatBox ( "Ai castigat " .. gpm .. "$", thePlayer, 0, 140, 240 ) setElementData ( thePlayer, "buszp", 0 ) end end end addEventHandler("onVehicleExit", rootElement, giveMoney) addEventHandler("onPlayerQuit", rootElement, giveMoney)
  18. K4stic

    [HELP] wanted

    line 3: attempt to compare nil with number line 11: attempt to compare number with nil --Client side -- Check if player didn't get negative wanted points function checkWanted () if (tonumber(getElementData(localPlayer, "wantedLevel")) < 0) then setElementData(localPlayer, "wantedLevel",0.0) end end setTimer(checkWanted,30000,0) -- Lowers the wanted points from players function lowerWanted () if (tonumber(getElementData(localPlayer, "wantedLevel")) > 0) then setElementData(localPlayer, "wantedLevel", getElementData(localPlayer, "wantedLevel")-0.5) end end setTimer(lowerWanted,60000,0) line 6: attempt to concatenate a boolean value --Server side -- Show your wantedlevel only the level not the stars function show_wanted_level(player) if getElementData( player, "wantedLevel") == 0.0 then outputChatBox ( "Your wantedlevel is " .. getElementData( player, "wantedLevel"), player, 0, 200, 0 ) else outputChatBox ( "Your wantedlevel is " .. getElementData( player, "wantedLevel"), player, 200, 0, 0 ) end end addCommandHandler("wl", show_wanted_level)
×
×
  • Create New...