Jump to content

h4x7o0r

Members
  • Posts

    203
  • Joined

  • Last visited

Everything posted by h4x7o0r

  1. -- Update ranking board if one player left local activePlayers = getActivePlayers() if #activePlayers == 1 then self.rankingBoard:add(activePlayers[1], timePassed) showMessage(getPlayerName(activePlayers[1]) .. ' is the final survivor!', 0, 255, 0) triggerEvent( "onPlayerWinDD",activePlayers[1] ) end -- local targetPlayer = getPlayerFromName ( targetPlayerName ) if ( tonumber(getElementModel(veh)) == 425 ) and ( #activePlayers == 1) then if targetPlayer then setElementHealth ( targetPlayer, getElementHealth(targetPlayer) - 110 ) end end I don't know if it's correct.
  2. thank you very much for your solution, it's working very well (i've used kinda different this) if getActivePlayerCount() < 1 then also as u suggested i should kill the last player who takes the hunter so i decided to use it this way : -- Update ranking board if one player left local activePlayers = getActivePlayers() if #activePlayers == 1 then self.rankingBoard:add(activePlayers[1], timePassed) showMessage(getPlayerName(activePlayers[1]) .. ' is the final survivor!', 0, 255, 0) triggerEvent( "onPlayerWinDD",activePlayers[1] ) end --------- if ( tonumber(getElementModel(veh)) == 425 ) and ( #activePlayers == 1) then end I don't know if this is the right way, and also to kill him should I use setElementHealth or other ? Thanks for all your help guys. LE. i've modified "and" tnx
  3. Thank you so much for your help, i've found this :https://community.multitheftauto.com/index.php?p=resources&s=details&id=5530 But when u download the resource, there's a link to download and there u must pay some money. I don't trust those things and also, i think it's kinda denied to upload it that way. who knows. anyways I will still searching for.
  4. thanks for reply, would have been awesome if i can find that gamemode on community, i've searched now but no result.
  5. Hey guys, I'm having a DM server and i wanna change a lil bit how votemanager's acting. For example, DM maps obviously are finished when at last one player is taking the Hunter and then kill others alive. The problem is that it's kinda impossible for some1 skilled to finish the map because others are failing before reaching the hunter. So is there any command / resource on community to modify this votemap to appear just only last player alive take the hunter or so ? Sincerly i've search for a related topic but couldn't fine anything useful at all. Thanks in advance.
  6. First of all, thank you so much guys for your prompt replies, i really appreciate this and also find 'em very useful. I've just found a "tutorial" that's already posted on the tutorials section, i will put here the link just because maybe there's someone interested too (https://forum.multitheftauto.com/viewtop ... 91&t=36847, thanks to NeXTreme and SDK). Looks like this method combined with a encrypt of client-side file will be more than enough.
  7. Hey there, I'm planning to release a public server but i must resolve some issues first. I'm asking you which is the best way to encrypt my dff. models and also the scripts. I've read some time ago that scripts can be compiled and encrypted in luac or stuff like this (someone told me also that we can add at the final of some important scripts a function that 's clearing the cache from the client or something like that). the txd as i know can't be locked or encrypt somehow so i must do something with the model itself. Can you give me some advices / methods of what is better to do ? also i think this could be useful to anyone. Thank you in advance .
  8. I've defined those and use it this way. local rObjects = { [3458] = true,[8558] = true }; -- Radar objects local screenX,screenY = guiGetScreenSize() -- Get screen resolution. local posx = screenX * 0.05 local posy = screenY * 0.725 ... dxDrawImage(posx,posy,32,160,img,n-oZ,0,0,tocolor(255,255,255,255))
  9. Those are values that i can find somewhere .. or do i need another function to get them all ? This is kinda ambiguous. Feel sorry for bothering you with my misunderstood and also thanks for your help.
  10. I've used some values, like : 200 20 160 32. (didn't let that unmodified) Should I need another function to retrieve this ? Thank you for all and still sorry for bothering. All the best.
  11. Thank you so much for your effort, u made my day. There are some errors : LINE 37: Bad argument @ "dxDrawImage" [Expected number at argument 1, got nil]
  12. I've read about what u've suggested but couldn't do it by myself that's why i've posted my *fail*script to see what should i need to change. I still don't know how to make visible on the radar my image.
  13. Anyone ? I really need this script thanks in advance for any help.
  14. Thank you for reply, I've just read about those 2 functions but i think it's not what I am looking for because i want that every road (every object) that has the desire id to be positioned on the radar. I can't use x,y,z for each road by itself. LE: I've tried to figure it out how can i create the script but i think all it's a mess I've even found a resource for "custom blips" https://community.multitheftauto.com/index.php?p= ... ils&id=960 that has some exported functions. Here's what i've tried : addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), function () if ( getElementType ( targetElem ) == "object" ) and ( getElementModel ( targetElem ) == 8558) then local x, y, z = getElementPosition(targetElem) local sx, sy = getScreenFromWorldPosition(x, y, z+3) exports.customblips:createCustomBlip ( x,y, 160, 32, "road.png" ) else exports.customblips:destroyCustomBlip ( x,y, 160, 32, "road.png" ) end
  15. Thank you very much for your reply, sincerly i don't know how to calculate or what should i do LE : I wanna have all roads visible on the radar not only one.
  16. yes i'm having .img of the road that needs to be replaced on the map and also the id for each one of road, but i don't know how can i modify the dxDrawLine to fit my requirements.
  17. Thank you for your reply, good is correct but how can i continue ? for example on the radar to have the road visible on the radar ? All the best.
  18. @jaysds1 : Yeah I've checked community resources and haven't found any to display the roads and so on. @TwiX! : Thank you for your reply, I've seen the docs of getElementsByType but haven't got the right answer . local objects = getElementsByType ( "object" ) But i don't know how to retrieve a specific id. For example. The cross road has 8558 id. Should i use getElementModel ? function radar ( targetElem ) if ( getElementType ( targetElem ) == "object" ) and ( getElementModel ( targetElem ) == 8558) then ... end
  19. Hello, I've seen an useful radar resource on a cross server. The particularity of this radar is that u can see the cross roads (vgsh...). Here is a picture to see exactly why am i looking for :
  20. Thank you for reply. I've just tested the code and it looks like now it's updating the database but in a wrong matter. For example now if before code type u have : 1000 money and the prize is 511 after u win the prize it erase all the money that u have before and keeps only the prize for global money. This is applicable just after reconnecting. LE: So now i've it's working very well i've changed this : executeSQLUpdate ( "MoneyB", "Money = '".. getPlayerMoney ( player ) + thePrize .."'","serial = '" .. serial .. "'" ) with this : executeSQLUpdate ( "MoneyB", "Money = '".. money1 + thePrize .."'","serial = '" .. serial .. "'" ) Thanks a lot for your help solidsnake14 !
  21. Sorry guys that i haven't checked the topic. First, thank you everyone for the answers. 2nd : I've tried Bssol's modified code and it says : attempt to concatenate global 'serial' (a nil value) 3nd : Kenix, i haven't posted all the code because it's inside the resource --***********************************-- --***********************************-- -- Random Words -- -- By Al3grab -- --***********************************-- --***********************************-- ---- Changeable captchaNums = 5 -- captcha letters length wordTimeInSec = 25 --- the time before the word disappear in seconds [ default 11 seconds ] prizefrom,prizeto = 500,800 -- the prize random num timerfrom,timerto = 1.5,5.5 -- the random timer that shows the word [ default from 3 to 15 minutes ] ---- unChangeable wordOn = false theWord = nil thePrize = nil wordTime = wordTimeInSec * 1000 -- outputDebugString("Random Words By Al3grab | Started") -- function createCode(code,prize) for k,v in ipairs( getElementsByType("player") ) do exports.easytext:displayMessageForPlayer(v,1, "=========", wordTime, 0.07, 0.5, 0, 255, 0, 255, 1.6) exports.easytext:displayMessageForPlayer(v,2, "Word : "..code.."", wordTime, 0.07, 0.533, 255, 255, 0, 255, 1.6) exports.easytext:displayMessageForPlayer(v,3, "Prize : "..prize.."$", wordTime, 0.07, 0.563, 255, 255, 0, 255, 1.6) exports.easytext:displayMessageForPlayer(v,4, "=========", wordTime, 0.07, 0.593, 0, 255, 0, 255, 1.6) end outputChatBox("- Random Words : #FFFF00Enter the word shown below to win the prize.",root,0,255,0,true) outputChatBox("=========",root,0,255,0,true) outputChatBox("Word : "..code.."",root,255,255,0,true) outputChatBox("Prize : "..prize.."$",root,255,255,0,true) outputChatBox("=========",root,0,255,0,true) outputChatBox("- #FFFF00You can see the word down on your screen.",root,0,255,0,true) -- startCodeTimer() wordOn = true end function makeRandomCode(Word,Prize) if ( Word and Prize ) then theWord = Word thePrize = Prize else theWord = makeCaptcha(captchaNums) thePrize = math.random(prizefrom,prizeto) end if ( tostring(theWord) and tonumber(thePrize) ) then createCode(theWord,thePrize) end end function startCodeTimer() codeTimer = setTimer( function () removeCode() outputChatBox("- #FFFF00No one won the prize",root,0,255,0,true) end , wordTime , 1 ) end function removeCode() for k,v in ipairs( getElementsByType("player") ) do exports.easytext:clearMessageForPlayer(v,1) exports.easytext:clearMessageForPlayer(v,2) exports.easytext:clearMessageForPlayer(v,3) exports.easytext:clearMessageForPlayer(v,4) end if isTimer ( codeTimer ) then killTimer(codeTimer) end theWord = nil thePrize = nil wordOn = false end function makeCaptcha(capNumz) theC = "" tCode = { "a","A", "b","B", "c","C", "d","D", "e","E", "f","F", "g","G", "h","H", "j","J", "k","K", "l","L", "m","L", "n","N", "o","O", "p","P", "q","Q", "r","R", "s","S", "t","T", "u","U", "v","V", "x","X", "y","Y", "z","Z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "!", "@", "#", "?" } for k=1,capNumz or 5 do randomCode = math.random (#tCode ) theC = ""..theC..""..tCode[randomCode].."" end return theC end function onPlayerWin ( player ) local money1 = tonumber ( getElementData ( player, "Money" ) ) outputChatBox("* ".. getPlayerName ( player ).." #FFFF00Has won the Prize #00FF00$".. thePrize, root, 255, 255, 0, true ) setElementData ( player, "Money", money1 + thePrize ) givePlayerMoney ( player, thePrize ) executeSQLUpdate ( "MoneyB", "Money = '".. getPlayerMoney ( player ) .."'","serial = '" .. serial .. "'" ) removeCode ( ) end function detcetChatMessage(msg,msgtype) if ( wordOn == true and msg and msgtype == 0 ) then if msg == theWord then onPlayerWin(source) end end end addEventHandler("onPlayerChat",root,detcetChatMessage) addEventHandler("onResourceStop",resourceRoot,function() removeCode() end ) function setRandomTimer() setTimer(function() if not wordOn then makeRandomCode() end setRandomTimer() end , math.random(timerfrom,timerto) * 60 * 1000 , 1 ) end addEventHandler("onResourceStart",resourceRoot,function() setRandomTimer() easytext = getResourceFromName("easytext") if ( easytext ) then if getResourceState(easytext) == "loaded" then startResource(easytext) end else outputChatBox("* Error , need for easytext resource to start") cancelEvent() end end ) for k,v in ipairs ( {"randomcode","randomword","rw","rd"} ) do addCommandHandler(v,function(plr,cmd,prize,...) if plr and hasObjectPermissionTo(plr,"function.kickPlayer") then if ( not prize ) then makeRandomCode() else word = table.concat({...}, " ") if ( word ) then makeRandomCode(word,prize) end end end end ) end
  22. I don't know , probably. Anyway thanks for reply.
  23. Thank you for reply. I've tried the code but same result / no update after reconnect.
×
×
  • Create New...