Jump to content

JuniorMelo

Members
  • Posts

    120
  • Joined

  • Last visited

Everything posted by JuniorMelo

  1. yes (I want to put to show only the player who enters the base)
  2. that way the message appears to the player that entered the base ?
  3. well ? local rootElement = getRootElement() local sw,sh = guiGetScreenSize() local localPlayer = getLocalPlayer ( ) local LOCAL_PLAYER = getLocalPlayer() function dx () dxDrawText("~Base~",sw/15.2, sh/1.499, sw,sh,tocolor(255,255,255,255),2.0, "default-bold", "left", "top", false, false, false) dxDrawText("Area 51",sw/15.2, sh/1.399, sw,sh,tocolor(0,255,0,255),2.0, "default-bold", "left", "top", false, false, false) end addEvent ( "text", true ) addEventHandler ( "text", root, function () addEventHandler("onClientRender",rootElement, dx) end ) function exitarea () removeEventHandler("onClientRender",rootElement, dx) end addEventHandler("onClientColShapeLeave",getRootElement(),exitarea)
  4. can help me with this script dxDrawColorText Appearing a message when the player enter the area, the problem it is the message appearing for All players can help to appear the message for only the player who joined the base sorry my english (I am Brazilian) local rootElement = getRootElement() local sw,sh = guiGetScreenSize() local localPlayer = getLocalPlayer ( ) local LOCAL_PLAYER = getLocalPlayer() function dx () dxDrawColorText("#ffffff~Base~",sw/15.2, sh/1.499, sw,sh,tocolor(0,0,0,255),2.0, "default-bold", "left", "top", false, false, false) dxDrawColorText("#D76609Area 51",sw/15.2, sh/1.399, sw,sh,tocolor(0,0,0,255),2.0, "default-bold", "left", "top", false, false, false) end addEvent ( "text", true ) addEventHandler ( "text", root, function () addEventHandler("onClientRender",rootElement, dx) end ) function exitarea () removeEventHandler("onClientRender",rootElement, dx) end addEventHandler("onClientColShapeLeave",getRootElement(),exitarea) function dxDrawColorText(str, ax, ay, bx, by, color, scale, font) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), 255) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) ax = ax + w color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), 255) end last = e + 1 s, e, cap, col = str:find(pat, last) end if last <= #str then cap = str:sub(last) local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) end end
  5. could show me which part missing ??
  6. this part ?? toptimes_client function CToptimes:enableToptimeUpdatesFromServer( bOn ) if bOn ~= self.bGettingUpdates then self.bGettingUpdates = bOn triggerServerEvent('onClientRequestToptimesUpdates', g_Me, bOn, self.clientRevision ) end if self.bGettingUpdates and self.listStatus == 'Empty' then self.listStatus = 'Loading' end end
  7. Can anyone identify this error ?? TopTimes_Server g_MapName = "-" function loadTimes(map) local tts = {} local query = dbQuery(ttHandler,"SELECT * FROM `toptimes` WHERE `mapname` = '"..tostring(map).."' LIMIT 0,1;") if query then local result, row = dbPoll(query,-1) if result and row > 0 then for id, res in ipairs(result) do --outputChatBox("Works till here") tts = fromJSON(res['toptimes']) end end end dbFree(query) return tts end function saveTimes(time,map) local query = dbQuery(ttHandler,"SELECT * FROM `toptimes` WHERE `mapname` = '"..tostring(map).."'") local result = dbPoll( query, 10 ) if query and #result > 0 then outputDebugString("Succesfully Loaded TopTime") local exec = dbQuery(ttHandler,"UPDATE `toptimes` SET `toptimes` = '"..toJSON(time).."' WHERE `mapname` = '"..tostring(map).."'") if exec ~= false then outputDebugString("Updating Toptimes for '"..tostring(map)) end else local querryb = dbQuery(ttHandler, "INSERT INTO toptimes (mapname,toptimes) VALUES (?,?)", tostring(map),toJSON(time)) local resulbt = dbPoll( querryb, 10 ) if resulbt ~= false then outputDebugString("Added Toptimes for '"..tostring(map)) end end dbFree(query) end function sortToptimes(tabl) local oldT = tabl[12] table.sort(tabl, function(a,b) return a.time < b.time end) local newT = tabl[12] triggerClientEvent(root,"updateToptimesTable",root,tabl) return tabl end function addNewToptime(ttable, accname, ttime, date, country) for i,v in ipairs(ttable) do if v.name == accname then if v.time > ttime then if v.date and v.country then v.time = ttime v.date = date v.country = country sortToptimes(ttable) return true end end return false end end local playertable = {} playertable.name = accname playertable.time = ttime playertable.date = date playertable.country = country ttable[#ttable+1] = playertable sortToptimes(ttable) return true end function getPlayerTopTime(tts, player) for id, v in ipairs(tts) do if v.name == getPlayerName(player) then local rtts = {} rtts.name = v.name rtts.i = id rtts.time = msToTimeStr(v.time) return rtts end end end gToptimes = false addEvent("onMapStarting") addEventHandler("onMapStarting", root, function(mapInfo) local OldMap = g_MapName if OldMap ~= mapInfo.name then if gToptimes ~= false then --outputChatBox(#gToptimes) saveTimes(gToptimes,g_MapName) end gToptimes = false end g_MapName = mapInfo.name if string.find(mapInfo.name,"[DM]") or string.find(mapInfo.name,"race-[DM]") then for id, player in ipairs(getElementsByType("player")) do if OldMap ~= mapInfo.name then gToptimes = loadTimes(g_MapName) triggerClientEvent(player,"doSendClientToptimes",root,player,gToptimes,g_MapName) end end end end) addEvent("onPlayerPickUpRacePickup") addEventHandler("onPlayerPickUpRacePickup",root,function(id,sort,model) if sort == "vehiclechange" then if (model == 425) then --if (getElementModel(getPedOccupiedVehicle(source))~= 425 ) then local time = exports['race']:getTimePassed() local name = getPlayerNametagText(source) local t = getRealTime() local ct --outputChatBox(time) local date = t.monthday.."."..(t.month+1).."."..(t.year+1900) local country = exports['admin']:getPlayerCountry(source) if country then ct = ':admin/client/images/flags/'..country..'.png' else ct = "N/A" end addNewToptime(gToptimes,name,time,date,ct) local t = getPlayerTopTime(gToptimes,source) outputChatBox("#0087FF[HUNTER] #ffffff"..getPlayerName(source).." #ffffffmade a new toptime #0087FF"..t.time.." #ffffffand got position #0087FF"..t.i, getRootElement(), 255, 255, 255, true) --end end end end) function removeToptime(player, cmd, i) if tonumber(getElementData(player,"team")) >= 3 then if not tonumber(i) or i == nil then outputChatBox("#0087FF[HUNTER] #ffffffThis was not a valid number", player, 255, 255, 255, true) return end i = tonumber(i) if gToptimes[i] then table.remove(gToptimes,i) sortToptimes(gToptimes) outputChatBox("#0087FF[HUNTER] #ffffffYou deleted Toptime 0087FF#"..i, player, 255, 255, 255, true) end end end addCommandHandler("deletetime", removeToptime) addEvent('onLoadedAtClient_tt', true) addEventHandler('onLoadedAtClient_tt', g_Root, function() -- Tell newly joined client current settings clientCall(source,'updateSettings', g_Settings) end ) addEvent('onClientRequestToptimesUpdates', true) addEventHandler('onClientRequestToptimesUpdates', getRootElement(), function( bOn, clientRevision ) g_SToptimesManager:doOnClientRequestToptimesUpdates( source, bOn, clientRevision ) end ) function msToTimeStr(ms) if not ms then return '' end local centiseconds = tostring(math.floor(math.fmod(ms, 1000)/10)) if #centiseconds == 1 then centiseconds = '0' .. centiseconds end local s = math.floor(ms / 1000) local seconds = tostring(math.fmod(s, 60)) if #seconds == 1 then seconds = '0' .. seconds end local minutes = tostring(math.floor(s / 60)) return minutes .. ':' .. seconds .. ':' .. centiseconds end
  8. JuniorMelo

    help script

    gameid\gameid.lua:1320 the problem is line: 1320
  9. What do you mean? Like make an armor or health pickup? pickupuse = createPickup(225.93472, 1899.18359, 17.64806, 3, 348, 500, 0 ) function pickupsx ( player ) if ( source == pickupuse ) then setTimer( function ( who ) giveWeapon ( who, 24 ) --change giveWeapon to setPlayerArmor-- end, 1000, 1, player ) end end addEventHandler("onPickupHit", getRootElement(),pickupsx ) is possible ?
  10. is possible to make armor is Health ? setElementHealth setPlayerArmor
  11. sorry my english I am Brazilian bad works Thanks !!!!!
  12. Hello I am here again to ask for a help to you guys again I would like to put a (Time to give gun) bad'm not getting you guys could help me pickupuse = createPickup(225.93472, 1899.18359, 17.64806,1,24,0 ) function pickupsx(source) if ( source == pickupuse ) then setTimer(pickupsx,1000,0) end end addEventHandler("onPickupHit", getRootElement(),pickupsx )
  13. Thanks mate helped a lot !!
  14. Wanted to do with the event onVehicleStartEnter
  15. Hello I would like some help This script blocks below the vehicle hunter would like to put a message when the player attempts to get a message appearing on the vehicle * Vehicle locked for a few minutes * can help me with this ? Sorry mistakes
×
×
  • Create New...