
pocko
Members-
Posts
101 -
Joined
-
Last visited
Everything posted by pocko
-
when i enter and write /pm and name not open the gui window
-
Hi all i tryed to make somethink like pm script but in gui window.But somewhere have problem please help local Window = {} local Memo ={} local Edit = {} local Button = {} local Label = {} local g_Me = getLocalPlayer() local g_ResRoot = getResourceRootElement() local g_Root = getRootElement() local w,h = guiGetScreenSize( ) active,typing,out = 0 local function click(button,state) if button ~= "left" then return end local pname = getElementType(source) == "gui-window" and string.sub(guiGetText(source),13) or string.sub(guiGetText(getElementParent(source)),13) guiSetVisible(Label[pname][1],false) guiSetVisible(Label[pname][2],false) active = pname guiSetInputEnabled(false) if source == Edit[pname] then guiSetInputEnabled(true) elseif getElementType(source) == "gui-button" then if guiGetText(source) == "Close" then guiSetVisible(Window[pname],false) active = nil showCursor(false) guiSetVisible(Label[pname][1],true) guiSetVisible(Label[pname][2],true) guiSetInputEnabled(false) end elseif guiGetText(source) == "Ignore" then pm_ignore(pname,source) end end function openPM(pname,quiet) pname = string.upper(pname) if Window[pname] then if guiGetAlpha(Window[pname]) < 0.11 then guiSetAlpha(Window[pname],0.6) if quiet then setTimer(loseAlpha,2000,1,Window[pname]) end else guiSetVisible(Window[pname],not guiGetVisible(Window[pname])) if quiet and guiGetVisible(Window[pname]) then setTimer(loseAlpha,2000,1,Window[pname]) end end return end Window[pname] = guiCreateWindow(0.55*w,0.55*h,0.35*w,0.225*h,"PM Window - " .. tostring(pname),false) guiSetAlpha(Window[pname],0.6) guiWindowSetSizable(Window[pname],false) local w,h = guiGetSize(Window[pname],false) Memo[pname] = guiCreateMemo(0.025*w,25,0.95*w,h-25-(0.225*h),"",false,Window[pname]) guiMemoSetReadOnly(Memo[pname],true) guiSetProperty(Memo[pname],"ForceVertScrollbar","True") guiSetProperty(Memo[pname],"VertScrollPosition","0.5") Edit[pname] = guiCreateEdit(0.025*w,h-(0.2*h),0.5*w,0.25*h,"",false,Window[pname]) guiEditSetMaxLength ( Edit[pname], 128 ) addEventHandler('onClientGUIAccepted', Edit[pname],function(active) sendText(active); end) addEventHandler('onClientGUIClick', Window[pname], click) Button[#Button+1] = guiCreateButton(0.75*w,h-(0.2*h),0.225*w,0.25*h,"Close",false,Window[pname]) Button[#Button+1] = guiCreateCheckBox(0.54*w,h-(0.2*h),0.225*w,0.25*h,"Ignore",false,false,Window[pname]) local ilist,xml,xmlNode,serial = nil, xmlLoadFile("pm_settings.xml") if xml then xmlNode = xmlFindChild( xml , "ignore" , 0 ) ilist = xmlNodeGetValue(xmlNode) serial = getElementData(getPlayerFromName(pname),"serial") if serial and string.find(ilist," "..serial.." ",0,true) then guiCheckBoxSetSelected( Button[#Button] , true ) end end Label[pname] = {} Label[pname][1] = guiCreateLabel(0,0,1,1,"Press F3 to get mouse control",true,Memo[pname]) guiLabelSetColor(Label[pname][1],255,0,0) guiLabelSetVerticalAlign(Label[pname][1],"center") guiLabelSetHorizontalAlign(Label[pname][1],"center") guiSetVisible(Label[pname][1],false) guiSetEnabled(Label[pname][1],false) Label[pname][2] = guiCreateLabel(0.02,0,1,1,"Click here to type",true,Edit[pname]) guiLabelSetColor(Label[pname][2],255,0,0) guiLabelSetVerticalAlign(Label[pname][2],"center") guiLabelSetHorizontalAlign(Label[pname][2],"left") guiSetVisible(Label[pname][2],false) guiSetEnabled(Label[pname][2],false) if not quiet then showCursor(true) else guiSetVisible(Label[pname][1],true);guiSetVisible(Label[pname][2],true);setTimer(loseAlpha,2000,1,Window[pname]) end end addEvent("newNick",true) addEventHandler("newNick",g_Root, function(old,new) old = string.upper(old) new = string.upper(new) if not Window[old] or Window[new] then return end Window[new] = Window[old] Label[new] = Label[old] Edit[new] = Edit[old] Memo[new] = Memo[old] guiSetText(Window[new],"PM Window - " .. tostring(new)) Window[old] = nil Label[old] = nil Edit[old] = nil Memo[old] = nil end ) function loseAlpha(elem) setTimer(dissapear,50,5,elem) end function dissapear(elem) guiSetAlpha(elem,guiGetAlpha(elem)-0.1) end addEventHandler( "onClientMouseEnter", g_Root, function() if getElementType(source) == "gui-window" and string.sub(guiGetText(source),0,9) == "PM Window" and guiGetAlpha(source) < 0.11 then guiSetAlpha(source,0.6) end end ) function pm_ignore( who , check ) if guiCheckBoxGetSelected(check) then local ilist,xml,xmlNode = nil xml = xmlLoadFile("pm_settings.xml") if not xml then xml = xmlCreateFile("pm_settings.xml", "settings") end xmlNode = xmlFindChild(xml, "ignore" , 0) local serial = getElementData(getPlayerFromName(who),"serial") if not xmlNode then xmlNode = xmlCreateChild(xml, "ignore"); ilist = " "..serial.." " else ilist = xmlNodeGetValue(xmlNode).." "..serial.." " end ilist = string.gsub(ilist," "," ") xmlNodeSetValue(xmlNode, ilist ) xmlSaveFile(xml) else local ilist,xml,xmlNode = nil, xmlLoadFile("pm_settings.xml") if xml then xmlNode = xmlFindChild( xml , "ignore" , 0 ) ilist = xmlNodeGetValue(xmlNode) ilist = string.gsub(ilist," "..getElementData(getPlayerFromName(who),"serial").." "," ") xmlNodeSetValue(xmlNode, ilist ) xmlSaveFile(xml) end end end function sendText( active ) if not active then outputChatBox("No active chat"); return end if not isCursorShowing(g_Me) then return end active = string.sub(guiGetText(getElementParent(active)),13) local text = guiGetText ( Edit[active] ) if not text or string.len(text) < 1 then return end guiSetText( Edit[active] , "" ) guiSetText( Memo[active] , (guiGetText(Memo[active]) ~= "\n" and guiGetText(Memo[active]) or "") .. getPlayerName(g_Me) .. ": " .. text ) triggerServerEvent( "sendText" , g_ResRoot , g_Me , active , text ) guiMemoSetCaretIndex(Memo[active],#guiGetText(Memo[active])) end function getText(from,text) local name = from from = string.upper(from) local ilist,xml,xmlNode = nil, xmlLoadFile("pm_settings.xml") if not getElementData(getPlayerFromName(from),"admin") and xml then xmlNode = xmlFindChild( xml , "ignore" , 0 ) ilist = xmlNodeGetValue(xmlNode) local serial = getElementData(getPlayerFromName(from),"serial") if serial and string.find(ilist," "..serial.." ",0,true) then return end end if not Window[from] or not guiGetVisible(Window[from]) then openPM(from,true) end guiSetText(Memo[from], (guiGetText(Memo[from]) ~= "\n" and guiGetText(Memo[from]) or "") .. name .. ": " .. text) guiMemoSetCaretIndex(Memo[from],#guiGetText(Memo[from])) end addEvent("openPM",true) addEventHandler( "openPM" , g_ResRoot , openPM) addEvent("getText",true) addEventHandler( "getText" , g_ResRoot , getText)
-
Hey i played in one server and saw one scrict.Every 5 minutes on the chat box write one word example : adseeas ,and who write first the word will win money can you tell me the name or someone where have it ?
-
hallo all i need to some advice to make script in freeroam mod to put races how can be this possible ? can someone give me somethink to see ? example every 10-15 minutes to write on this play this :join to /race and when you type /race to enter in race.
-
Here this is the script --these are the banned vehicle ids where you cannot get drift points. local BannedIDs = { 432, 532 } local rootElem = getRootElement() local thisRoot = getResourceRootElement(getThisResource()) local player = getLocalPlayer() local vehicle local size = 1.2 local modo = 0.01 local score = 0 local screenScore = 0 local tick local idleTime local multTime local driftTime local Yellow = tocolor(255,232,25) local Red = tocolor(234,0,3) local TempCol = Yellow local mult = 1 local tablamult = {350,1400,4200,11200} local anterior = 0 local mejor = 0 local total = 0 local global_mejor = 0 local global_nombre = "N/A" local screenWidth, screenHeight = guiGetScreenSize() local x1,y1,x2,y2 = screenWidth*0.2,screenHeight*0.1,screenWidth*0.8,screenHeight*0.8 addEventHandler("onClientResourceStart", thisRoot, function() addEventHandler("onClientRender", rootElem, showText) outputChatBox("Waiting for server drift data...") triggerServerEvent("driftClienteListo", rootElem, player) end ) addEventHandler("onClientResourceStop", thisRoot, function() removeEventHandler("onClientRender", rootElem, showText) end ) function isValidVehicle() local temp = getPedOccupiedVehicle(player) if not temp or getVehicleOccupant(temp,0) ~= player or getVehicleType" class="kw2">getVehicleType(temp) ~= "Automobile" then return false end local vehID = getElementModel(temp) for k,v in ipairs(BannedIDs) do if vehID == v then return false end end return temp end function showText() dxDrawText(string.format("Best Drift: %s - %d",global_nombre,global_mejor),83,screenHeight-82,screenWidth,screenHeight,Yellow,1,"pricedown") vehicle = isValidVehicle() if not vehicle then return end if size > 1.3 then modo = -0.01 elseif size < 1.2 then modo = 0.01 end size = size + modo tick = getTickCount() local angulo,velocidad = angle() local tempBool = tick - (idleTime or 0) < 750 if not tempBool and score ~= 0 then anterior = score setElementData(player, "Last Drift", anterior) total = total+anterior setElementData(player, "Total Drift", total) if score > mejor then mejor = score setElementData(player, "Best Drift", mejor) end triggerEvent("onVehicleDriftEnd", rootElem, tick-driftTime-750) score = 0 end if angulo ~= 0 then if score == 0 then triggerEvent("onVehicleDriftStart", rootElem) driftTime = tick end if tempBool then score = score + math.floor(angulo*velocidad)*mult else score = math.floor(angulo*velocidad)*mult end if TempCol == Red then TempCol = Yellow end screenScore = score idleTime = tick end local temp2 = string.format("Factor: X%d\n%s",mult,mult~=5 and string.format("Gain X%d with %d",mult+1,tablamult[mult]) or "MAX") dxDrawText(temp2, 20,155,screenWidth,screenHeight, Yellow, 1.2, "sans","left","top", false,true,false) if velocidad <= 0.3 and mult ~= 1 then dxDrawText("\n\nToo Slow!", 20,155,screenWidth,screenHeight, Yellow, 1.2, "sans","left","top", false,true,false) end if tick - (idleTime or 0) < 3000 then local temp = "DRIFT" if score >= 100000 then temp = "DRIFT\n\nDrift King!" elseif score >= 50000 then temp = "DRIFT\n\nInsane Drift!" elseif score >= 20000 then temp = "DRIFT\n\nOutrageous!" elseif score >= 15000 then temp = "DRIFT\n\nColossal!" elseif score >= 7000 then temp = "DRIFT\n\nSuberb!" elseif score >= 3000 then temp = "DRIFT\n\nGreat Drift!" elseif score >= 1000 then temp = "DRIFT\n\nGood Drift!" end dxDrawText(temp, x1,y1,x2,y2, TempCol, 2.2, "sans","center","top", false,true,false) dxDrawText(string.format("\n%d",screenScore), x1,y1-10,x2,y2, TempCol, size, "pricedown","center","top", false,true,false) end end function angle() local vx,vy,vz = getElementVelocity(vehicle) local modV = math.sqrt(vx*vx + vy*vy) if not isVehicleOnGround(vehicle) then return 0,modV end local rx,ry,rz = getElementRotation(vehicle) local sn,cs = -math.sin(math.rad(rz)), math.cos(math.rad(rz)) local deltaT = tick - (multTime or 0) if mult~= 1 and modV <= 0.3 and deltaT > 750 then mult = mult-1 multTime = tick elseif deltaT > 1500 then local temp = 1 if score >= 11200 then temp = 5 elseif score >= 4200 then temp = 4 elseif score >= 1400 then temp = 3 elseif score >= 350 then temp = 2 end if temp>mult then mult = temp multTime = tick end end if modV <= 0.2 then return 0,modV end --speed over 40 km/h local cosX = (sn*vx + cs*vy)/modV if cosX > 0.966 or cosX < 0 then return 0,modV end --angle between 15 and 90 degrees return math.deg(math.acos(cosX))*0.5, modV end addEvent("driftCarCrashed", true) addEventHandler("driftCarCrashed", rootElem, function() if score ~= 0 then score = 0 mult = 1 TempCol = Red triggerEvent("onVehicleDriftEnd", rootElem, 0) end end ) addEvent("driftActualizarRecord", true) addEventHandler("driftActualizarRecord", rootElem, function(score, name) global_mejor = score global_nombre = name end ) function resetScore() anterior,mejor,total = 0,0,0 setElementData(player, "Last Drift", anterior) setElementData(player, "Total Drift", total) setElementData(player, "Best Drift", mejor) end addEvent("driftResetAllScores", true) addEventHandler("driftResetAllScores", rootElem, resetScore) addCommandHandler("resetdrift", resetScore) function checkPuntaje() if total > global_mejor then triggerServerEvent("driftNuevoRecord", rootElem, total, getPlayerName(player)) end end addEventHandler("onClientPlayerFinish", rootElem, checkPuntaje) addEventHandler("onClientPlayerOutOfTime", rootElem, checkPuntaje)
-
do you want to write all script to see ?
-
hallo all i want to make somethink but i don t know how function showText() dxDrawText(string.format("Best Drift: %s - %d",global_nombre,global_mejor),44,screenHeight-43,screenWidth,screenHeight,Yellow,1,"pricedown") This print on the displey best drift but when someone making drift don t change it its like in the start writing:Best drift :n/a) i want want when someone make drift to score his rekord there tnx
-
for example to change the classic infernus to diffrent car
-
i want to put new car models
-
Hi all i want to ask for one script where can include cars can you tell me the name ;d?
-
Hallo i need to one seriose scripter.I m made one good mod but i need for some elements let find me Skype:freedoom38 yahoo:messenger:pchaushev msn:[email protected]
-
hallo all i want to modify my scoreboard i use dxscoreboard and i want to remove Chekpoints! how can i make it ?
-
tnx i made it now is ready realy tnx man
-
see i think now must be good ?
-
Solidsnake14 hey maybe i found the problem i think is in the ports becouse i use 27015
-
hallo all i have problem but i don t know how to correct it my server can t see in internet when i type the name ?tnx
-
ok then i need for help i found one script for points but not give a points for all players where fall on dd /dm only to winer and when i write !points no points
-
i realy search anywhere and find nothink becouse i come here and ask i realy hope someone to help