Jump to content

codeluaeveryday

Members
  • Posts

    575
  • Joined

Everything posted by codeluaeveryday

  1. I couldnt seem to unbind it either. Try this: function bind(thePlayer, command, key, cmdToExecute, valueEntered) if(cmdToExecute == "unbind")then unbindKey(thePlayer, tostring(key),"down") outputChatBox(key.." successfully unbinded.", thePlayer) else bindKey(thePlayer, tostring(key), "down", cmdToExecute, valueEntered) outputChatBox(key.." has been binded to do: "..cmdToExecute, thePlayer) end end addCommandHandler("bindf", bind) It shows chat now.
  2. make a settimer to check every 1 second if the player has a jetpack. setTimer() doesPedHaveJetPack() removePedJetPack() aka. setTimer( function timer() if doesPedHaveJetPack(getLocalPlayer()) then removePedJetPack(getLocalPlayer()) end end ,1000,0 )
  3. Scooby dude, the topic is over, stop replying lol.
  4. bind is one of the main MTA commands, i think you should change it to something like /bindfunc. Here function bind(thePlayer, command, key, cmdToExecute, valueEntered) if(cmdToExecute == "unbind")then unbindKey(thePlayer,tostring(key)) outputChatBox(tostring(key) "successfully unbinded.", thePlayer,255,255,255) else bindKey(thePlayer, tostring(key), cmdToExecute, valueEntered) outputChatBox(tostring(key) + "has been binded to do:" + tostring(cmdToExecute), thePlayer, 255, 255, 255) end end addCommandHandler("bind", bind) I am not sure if you can bind other commands to bind key. Also look at executeCommandHandler().
  5. Are you sure data has been set to Time Played. Make sure your logged in.
  6. Thanks apple, if you need any help with anything, do not hesitate to ask on the forums
  7. Scooby, i didnt just do that, pay more attention. I made it so it would work. The variable in my mind wasnt activated. So i fixed it. I removed the function!
  8. I cannot help with this topic any further sorry
  9. Good one myonlake, remember my script is smaller and will work faster.
  10. I usually do not use a function for this type of script: Client: music = guiCreateWindow(0.2988,0.2317,0.4238,0.5617,"ppS Music Player",true) guiSetVisible ( music, false ) music_play = guiCreateLabel(0.3864,0.1098,0.236,0.0445,"Now playing:",true,music) guiSetAlpha(music_play,1) guiLabelSetColor(music_play,255,20,147,255) guiLabelSetHorizontalAlign(music_play,"center",false) guiSetFont(music_play,"default-bold-small") music_name = guiCreateLabel(0.1268,0.1869,0.7611,0.0623,"",true,music) guiLabelSetHorizontalAlign(music_name,"center",false) music_grid = guiCreateGridList(0.0649,0.2997,0.8732,0.6261,true,music) guiGridListSetSelectionMode(music_grid,0) local music_grid_column = guiGridListAddColumn(music_grid,"Playlist",0.2) guiSetVisible ( music, false ) if (music_grid_column) then for name,dir in pairs(musics) do local newRow = guiGridListAddRow ( music_grid ) guiGridListSetItemText( music_grid, newRow, music_grid_column, #musics, false, false ) end end and your bindkey: function showWindow() if ( guiGetVisible ( music ) == true ) then guiSetVisible ( music, false ) showCursor(false) elseif ( guiGetVisible ( music ) == false ) then guiSetVisible ( music, true ) showCursor(true) end end bindKey ( "F3", "down", showWindow )
  11. It wasnt an insult it was just a "mean" way of helping. Sorry lol But im pretty sure that won't help . I think there is an issue with setAccountData. You used: addEvent("onPlayerFinish",true) addEventHandler("onPlayerFinish",getRootElement(), function (rank,finishtime) local account = getPlayerAccount(source) if isGuestAccount(account) then outputChatBox("You must be logged in to get the points and cash" , source, 255, 0, 0, true) else if rank == 1 then givePlayerMoney(source,1000) setAccountData( account, "Points", +3 ) end if rank == 2 then givePlayerMoney(source,500) setAccountData( account, "Points", +2 ) end if rank == 3 then givePlayerMoney(source,100) setAccountData( account, "Points", +1 ) end end end) ) Should be: addEvent("onPlayerFinish",true) addEventHandler("onPlayerFinish",getRootElement(), function (rank,finishtime) local account = getPlayerAccount(source) if isGuestAccount(account) then outputChatBox("You must be logged in to get the points and cash" , source, 255, 0, 0, true) else if rank == 1 then givePlayerMoney(source,1000) setAccountData( account, "Points", getAccountData(account, "Points")+3 ) end if rank == 2 then givePlayerMoney(source,500) setAccountData( account, "Points", getAccountData(account, "Points")+2 ) end if rank == 3 then givePlayerMoney(source,100) setAccountData( account, "Points", getAccountData(account, "Points")+1 ) end end end) )
  12. Try: function DestructionWin() local alivePlayers = getAlivePlayers() if #alivePlayers == 1 then local account = getPlayerAccount(alivePlayers[1]) if isGuestAccount(account) then return end local playername = getPlayerName(alivePlayers[1]) setAccountData(account,"Race Wins",tostring(raceWins)+1) outputChatBox ( "#FFA824The player " .. playername .. " won!", getRootElement(), 255, 255, 255, true ) end addEventHandler("onPlayerWasted", getRootElement(), function() local account = getPlayerAccount(alivePlayers[1]) if isGuestAccount(account) then return end setAccountData(account,"Race Loses",tostring(raceLoses)+1) end) setTimer( function() if isGuestAccount(account) then return end local account = getPlayerAccount(source) local timePlayed = getAccountData(account, "Time played") if (not timePlayed) then setAccountData(account, "Time played","0:0:0") end local hours, mins, secs = unpack(split(timePlayed, ":")) local hours = tonumber(hours) local mins = tonumber(mins) local secs = tonumber(secs) if (hours and mins and secs) then local newsec = secs + 1 if ( newsec >= 60 ) then newsec = 0 mins = mins + 1 end if ( mins >= 60 ) then mins = 0 hours = hours + 1 end setAccountData ( account, "Time played", tostring(hours) ..":".. tostring(mins) ..":".. tostring(newsec)) end end end ,1000,1) function ratioCalculator() local KDR_DECIMAL_PLACES = 2 local account = getPlayerAccount(source) local raceLoses = getAccountData(account,"Race Loses") if raceLoses == 0 then setAccountData(account, "Ratio", "-") else local kdr = round(getAccountData(account, "Race Wins") / raceLoses, KDR_DECIMAL_PLACES) setAccountData(account, "Ratio", tostring(kdr)) end end addEventHandler("onPlayerLogin",root, function () local account = getPlayerAccount(source) if isGuestAccount(account) then return end local raceWins = getAccountData(account,"Race Wins") local raceLoses = getAccountData(account,"Race Loses") local timePlayed = getAccountData(account, "Time played") local ratio = getAccountData(account, "Ratio") if raceWins then setAccountData(account,"Race Wins",tostring(raceWins)) else setAccountData(account,"Race Wins",0) end if raceLoses then setAccountData(account,"Race Loses",tostring(raceLoses)) else setAccountData(account,"Race Loses",0) end if timePlayed then setAccountData ( account, "Time played", tostring(hours) ..":".. tostring(mins) ..":".. tostring(newsec)) else setAccountData(account, "Time played","0:0:0") end if ratio then setAccountData(account,"Ratio",tostring(ratio)) else setAccountData(account,"Ratio",0) end end) function publicstatsinfo() local account = getPlayerAccount(source) if isGuestAccount(account) then return end local askdname = getPlayerName(source) local wins = getAccountData(account, "Race Wins") local loses = getAccountData(account, "Race Loses") local ratio = getAccountData(account, "Ratio") local timePlayed = getAccountData(account, "Time played") if loses and wins then outputChatBox("#FFA824*" .. askdname .. " won " .. wins .. " times and he/she lost " .. loses .. " times, his/her ratio is " .. ratio .. " and the total time played he/she is: " .. timePlayed, getRootElement(), 255, 12, 15, true) else outputChatBox("*You don't losed or won" , getRootElement(), 255, 12, 15, true) end end addEvent("stats", true) addEventHandler("stats", getRootElement(), publicstatsinfo) function checkCommand(message, messageType) if (messageType == 0) then if (message == "!stats") then cancelEvent() setTimer(triggerEvent, 100, 1, "stats", source) end end end addEventHandler("onPlayerChat", getRootElement(), checkCommand)
  13. @Raffica, Please do not double post. You must wait until someone else has replied! On topic: Sorry that that didn't help.
  14. Lol you used setElementData. setAccountData is more efficient.
  15. Solidsnake would be your best option right now. If he replies, he is the right scripter for the job.
  16. Usually when it outputs like that its because the element is incorrect! for _,v in ipairs(getElementsByType("player")) do if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then outputChatBox("(Nearby)"..nick..": #ffffff"..msg,v,r,g,b,true) end end I think it should be for _,v in ipairs(getElementsByType("player")) do if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then outputChatBox("(Nearby)"..nick..": #ffffff"..msg,getPlayerName(v),r,g,b,true) end end
  17. Xmen if you do pay GanJaRuleZ ur basically not going to get what you need.
  18. You're reading the wiki right? I think you could put a colshape at the admin area. Uhm, and use onClientColShapeHit. Try to script a password to it. I cannot explain it, and i doubt you understand .
  19. Here: local player = nil function thePlayerReachedHunter() if (player) then dxDrawText("The player ".. tostring(getPlayerName(player)) .." got hunter! NOW RUN !",155.0,549.0,669.0,591.0,tocolor(255,255,255,255),1.0,"diploma","left","top",false,false,false) end end addEvent("disableGhostMode",true) addEventHandler("disableGhostMode",root, function (thePlayer) player = thePlayer outputChatBox ( "#FFE303The ghostmode will be disabled in 5 seconds ",255,255,255 ,true ) addEventHandler ( "onClientRender", root, thePlayerReachedHunter ) setTimer(function () removeEventHandler ( "onClientRender", root, thePlayerReachedHunter ) end, 5000, 1) setTimer(function () for k,v in ipairs(getElementsByType("vehicle")) do setElementCollidableWith(v, v, true) end end, 5000, 1) end)
  20. Your script has a lot of unnecessary stuff. Use https://community.multitheftauto.com/index.php?p= ... ls&id=2801.
  21. [url=https://wiki.multitheftauto.com/wiki/Vehicle_Upgrades]https://wiki.multitheftauto.com/wiki/Vehicle_Upgrades[/url] [url=https://wiki.multitheftauto.com/wiki/EngineImportTXD]https://wiki.multitheftauto.com/wiki/EngineImportTXD[/url] Make a script to replace them!
  22. codeluaeveryday

    fix water

    setWaterLevel can reach 99.99 without breaking. After 99.99 the water will have issues.
×
×
  • Create New...