Jump to content

JR10

Retired Staff
  • Posts

    2,947
  • Joined

  • Last visited

Everything posted by JR10

  1. Yea but this way the player might have (Fp) or [fp] or |fP| so it's better to lower both strings.
  2. function detectFake(oldn, newn) if string.find(string.lower(newn), string.lower("|FP|"), 0) or string.find(string.lower(newn), string.lower("[FP]", 0) or string.find(string.lower(newn), string.lower("(FP)"), 0) then outputChatBox ("That nametag is not allowed, choose another.", source, 255, 0, 0) cancelEvent() end end addEventHandler ("onPlayerChangeNick", root, detectFake )
  3. No, the 2 last arguments are optional incase you want to use it ciel or floor leave em blank to use round method.
  4. JR10

    Cafe System

    function markerLeave( leaveElement, matchingDimension ) if getElementType( leaveElement ) == "player" then outputChatBox ( getPlayerName( leaveElement).."has left the cafe.", getRootElement(), 255, 255, 0 ) removeCommandHandler ("water", water) removeCommandHandler ("tea", tea) end end And please do /debugscript 3 ingame you will figure out the problems yourself.
  5. function zmienKolor() guiLabelSetColor(source, 255, 0, 0) end
  6. Hmm, v i think is the botton like i gave it to you not a label
  7. I made a mistake for i, v in ipairs(Button) do addEventHandler( "onClientGUIClick", v, zmienKolor, false ) end Sorry have been working on something for 5 hours so far
  8. for i, v in ipairs(Button) do addEventHandler( "onClientGUIClick", v, zmienKolor, false ) end
  9. JR10

    Create Peds

    Not really and i just discovered that element getResourceRootElement ( [resource theResource=getThisResource()] ) if you left it blank it will automatically getThisResource()
  10. JR10

    Create Peds

    Oh lol its optional and will do it automatically nvm me.
  11. JR10

    Create Peds

    LOL? Did you do what i told you else it shouldn't work.
  12. JR10

    Create Peds

    addEventHandler('onClientResourceStart', getResourceRootElement(),AldiPed) should be addEventHandler('onClientResourceStart', getResourceRootElement(getThisResource()),AldiPed)
  13. JR10

    Cafe System

    Castillo's one is not working because you had a mistake in the outputChatBox but i fixed it in mine so it should work. here: function ResourceStart() marker = createMarker ( 1449.3040771484, -2937.9020996094, 2.9447371959686, "cylinder", 1, 255, 255, 0) for i, v in ipairs(getElementsByType('player')) do setElementData(v,"all","0") setElementData(v,"tea","0") setElementData(v,"water","0") addEventHandler( "onMarkerHit", marker, MarkerHit ) addEventHandler( "onMarkerLeave", marker, markerLeave ) end end addEventHandler ( "onResourceStart", resourceRoot, ResourceStart ) function MarkerHit( hitElement, matchingDimension ) if getElementType( hitElement ) == "player" then outputChatBox( "You are now in my cafe.", hitElement, 255, 255, 0 ) outputChatBox( "If you want drink water use /water .", hitElement, 255, 255, 0 ) outputChatBox( "If you want drink tea use /tea .", hitElement, 255, 255, 0 ) addCommandHandler ( "water", water ) addCommandHandler ( "tea", tea ) end end function markerLeave( leaveElement, matchingDimension ) if getElementType( leaveElement ) == "player" then outputChatBox ( getPlayerName( thePlayer).."has left the cafe.", getRootElement(), 255, 255, 0 ) removeCommandHandler ("water", water) removeCommandHandler ("tea", tea) end end function water ( thePlayer, command ) outputChatBox( getPlayerName( thePlayer).."drunk water.", root, 255, 255, 0 ) setElementData ( thePlayer ,"water",tostring(tonumber(getElementData(thePlayer,"water"))+1)) end function tea ( thePlayer, command ) outputChatBox( getPlayerName( thePlayer).."drunk tea.", root, 255, 255, 0 ) setElementData ( thePlayer ,"tea",tostring(tonumber(getElementData(thePlayer,"tea"))+1)) end function all ( thePlayer, command ) local bira = tostring(tonumber(getElementData(thePlayer,"tea"))) local raki = tostring(tonumber(getElementData(thePlayer,"water"))) local toplam = tostring(tonumber(getElementData(thePlayer,"tea"))) + tostring(tonumber(getElementData(thePlayer,"water"))) outputChatBox( getPlayerName( thePlayer).."drunks"..toplam..".["..raki.."water"..bira.."tea]", root, 255, 255, 0 ) end addCommandHandler ( "all", all )
  14. The accounts are saved in internal.db in server/mods/deathmatch/internal.db you can open it with sqlitebrowser_200_b1_win
  15. JR10

    TXD Model

    Ok, thanks all
  16. Well, why when you got a function that will just make it integer math.round is better.
  17. Or just use this function function math.round(number, decimals, method) decimals = decimals or 0 local factor = 10 ^ decimals if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor else return tonumber(("%."..decimals.."f"):format(number)) end end --now use it on any number like this math.round(number)
  18. JR10

    TXD Model

    ID is the model? and does it contains all the txd's?
  19. JR10

    TXD Model

    I downloaded it i can't find the models
  20. ok, 1. don't double post use the EDIT botton instead 2. ye i understand, it's really hard to do what you want but yes in order to control all the peds you need a table but... you dont need ped[number] = createPed you can do this local peds = {} table.insert(peds, lastPed) -- later if needed table.remove(peds, ped) so we don't get back to the messy stuff
  21. JR10

    TXD Model

    I got alot of txds files that i want to import but i can't since i don't know thier model to use engineImportTXD So any one know what to do? Thanks in advance.
  22. I understand but its hard as hell don't think that it can be done without being bugged but like you said before almost nothing is impossible in scripting. HEY! don't ask me in this one
×
×
  • Create New...