Jump to content

novo

Members
  • Posts

    325
  • Joined

  • Last visited

Everything posted by novo

  1. Maybe this: function invisible ( key, keyState ) local vehicles = getElementsByType ( "vehicle" ) local state = "Hiding" if ( keyState == "down" ) then setElementAlpha ( vehicles, 255 ) end outputChatBox ( "[iNFO]: Currently ".. state .." cars." ) end addEventHandler("onPlayerJoin", function(player) bindKey ( player, "F1", "up", invisible ) end ) Help plz ^^
  2. Hi all. I want make a script wich does for when you press "o", you don't see any car except your own. Please help me D:
  3. No errors, the position is fine because i took the positions of the starting code where text was showing. PD: Bad English..
  4. Mmm.. Race works but, text isn't showing
  5. Well... Yes.. I took this code ideas from my teamscript. (Where i call teams later) Anyways, thanks for correction.
  6. Server.lua: local t1 -- if we later call t1, this will help us. local t2 -- if we later call t2, this will help us. addEventHandler("onResourceStart", -- we add event for initiate function, on resource start. function() -- we start the function. t1 = createTeam("Team1", 255,0,0) --we create t1. setTeamFriendlyFire(t1, false) -- we set no friendly fire for t1. t2 = createTeam("Team2", 255,0,0) --we create t2. setTeamFriendlyFire(t1, false)-- we set no friendly fire for t2. end -- we close function. ) -- we close event.
  7. Hi all. I just made this code: local root = getRootElement() local player = getLocalPlayer() local counter = 0 local starttick local currenttick addEventHandler("onClientRender",root, function(player) if not starttick then starttick = getTickCount() end counter = counter + 1 currenttick = getTickCount() if currenttick - starttick >= 1000 then setElementData(player,"fps",counter) dxText:create('FPS:', screenWidth - 190, 1090, false, 'bankgothic', 1), dxText:create(tostring(getElementData( player, "counter" )), screenWidth - 190, 1110, false, 'bankgothic', 1), counter = 0 starttick = false end end ) I place it on race/race_client.lua, but the race got bugued on resource start. The idea is to make a text where you see your currently fps. Please help me <3 Bye.
  8. novo

    Help pls.

    Help me doesn't mean "make it for me".
  9. @myonlake: Ofc. I didn't post full code, anways, thank you for help and preocupation :]
  10. Thank you :] <3 EDIT: At bind function, was missing one "end".
  11. Hi all. I don't know why this function, isn't working: function bind(source) local accountname = getAccountName(account) if (isObjectInACLGroup("user." ..accountname, aclGetGroup("Admin"))) or (isObjectInACLGroup("user." ..accountname, aclGetGroup("VIP"))) then if (guiGetVisible(iphone) == true) then if not animacion then cerrar(localPlayer) end else if not animacion then guiSetVisible(iphone, true) setElementData (localPlayer,"panel","main") addEventHandler ("onClientRender", root, sacarSXPhone) end end end end bindKey("I","down", bind) addCommandHandler ("iphone", bind) addEventHandler ("onPlayerLogin", root, bind) Plz help <3
  12. novo

    Buy map bug D:

    Sorry for double post. Now my server is v. 1.2, on the userpanel now the maps are showing. But same error:
  13. addEventHandler('onClientPlayerJoin', root, function() local link1 = ( "http://www.mysound1.com/sound1" ) local link2 = ( "http://www.mysound1.com/sound2" ) randomlinks = math.random(link1,link2) playSound ( randomlinks ) end )
  14. function links (link) local link1 = ( "http://www.mysound1.com/sound1" ) local link2 = ( "http://www.mysound1.com/sound2" ) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() playSound(sounds[math.random(1, links)]) end ) EDIT: The Handler, starts the music when resource starts, you must change if want music on join.
  15. In your code, like JR10 said, thePlayer wasn't defined at function, here you have YOUR CODE EDITED: function BugFix( thePlayer ) local x = 2153 local y = 1012 local z = 12 spawnPlayer(thePlayer, x, y, z) fadeCamera(source, true) setCameraTarget(source, source) outputChatBox("Welcome to the #00FF00 TBG Server!#0000ff Press F1 for info,etc", source, 255, 0, 0, true) end addEventHandler("onPlayerJoin", getRootElement(), BugFix)
  16. Clipper, i get your idea. I don't know to script that, but i want tell you that you won't get help here if you don't pay. I think that you mean ffs training script, when you die, you get respawn if you press "ENTER". Anyways, good luck and welcome.
  17. novo

    Buy map bug D:

    It's on a full panel, when i press "F7" the panel opens. Then, i have a tab called "Maps" where i see the list of maps, and they aren't showing. Ofc, server=server - client=client. Come to my server and check it: 109.70.148.17:22021 Bye <3
  18. novo

    Buy map bug D:

    When i open tab for map list, i cant see maps D: Plz help <3
  19. novo

    Buy map bug D:

    Sorry for double post but i really need help. HELP ME <3
  20. novo

    Buy map bug D:

    Hi all. I made a shop for buy map, but it's not working. EDIT: There is an error: Bad argument "#1" to "ipairs" (table expected, got bolean) Here is my code: Client-Side: -------------------------- MAP SHOP --------------------------------- mapTab = guiCreateTab("Maps",GUIEditor_TabPanel[1]) mapList = guiCreateGridList(4,5,554,166,false,mapTab) guiGridListSetSelectionMode(mapList,2) buyMap = guiCreateButton(4,173,187,41,"Buy map",false,mapTab) rateMap = guiCreateButton(196,173,121,41,"Rate this map",false,mapTab) rateValue = guiCreateEdit(318,172,51,42,"",false,mapTab) reportMap = guiCreateButton(371,172,186,42,"Report this map",false,mapTab) authorMapColumn = guiGridListAddColumn( mapList, "Author", 0.2 ) mapMapColumn = guiGridListAddColumn( mapList, "Name", 0.5 ) guiGridListSetSortingEnabled ( mapMapColumn, false ) guiGridListAutoSizeColumn( list_avatar, authorMapColumn) triggerServerEvent('getMaps', getRootElement()) addEvent('sendMaps', true) addEventHandler('sendMaps', getRootElement(), function(name, author) local row = guiGridListAddRow(mapList) guiGridListSetItemText(mapList, row, 1, name, false, false) guiGridListSetItemText ( mapList, row, authorMapColumn, author, false, false ) guiGridListSetItemText ( mapList, row, mapMapColumn, name, false, false ) end ) addEventHandler('onClientGUIClick', buyMap, function() local row, mapMapColumn = guiGridListGetSelectedItem(mapList) local map = guiGridListGetItemText(mapList, row, mapMapColumn) triggerServerEvent("buyMapFromPanel", getLocalPlayer(), map) end , false) Server-side: -------------- MAP -------------------- function mapsList() local resourceTable = getResources() for resourceKey, resourceValue in ipairs(resourceTable) do local name = getResourceInfo(resourceValue, 'name') local type = getResourceInfo(resourceValue, 'type') local game = getResourceInfo(resourceValue, 'gamemodes') local author = getResourceInfo(resourceValue, 'author') if type == 'map' and game == 'race' then triggerClientEvent('sendMaps', getRootElement(), name, author) else cancelEvent() end end end addEvent('getMaps', true) addEventHandler('getMaps', getRootElement(), mapsList) addEvent('buyMapFromPanel', true) function buyMFP(mapname) if g_ForcedNextMap then outputChatBox('#575757[shop]#c8c8c8Next map is '..getMapName(g_ForcedNextMap),source,255,255,0, true) return end local query = #{mapname}>0 and table.concat({mapname},' ') or nil if not query then if g_ForcedNextMap then outputChatBox('#575757[shop]#c8c8c8Next map is '..getMapName(g_ForcedNextMap),source,255,255,0, true) else outputChatBox('#575757[shop]#c8c8c8Next map is not set',source,255,255,0, true) end return end local map, errormsg = findMap(query) if not map then outputChatBox(errormsg, source) return end if lastmap_B == map then outputChatBox('#575757[shop]#c8c8c8That map has been palyed too much recently !',source,255,255,0, true) else g_ForcedNextMap = map local nameAh = getPlayerName(source) local nameAhB = string.gsub(nameAh, "#%x%x%x%x%x%x", "") outputChatBox('#575757[shop]#c8c8c8'..nameAhB..' bought map '..getMapName(g_ForcedNextMap)..' for $3500.',getRootElement(),255,255,0, true) givePlayerMoney(source, -3500) setElementData(source, 'Money', getPlayerMoney(source)) lastmap_B = g_ForcedNextMap end end addEventHandler('buyMapFromPanel', getRootElement(), buyMFP) Please help <3 Thanks.
  21. novo

    What is wrong ?

    What is wrong here ? function (player,cmd,numbermax, playerSource) if ( hasObjectPermissionTo ( playerSource, "command.zsetmax", false ) ) then if ( hasObjectPermissionTo ( getThisResource (), "command.zsetmax", true ) ) then if not numbermax then return end setMaxPlayers(tonumber (numbermax)) local maxPlayers = getMaxPlayers() outputChatBox("#00FFFF* #FFB900Server max. slots changed to: #FFFFFF" .. maxPlayers .." #00FFFFof #FFFF001024 #00ffffmax.", getRootElement(),255,255,255,true) else outputChatBox ( "zsetmaxplayers: The script isn't added on Admin acl group. Please, add it.", playerSource ) end else outputChatBox ( "zsetmaxplayers: Not enought rights.", playerSource ) end end addCommandHandler ("zsetmaxplayers", ) When i do /zsetmaxplayers number, it tell me zsetmaxplayers: Not enought rights, when i have the right command.zsetmax added to Admin ACL and the resource added to Admin ACL Group. Please help D:
×
×
  • Create New...