Jump to content

audi868

Members
  • Posts

    14
  • Joined

  • Last visited

Details

  • Gang
    XG

audi868's Achievements

Square

Square (6/54)

0

Reputation

  1. audi868

    dx functions

    Thanks for the help.
  2. audi868

    dx functions

    Firstly, I am having some problems with dx functions. Client addEvent("achUnlock",true) function AchieivementUnlocked ( txt ) dxDrawImage(439.0,625.0,409.0,83.0,"ach.png",0.0,0.0,0.0,tocolor(255,255,255,180),false) dxDrawText(txt,539.0,671.0,812.0,700.0,tocolor(0,0,0,255),0.5,"bankgothic","left","top",true,true,false) end function achUnlock ( txt ) addEventHandler("onClientRender",root,AchieivementUnlocked) AchieivementUnlocked( txt ) end addEventHandler("achUnlock", root, achUnlock) Server addCommandHandler("ach",function(s) triggerClientEvent(s, "achUnlock", s, "test") end ) Results: Bad argument @dxDrawText on line 4. Second, Is there a way to make the dxtext visible to a defined player only?
  3. audi868

    Set next map

    My bad, I was trying it on a un-named map. ty btw
  4. audi868

    Set next map

    Bad argument at getResourceName, and the nextmap doesn't starts too
  5. create a table for teams. e.g copTeams = {["Team"]=true,["Team2"]=true} replace copSkins[getElementModel ( player )] ) with copTeams[getTeamName(getPlayerTeam( player ))]
  6. audi868

    Set next map

    Any help? It is returning errors at setting cmd. function nextmap(source,cmd,...) nextmapname = table.concat({...}," ") for k,v in ipairs(getResources()) do local name = getResourceInfo(v,'name') if name == nextmapname then nextmap = v end end outputChatBox("Nextmap set to "..getResourceName(nextmap),source) end addCommandHandler("nm",nextmap) addEvent("onGamemodeMapStop") addEventHandler("onGamemodeMapStop",root,function() if not (nextmap) == nil then local map = nextmap startResource(map) nextmap = nil end end )
  7. I want to get the name of the map for my client sided script, but it is returning nil on client Server: root = getRootElement() mapmanager = getResourceFromName("mapmanager") addEvent("getCurrentMap",true) function getCurrentMap() local name = call(mapmanager,"getRunningGamemodeMap") return name end addEventHandler("getCurrentMap",root,getCurrentMap) Client: glp = getLocalPlayer() bindKey("F3","down",function() window = {} sx,sy = guiGetScreenSize() window['main'] = guiCreateWindow((sx/2)-320,(sy/2)-240,640,480,"My window",false) window['map'] = guiCreateLabel(0.4043,0.8478,0.589,0.1425,"",true,window['main']) local currentMap = getResourceName(triggerServerEvent("getCurrentMap",glp)) guiSetText(window['map'],currentMap) end )
  8. Still not working P/S: solved by using guiSetText(shop["info".. infoindex],info) I appreciate your help.
  9. guiSetText(shop['info1'],info) how should I get in which memo would the text be placed then? cuz I have two memos P/S: Where so? I mean line?
  10. Doesn't sets the memo text to the info, root = getRootElement() sx,sy = guiGetScreenSize() addCommandHandler("shop",function() shop = {} shop['window'] = guiCreateWindow((sx/2)-320,(sy/2)-240,640,480,"Shop",false) shop['info1'] = guiCreateMemo(0.3644,0.1812,0.4759,0.3068,"",true,shop['window']) shop['info2'] = guiCreateMemo(0.3644,0.6039,0.4759,0.3068,"",true,shop['window']) loadShop() end ) function itm1(x,y,w,h,text,info) local btn = guiCreateButton(x,y,w,h,text,true,shop['window']) setElementData(btn,"infoindex",1) setElementData(btn,"info",info) end function itm2(x,y,w,h,text,info) local btn = guiCreateButton(x,y,w,h,text,true,shop['window']) setElementData(btn,"infoindex",2) setElementData(btn,"info",info) end function loadShop() itm1(0.1714,0.1787,0.1597,0.0652,"Flip","Flip your car for $500") -- this for test end function getItemInfo() if getElementData(source,"info") then local infoindex = getElementData(source,"infoindex") local info = getElementData(source,"info") local infoMemo = "shop['info"..infoindex.."']" guiSetText(infoMemo,info) end end addEventHandler("onClientMouseEnter",root,getItemInfo) I tried to debug using outputChatBox(info) under getItemInfo works but still doesn't works for the memo
  11. Hi, I am making a kills/deaths save script on accountData and I want to retrieve the kills/deaths on login but it is not working in proper way, i.e it does not loads the kills/deaths on login here is my code, root = getRootElement() addEventHandler("onPlayerLogin",root,function(account) local kills = getAccountData(account,"kills") local deaths = getAccountData(account,"deaths") if not (deaths and kills) then return end setElementData(source,"kills",kills) setElementData(source,"deaths",deaths) outputDebugString("Player score set") end )
×
×
  • Create New...