-
Posts
2,947 -
Joined
-
Last visited
Everything posted by JR10
-
Yea but this way the player might have (Fp) or [fp] or |fP| so it's better to lower both strings.
-
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 )
-
No, the 2 last arguments are optional incase you want to use it ciel or floor leave em blank to use round method.
-
No problem.
-
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.
-
function zmienKolor() guiLabelSetColor(source, 255, 0, 0) end
-
Hmm, v i think is the botton like i gave it to you not a label
-
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
-
for i, v in ipairs(Button) do addEventHandler( "onClientGUIClick", v, zmienKolor, false ) end
-
Not really and i just discovered that element getResourceRootElement ( [resource theResource=getThisResource()] ) if you left it blank it will automatically getThisResource()
-
Oh lol its optional and will do it automatically nvm me.
-
LOL? Did you do what i told you else it shouldn't work.
-
addEventHandler('onClientResourceStart', getResourceRootElement(),AldiPed) should be addEventHandler('onClientResourceStart', getResourceRootElement(getThisResource()),AldiPed)
-
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 )
-
The accounts are saved in internal.db in server/mods/deathmatch/internal.db you can open it with sqlitebrowser_200_b1_win
-
Well, why when you got a function that will just make it integer math.round is better.
-
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)
-
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
-
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