Jump to content

Klesh

Members
  • Posts

    306
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Klesh

  1. Try : function showTextDisplay ( source,player, command ) local account = getPlayerAccount(source) local money = getElementData(player, "MONEY") local serverDisplay = textCreateDisplay() -- create a text display if money and account then textDisplayAddObserver ( serverDisplay, player ) -- make it visible to a player local serverText = textCreateTextItem ( money.." Lt", 0.775, 0.18, "low",34, 139, 34, 255, 3.2, "left", "top", 255) -- create a text item for the display textDisplayAddText ( serverDisplay, serverText ) -- add it to the display so it is displayed end end addEventHandler("onPlayerJoin", getRootElement(), showTextDisplay) addommandHandler( "show", showTextDisplay )
  2. Also, multitheftauto can do a new event, of course with time in future version can be posible, "onPlayerCancelOutput()", it's needed, trying to make it fix by other ways. Edit : I was fixed by my own, but thanks for help.
  3. function antiSpam(commandName) outputChatBox("*"..getPlayerName(source).."Has change his nick..", g_Root, 255, 255, 0, true)--example when player changenick if (getTickCount(source, 10000)) then outputChatBox("You use this command every 10 seconds".source, 255, 0, 0, true) cancelEvent()--the change nick is locked, nick no change but it show the message like's it is, but dont. end addEventHandler("onPlayerChangeNick", getResourceRootElement(getThisResource()), antiSpam)
  4. Klesh

    GUI

    Don't double post, delete your second post and edit the first one, the help will arrive as soon is posible, take it easy.
  5. Fail script antispam system?
  6. Yes i want to remove the outputChatBox, when time is passed, is for a antispam system, remove that outputChatBox, i was made it, by other stuff, but the display show it, i dont want that. --example function antiSpam(commandName) outputChatBox("*"..getPlayerName(source).."Has change his nick..", g_Root, 255, 255, 0, true)--example when player changenick if (getTickCount(source, 10000)) then outputChatBox("You use this command every 10 seconds".source, 255, 0, 0, true) --how to remove first outputChatBox? end addEventHandler("onPlayerChangeNick", getResourceRootElement(getThisResource()), antiSpam) --I wanna include this system to the joinquit script.
  7. You must to do a simple system script, maybe you can do one by: setElementData("time.data", timeHandler) ---Example code getElementData("time.data", timeHandler) ---You can use this too: setElementData("time.data", toJSON({.....}))--You must addEventHanderl("onPlayerLogin or playerQuit
  8. Hello, im asking for example in a wrote function, its created an a display outputChatBox("........, executed when command is called, then i want to cancel later that outputChatBox, someone have a easier way to set that outputChatBox created to nil or false, i dont want to show it when i cancel that.
  9. Nice way to get script organized, good job myonlake. Ps: That's a correct way to edit your scripts more easy and effective.
  10. Thanks, now i do scripts and fixing them by myself, takes time, but i do it, and helping others i learn more.
  11. If do you want to do some question, or help in spanish post here, viewforum.php?f=145, there you get help in your idiom, good luck.
  12. I want to set +1 win then add to scoreboard, the save system i will do by myself.
  13. I want to add that to scoreboard, but does not work. ------------------- ----DEFINITION---- ------------------- local root = getRootElement() call(getResourceFromName("scoreboard"), "addScoreboardColumn", "Wins", getRootElement(), 3, .08 )-----| ------------ ---WINNER--- ------------ function winHandler(player) local pRank = exports["race"]:getPlayerRank(player) if (pRank == "1" or pRank == 1) then setElementData ( pRank, "Wins", ( getElementData ( pRank, "Wins" ) ) + 1 ) end end addEventHandler("onClientResourceStart", getRootElement(), winHandler)
  14. Good job, many servers will use that cuz horn abusers are a little.
  15. Klesh

    smoke

    Do you mean the smoke generated of the car when they start on the race? Maybe setVehiclePanelState, didn't know yet if exist something to turn of that smoke, but you can try with this functions: unbindKey --- Inhabilitate "w" key when race starts with exports["race"]:onMapStarting --when polls are starting turn value to exports["race"]:onPollStarting unbindKey(...,false) unbindKey = nil setVehicleFrozen(true,true) Good luck, try with that, it should will work.
  16. function start(source, player) crate = createObject(2991,-1353,-185,14) local team = getPlayerTeam(source) local object = createObject(2991, -1353, -185, 14) if team then local police = getTeamFromName("Police") local criminals = getTeamFromName("Criminals") if (team == police) then outputChatBox("You're a police officer.", source, 0, 255, 0, false) elseif (team == criminal) then outputChatBox("You're a criminal.", source, 0, 255, 0, false) end end end function onStart(player) -- Here. setTimer(start, 7500, 1, player) end addEventHandler("onResourceStart", getRootElement(), onStart)
  17. Post your whole code, and meta.
  18. To make the script start when resource is started, put this: addEventHandler("onClientResourceStart", getRootElement(), start)
  19. Al3grab, its alredy fixed, you're late.
  20. The code dont have any sense, what you want to do with that?
  21. function timerHandler (thePlayer) setTimer(set, 1000, 1, thePlayer) end addEventHandler("onResourceStart", getResourceRootElement(),timerHandler) function set (thePlayer) if (thePlayer) then outputChatBox("Value found.", thePlayer, 0, 255, 0, false) timerHandler(thePlayer) else outputChatBox("Value not found.", player, 255, 0, 0, false) end end
  22. I need to ask how i can get the player rank, for example if the player is 1, define that function: Example script function(source) local pRank = getPlayerRank(source) if (pRank == "1") then setPlayerMoney(source, 1000)----Its only an example, i need how to call the player rank when its 1. end end That's the correct way? or it have another one more effective?
  23. Something wrong, with onPlayerPickUpRacePickUp, no loads the color, you right, the event is usseless, thanks about that. Edit: Alredy fixed, editing a race file and some little things in the script, thanks.
  24. Server - Side function colorHandler ( thePlayer, commandName, r, g, b ) if (not isPedInVehicle(thePlayer)) then outputChatBox("[Error]: This command only works when you're in a vehicle", thePlayer, 255, 0, 0, true) return end if (tonumber(r) and tonumber(g) and tonumber(b)) then local playerVehicle = getPedOccupiedVehicle(thePlayer) local account = getPlayerAccount(thePlayer) if (getPlayerMoney(thePlayer) >= 10000) then takePlayerMoney(thePlayer, 10000) playSoundFrontEnd(thePlayer, 46) setVehicleColor(playerVehicle, tonumber(r), tonumber(g), tonumber(b)) setAccountData(account, "color.data", toJSON({r, g, b})) outputChatBox("#2E9AFE[shop]: #FFFFFF" ..getPlayerName(thePlayer).. "#2E9AFE has bought vehicle colors for 10000$. (/bc)", root, 255, 255, 255, true) else outputChatBox("[Error]: You don't have enough money to buy.", thePlayer, 255, 0, 0, true) end else outputChatBox("[Error]: Syntax: /bc [r g b]", thePlayer, 255,0 ,0, true) end end addCommandHandler("bc", colorHandler) function loadVehicleColor ( thePlayer ) local account = getPlayerAccount(thePlayer) local pColor = getAccountData(account, "color.data") if (pColor) then local r, g, b = unpack(fromJSON(pColor)) triggerClientEvent(thePlayer,"colorv", thePlayer, "",r,g,b) local playerVehicle = getPedOccupiedVehicle(thePlayer) if (playerVehicle) then setVehicleColor(playerVehicle, tonumber(r), tonumber(g), tonumber(b)) end end end addEventHandler("onPlayerLogin", getRootElement(), function () loadVehicleColor(source) end) addEventHandler("onPlayerWasted", getRootElement(), function () loadVehicleColor(source) end) addEventHandler("onPlayerPickUpRacePickUp", getRootElement(), function (pickupID, pickupType, vehicleModel) if (pickupType == "vehiclechange") then loadVehicleColor(source) end end) addEventHandler("onVehicleEnter", getRootElement(), function (thePlayer) loadVehicleColor(thePlayer) end) client-side addEvent("colorv", true) addEventHandler("colorv", root, colorHandler)
  25. Ok, changed, then debug says colorv must be in client, then i put this on client. addEvent("colorv", true) addEventHandler("colorv", root, colorHandler) the same thing, ispedinvehicle bad argument.
×
×
  • Create New...