Jump to content

karlis

Members
  • Posts

    1,314
  • Joined

  • Last visited

Everything posted by karlis

  1. make one on zmodeler or 3dsmax and import with mta engine.
  2. i said, thats in case "result" is a table, but seems its boolean(true/false) as it would be no sense to be true, its false, and that means getting the mySQL results failed. sorry, need someone else to help you with MySQL, thats out of my knowledge.
  3. givePlayerMoney ( value, cash) --you have to specify amount of cash given im not familiar with MySQL, but if results variable is table containing the player bank account info, use (as i read, the key of table is player itself) givePlayerMoney ( value, result[value]*0.1) EDIT:also 1 ' " ' is missing in line 8.
  4. karlis

    Will this work?

    propably false, but may be nil also
  5. you have to specify the names of all files containing in the folder.
  6. you could use dxDrawRectangle, but it would be hell cpu consuming.
  7. i agree the performance improvement is minor, but then script doesn't even bother to make that variable, even local. we all should try to make our scripts as efficient as possible
  8. slight improvement in citizen's code would be to not store x and y, as you dont need them, use this line local _,_,z = getelementPosition(player)
  9. karlis

    Friendly Fire

    Citizens = createTeam(text,r,g,b) [S.T.A.R.S] = createTeam(text,r,g,b) Private Corp = createTeam(text,r,g,b) Girls = createTeam(text,r,g,b) setTeamFriendlyFire(citizens,false) setTeamFriendlyFire([S.T.A.R.S],false) setTeamFriendlyFire(Private Corp,false) setTeamFriendlyFire(Girls,false) end) i found 7 syntax errors here, you should reread wiki.
  10. nope you cannot, if you want to see both at same time but since 1.1 it will be possible to replace other vehicle by desired one, and adjust handling too.
  11. clearly needs some fixes, also imo tis better to use built in functions if aviable. local myteam = createTeam("mtasa.com") function getAlivePlayersInTeam(theTeam) local table = { } local players = getPlayersInTeam(theTeam) for i,v in pairs(players) do if not isPedDead(v) then table[#table+1]=v end end return table end
  12. karlis

    Chatbox Ads

    why not prevent it then, instead of writing warnings in caps? local lastRnd=0 function advert() local rnd = math.random( 1, #adMessages ) while rnd == lastRnd and #adMessages > 1 do rnd = math.random( 1, #adMessages ) end outputChatBox( adMessages[ rnd ], getRootElement(), 255, 255, 255, true ) lastRnd=rnd end dont think that should be necessary for the use it serves, just would consume more resoruces. EDIT: slight improvement local lastRnd=0 function advert( ) local rnd repeat rnd = math.random( 1, #adMessages ) until rnd ~= lastRnd outputChatBox( adMessages[ rnd ], getRootElement(), 255, 255, 255, true ) lastRnd=rnd end
  13. spend some more time learning. function kick(player,reason) lcoal Plyr = getPlayerFromName(player if Plyr then kickPlayer(Plyr,source,tostring(reason)) outputChatBox("you kicked player \'"..player.."\'",source,255,0,0) else outputChatBox("no such player",source) end end addCommandHandler('kick', kick) also be sure your acl is set up right.
  14. karlis

    Chatbox Ads

    with this version rarely one ad can repeat 2times once a cycle of all add table. probably there would be more efficient way of 2nd table, but cba doing that, as this should work just fine. local tbl={ } local tblPos=1 function refreshList() local count=1 for _,val in pairs(adMessages) do --pairs automatically randomizes the list tbl[count]=val count=count+1 end end function advert( ) outputChatBox( adMessages[tblPos], getRootElement(), 255, 255, 255, true ) tblPos=tblPos+1 if tblPos>#adMessages then tblPos=1 refreshList() end end addEventHandler("onResoruceStart",getRootElement(),refreshList) if you don't want that 1 add cant appear more then once a cycle tru all list use this version WARNING:NEVER USE IT WITH ONLY 1 ADD OR INF LOOP WILL BE MADE. local lastRnd=0 function advert( ) local rnd = math.random( 1, #adMessages ) while rnd == lastRnd do rnd = math.random( 1, #adMessages ) end outputChatBox( adMessages[ rnd ], getRootElement(), 255, 255, 255, true ) lastRnd=rnd end
  15. it is the way it supposed to work script [re]loads on [re]starting resource
  16. basically you just need add the binds/command handlers if player is admin(check serverside), not of everyone, as it is in normal fr gui yes, not the most efficient way, but in servers with few players and with your scripting skill it would be fine. or you can perform checks, is player admin on each function that does something, and cancelEvent() if its not.
  17. and id recommend to attach some corner-boats to mother-boat too, for stability
  18. hmm ive been able to use 70 zombies on a 512mb RAM laptop with an 512mb graphics card.... then your computer must be really crappy? yep 1gb ram 256mb ati x200 1.6ghz but admin/dx resources/fr lags more than +30 zombs
  19. ofc gameplay is less enyoyable with less zombies, but its still fun even with only 15zombs
  20. 1)turn off admin, freeroam and as much unnecesary resources as possible 2)set zombie limit to 25 or ~so. 3)try now, workd 4 me.
  21. 1)use [ lua] [/lua] tags 2)rename dxscorebaord resource to "scoreboard", due to fact all resources supports that name 3)only table.lua needed local root = getRootElement() addEventHandler("onResourceStart",getResourceRootElement(), function() exports.scoreboard:addScoreboardColumn("money") setTimer( function() for _,player in ipairs(getElementsByType("player")) do setElementData(player,"money",getPlayerMoney(player)) end end, 0, 5000) end ) 4)don't get money clientside as then money is hackable
  22. remove the onClientRender event, just set the timer when resource starts
  23. local root = getRootElement() local player = getLocalPlayer() local counter = 0 local starttick local currenttick addEventHandler("onClientRender",root, function() if not starttick then starttick = getTickCount() end counter = counter + 1 currenttick = getTickCount() if currenttick - starttick >= 1000 then setElementData(player,"money",getPlayerMoney(player) ) counter = 0 starttick = false end end senseless.just use setTimer(function() setElementData(player,"money",getPlayerMoney(player) end, 0, 5000 )
×
×
  • Create New...