Jump to content

Newbie

Members
  • Posts

    208
  • Joined

  • Last visited

Everything posted by Newbie

  1. Newbie

    race state

    It starts when state is LoadingMap but dont stops when state loadingMap finished
  2. Newbie

    race state

    Still dont work
  3. Newbie

    race state

    I think it dont work because i'd had to remove this line: addEventHandler("onClientRender",getRootElement(),renderPulse)
  4. Newbie

    race state

    Did i fail ? Client: local x,y = guiGetScreenSize() local defScale = 1 local currentScale = defScale local maxScale = 2 local step = 0.05 -- How fast to change the size local turn = true -- true = increase size, false = decrease size local text = "Loading next map" local font = dxCreateFont("myFont.ttf",10) function myClientFunction_Handler() if turn == true then -- If we increase the value currentScale = currentScale + step if currentScale > maxScale then currentScale = maxScale turn = false -- Reached max? Then make it go back end else currentScale = currentScale - step if currentScale < defScale then currentScale = defScale turn = true end end local width = dxGetTextWidth(text,currentScale,font) local height = dxGetFontHeight(currentScale,font) dxDrawText(text,x/2-width/2,y/2-height/2,width,height,tocolor(255,255,255,255),currentScale,font) end addEvent("myEvent", true) addEventHandler("myEvent", getRootElement(), myClientFunction_Handler) Server: function exampleFunction_Handler(newState, oldState) if(newState == "LoadingMap") then triggerClientEvent(playerElement, "myEvent", getRootElement()) end end addEvent("onRaceStateChanging", false) addEventHandler("onRaceStateChanging", getRootElement(), exampleFunction_Handler)
  5. Newbie

    race state

    A little help mby ? function exampleFunction_Handler(newState, oldState) if(newState == "LoadingMap") then triggerClientEvent ( dont know what to write here.) end end addEvent("onRaceStateChanging", false) addEventHandler("onRaceStateChanging", getRootElement(), exampleFunction_Handler)
  6. Newbie

    race state

    Yes its yours, i find dat in forum. Thanks
  7. Newbie

    race state

    Well, i know. Thats why im asking bcz my code is client sided
  8. Newbie

    race state

    local x,y = guiGetScreenSize() local defScale = 1 local currentScale = defScale local maxScale = 2 local step = 0.05 -- How fast to change the size local turn = true -- true = increase size, false = decrease size local text = "Loading next map" local font = dxCreateFont("myFont.ttf",10) function renderPulse() if turn == true then -- If we increase the value currentScale = currentScale + step if currentScale > maxScale then currentScale = maxScale turn = false -- Reached max? Then make it go back end else currentScale = currentScale - step if currentScale < defScale then currentScale = defScale turn = true end end local width = dxGetTextWidth(text,currentScale,font) local height = dxGetFontHeight(currentScale,font) dxDrawText(text,x/2-width/2,y/2-height/2,width,height,tocolor(255,255,255,255),currentScale,font) end addEventHandler("onClientRender",getRootElement(),renderPulse) I need to make this work only if race state is "LoadingMap"
  9. Newbie

    Camera Pos

    Hello Community. I'd like to ask some, when i come to servers, some servers has default (black) screen while downloading files, but there's servers wich its not black, but it shows some part of GTA SA World, like San Fierro How its made ?
  10. Newbie

    a nil value

    I've have fixed it by changing to getMapName from mapName and adding function to read the resource name of the selected map to make it match with buyMap function
  11. Newbie

    a nil value

    You didn't solved my problem
  12. Newbie

    a nil value

    I'ma trying to make a map shop, when i select map on gridlist and press button to buy i get this: attempt to callServerFunction a nil value Server: function buyMap(player, command, ...) local account = ( ( getPlayerAccount( player ) and not isGuestAccount( getPlayerAccount( player ) ) ) and getPlayerAccount( player ) or false ) if ( account ) then local cashHave = tonumber( getAccountData( account, "Cash" ) ) local buyMapss = tonumber( getAccountData( account, "BuyMaps" ) ) if g_ForcedNextMap then outputChatBox( 'Next map is ' .. getMapName( g_ForcedNextMap ), player ) return end local query = #{...}>0 and table.concat({...},' ') or nil if not query then if g_ForcedNextMap then outputChatBox( '#FF0000={#FFFFFFBuyMap#FF0000}=#FFFFFF Next map is ' .. getMapName( g_ForcedNextMap )"", player, 255, 0, 0, true) else outputChatBox( '#FF0000={#FFFFFFBuyMap#FF0000}=#FFFFFF Next map is not set', player, 255, 0, 0, true ) end return end local map = findMap(query) if not map then outputChatBox(errormsg, player) return end if ( cashHave ) and ( cashHave >= 3000 ) then if lastmap_B == map then outputChatBox( '#FF0000={#FFFFFFBuyMap#FF0000}=#FFFFFF That map has been played too much recently.', player, 255, 0, 0, true) else g_ForcedNextMap = map outputChatBox("#FF0000={#FFFFFFBuyMap#FF0000}=#FFFFFF "..getPlayerName(player).. " #FFFFFFbought next map to be #FF0000'" ..getMapName(g_ForcedNextMap).. "'", g_Root, 255, 255, 255, true) setAccountData( account, "Cash", cashHave - 3000 ) setAccountData( account,"BuyMaps",tostring( getAccountData( account,"BuyMaps" ) or 0 )+1 ) lastmap_B = g_ForcedNextMap end else outputChatBox("#FF0000={#FFFFFFBuyMap#FF0000}=#FFFFFF You don't have enough money! #FF00003000$", player, 255, 0, 0, true) end end end addCommandHandler('bm', buyMap) addCommandHandler('buymap', buyMap) Client: function buyNextMap() local row,column = guiGridListGetSelectedItem(mapGridList) local mapName = guiGridListGetItemText(mapGridList,row,1) callServerFunction("buyMap",getLocalPlayer(),mapName) end addEventHandler ( "onClientGUIClick", GUIEditor.button[4], buyNextMap, false )
  13. Oh Thanks. How can i edit GridList scroll box ? Or even hide it ? (better way)
  14. Sure function mapsList() local resourceTable = getResources() triggerClientEvent ( "clearGridList", getRootElement() ) for resourceKey, resourceValue in ipairs(resourceTable) do local name = getResourceName(resourceValue) local type1 = getResourceInfo ( resourceValue, "type" ) local gamemode1 = getResourceInfo ( resourceValue, "gamemodes" ) if type1 == "map" and gamemode1 == "race" then triggerClientEvent ( "sendMaps", getRootElement(), name) else cancelEvent() end end end addCommandHandler( "sendMaps", mapsList, false, false ) addEventHandler("onPostFinish",getRootElement(),mapsList)
  15. Here's how gridlist looks: http://i.imgur.com/cdJ7Zhj.png Is there any way to hide or edit shroll bar of gridlist ? and i need to show maps as a name's from meta and not as a resources name. mapGridList = guiCreateGridList(x/3.6, y/3.0, 417, 275, false) mapsColumn = guiGridListAddColumn(mapGridList,"Maps",0.85) guiGridListSetSelectionMode(mapGridList,1) addEvent("sendMaps", true ) function sendmaps(name) row = guiGridListAddRow ( mapGridList ) guiGridListSetItemText ( mapGridList, row, mapsColumn, name, false, false ) end addEventHandler( "sendMaps", getLocalPlayer(), sendmaps ) addEvent( "clearGridList", true ) function clearGridList() guiGridListClear( mapGridList ) end addEventHandler( "clearGridList", getLocalPlayer(), clearGridList )
  16. Newbie

    guiCreateEdit

    Can you show an example please ?
  17. Newbie

    guiCreateEdit

    Hello. I need help while creating search box for gridlist Here's the edit box GUIEditor_edit[1] = guiCreateEdit(25,50,225,25,"",false) And i have a qestion, is it possible to edit gridlist shroll box, if yes what's the easiest way ? Thanks in advice.
  18. Newbie

    Display maps

    Did it already.
  19. Newbie

    Display maps

    Hello. GUIEditor_edit[1] = guiCreateEdit(54, 168, 217, 32, "", false) GUIEditor_gridlist[1] = guiCreateGridList(54, 200, 217, 292, false) GUIEditor_gridlist[1], heh here i need to display server maps and here [lua]GUIEditor_edit[1] search for maps. its for panel.
  20. Newbie

    Help needed

    no you didn't understood. I want to do if a player clicks on button, and then dxtext's appears (shows)
  21. Newbie

    Help needed

    Here's dx text: dxDrawText("Your deadmaches are:", x/3.6, y/3.0, 636, 265, tocolor(255, 255, 255, 255), 0.60, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Your wins are:", x/3.6, y/2.7, 636, 293, tocolor(255, 255, 255, 255), 0.60, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Your deaths are:", x/3.6, y/2.45, 636, 321, tocolor(255, 255, 255, 255), 0.60, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Your hunters are:", x/3.6, y/2.25, 636, 348, tocolor(255, 255, 255, 255), 0.60, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Your cash are:", x/3.6, y/2.07, 636, 375, tocolor(255, 255, 255, 255), 0.60, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Your exp are:", x/3.6, y/1.925, 636, 402, tocolor(255, 255, 255, 255), 0.60, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Maps you bought:", x/3.6, y/1.80, 636, 429, tocolor(255, 255, 255, 255), 0.60, "bankgothic", "left", "top", false, false, true, false, false) Here's button: GUIEditor.button[1] = guiCreateButton(x/1.7, y/3.55, 56, 19, "", false) guiSetAlpha ( GUIEditor.button[1], 0 ) I cant understand how to do that when i click on button my dx's shows.. I triend onClientGuiClick - failed. Can anyone help ?
  22. Newbie

    dxDrawText

    dxDrawText("STATS", x/1.7, y/3.55, 55, 15, tocolor(255, 255, 255, 255), 0.40, "bankgothic", "left", "top", false, false, false, false, false) Is there any way to detect if player clicks on the text ?
  23. Newbie

    Will pay

    Still need scripter. PM me if you interested
×
×
  • Create New...