Jump to content

MitnickP56

Members
  • Posts

    42
  • Joined

  • Last visited

Everything posted by MitnickP56

  1. Yes. I'm tried now to change source-> theplayer and nothing. I have no idea how the fix it.
  2. Hi. I'm trying to create script which doing outputChatBox when GUY from name/serial will say smth on chat box. My code: serialhaza = { ["2B2BEE3C8B7C95BA25F714E7867557F2"] = true } function nahaza(thePlayer) local hazik = string.find(getPlayerName(thePlayer), "Haze", 1, true) if hazik or serialhaza[getPlayerSerial(thePlayer)]then outputChatBox("haz ciapaty pedal",thePlayer) end end addEventHandler("onPlayerChat",root,nahaza)
  3. Hi. I'm trying to do script while which block control HORN from other keys than ( H // CAPSLOCK) Code server: function klakson (source) if (isKeyBound (source,"capslock")) or (isKeyBound (source,"h")) then setControlState (source, "horn", true ) outputChatBox ("on",getRootElement(),255,0,0,true) -- only information else toggleControl ( "horn", false ) outputChatBox (source,"off",getRootElement(),255,0,0,true) -- only information end end addEventHandler ("onClientResourceStart",getRootElement(),klakson) Any ideas? ;/
  4. Rly thanks. working One more question. How I can add here blowVehicle? after setElementPosition.
  5. Hi. It's my code : function warent ( posX, posY, posZ ) for i ,v in ipairs (getElementsByType("player")) do if getElementData(v,"state") == "alive" then setElementPosition ( v, 200, 150, 15 ) end end end bindKey("enter","down",warent) Idk why not working. Scripts is without debug. 0 errors.
  6. Hi. I have problem with healthbar (my edit) original: https://community.multitheftauto.com/in ... ls&id=9135 All can see on the picture. In random healthbar 0% and in this script 22% http://iv.pl/images/65963762101610373676.png Code: local screenW,screenH = guiGetScreenSize() local resW,resH = 1280,720 local sW,sH = (screenW/resW), (screenH/resH) function drawVehicleHUD() local vehicle = getPedOccupiedVehicle( getLocalPlayer() ) if ( vehicle ) then --local speedX, speedY, speedZ = getElementVelocity ( vehicle ) --local actualSpeed = (speedX^2 + speedY^2 + speedZ^2)^(0.5) --local KMH = math.floor(actualSpeed*180) if ( getElementHealth( vehicle ) >= 1000 ) then vehiclehealth = 100 else vehiclehealth = math.floor(getElementHealth ( vehicle )/10) end dxDrawRectangle(1079*sW, 578*sH, 191*sW, 17*sH, tocolor(0, 0, 0, 180), true) dxDrawRectangle(1084*sW, 583*sH, 181*sW, 17*sH, tocolor(0, 0, 0, 80), true) dxDrawRectangle(1084*sW, 583*sH, 181*sW/100*vehiclehealth, 10*sH, tocolor(8, 252, 104, 255), true) --dxDrawText("HEALTH", 1084*sW, 683*sH, 1265*sW, 700*sH, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, true, false, false) --dxDrawRectangle(1079*sW, 646*sH, 191*sW, 27*sH, tocolor(0, 0, 0, 180), true) --dxDrawText(KMH.." KM/H", 1084*sW, 651*sH, 1265*sW, 668*sH, tocolor(255, 255, 255, 255), 1.15, "default-bold", "center", "center", false, false, true, false, false) dxDrawText(vehiclehealth.."%", 1203*sW, 1020*sH, 1260*sW, 270*sH, tocolor(0, 255, 0, 255), 1.00, "default-bold", "center", "center", false, false, true, true, false) end end addEventHandler("onClientRender", root, drawVehicleHUD) Please help.
  7. Yup look, If player say troll then -- he's outputChatBox( Troll ) - sv message he's messagee and sv message
  8. Hi. I don't know how to make it. I wanna create script when someone say in chat: 1.Someone said troll 2. outputchatbox from sv: -- troll -- (next line after someone tell this 'troll') Idk how do it, onPlayerChat . Please help troll -> information (outputChatBox("#ffffffTroll",255,255,255,true)
  9. Hi, I tried to make fps checker. smth like Nick his fps = (fps) . but with fps<=35 I wanna change 10.0001 to 10 Nick fps; 30.00333 -> Nick fps: 30 with timer 1 sec Code: local fps = false function getCurrentFPS() -- Setup the useful function return fps end setTimer(getCurrentFPS, 1000, 0) local function updateFPS(msSinceLastFrame) -- FPS are the frames per second, so count the frames rendered per milisecond using frame delta time and then convert that to frames per second. fps = (1 / msSinceLastFrame) * 1000 for _, v in ipairs(getElementsByType("player")) do local state = getElementData (v, "state") if state == "alive" then local pokazfps = getCurrentFPS() if (pokazfps <= 35) then outputChatBox(getPlayerName(v).." #fffffffps"..pokazfps, 213, 255, 255, true) end end end end addEventHandler("onClientPreRender", root, updateFPS) This code show:
  10. Hi I have code for alias player, When I type /pma -- doesn't work. addEventHandler("onResourceStart", resourceRoot, function() executeSQLQuery("CREATE TABLE IF NOT EXISTS `players` (`serial` TEXT, `mute` TEXT, `alias` TEXT)") end ) addEventHandler("onPlayerJoin", root, function() local serial = getPlayerSerial(source) local name = getPlayerName(source) local r = executeSQLQuery("SELECT `mute`,`alias` FROM `players` WHERE `serial`=?", serial) if #r == 0 then executeSQLQuery("INSERT INTO `players` (`serial`,`mute`,`alias`) VALUES(?,?,?)", serial, "no", name) else if r[1]["mute"] == "yes" then setPlayerMuted(source, true) outputChatBox(name:gsub("#%x%x%x%x%x%x", "").." has been muted by Console!", root, 255, 0, 0, true) end end end ) addEventHandler("onPlayerQuit", root, function() if isPlayerMuted(source) then else end end ) addEventHandler("onPlayerJoin", root, function() setAlias(source) end ) addEventHandler("onPlayerChangeNick", root, function() setTimer(setAlias, 100, 1, source) end ) function setAlias(source) local find = true local name = getPlayerName(source) local serial = getPlayerSerial(source) local r = executeSQLQuery("SELECT `mute`,`alias` FROM `players` WHERE `serial`=?", serial) for i,v in ipairs(split(r[1]['alias'], 32)) do if v == name then find = false end end if find then executeSQLQuery("UPDATE `players` SET `mute`=?, `alias`=? WHERE `serial`=?", r[1]["mute"], r[1]["alias"].." "..name, serial) end end function findPlayer(name) if name then for i, player in ipairs(getElementsByType("player")) do if string.find(getPlayerName(player):lower(), tostring(name):lower(), 1, true) then return player end end end return false end local alias1 = "" local alias2 = 0 addCommandHandler("pma", function(p, _, t) local target = findPlayer(t) if target then local serial = getPlayerSerial(target) local r = executeSQLQuery("SELECT `mute`,`alias` FROM `players` WHERE `serial`=?", serial) local spl = split(r[1]["alias"], 32) for i, v in ipairs(spl) do if alias1 == "" then alias1 = v alias2 = alias2 + 1 else alias1 = alias1..", "..v alias2 = alias2 + 1 end if i == #spl then outputChatBox(alias1, p, 255, 255, 255, true) alias1 = "" alias2 = 0 end end end end ) Debugscript;
  11. Hi, I have problem about rgbtohex code: (If someone has logged in administrator then outputchatbox ( info) ). function pokazloginy(thePlayer) local team = getPlayerTeam(thePlayer) local r, g, b = getTeamColor(team) local hex = RGBToHex (r, g, b) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then outputChatBox ( hex..getPlayerName(thePlayer).." #CFECECADMINIST#ff3301", root, 255, 255, 255, true) end end addEventHandler("onPlayerLogin",root, pokazloginy) function RGBToHex(red, green, blue, alpha) if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then return nil end if(alpha) then return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha) else return string.format("#%.2X%.2X%.2X", red,green,blue) end end Debugscript:
  12. Yes I made it client sided but what do you want? do you want the player fly more than one meter? No, look. If I using this cmd for urself then I fly good, when I trying to use on other player then this not working.
  13. So, it's working on client-side. outputchatbox is correct but when I wanna use this on other player then he fly 1 meter and back on the road.
  14. code: function fly(cmd,targetPlayer) local vehicle = getPedOccupiedVehicle(targetPlayer) local localPlayerName = getPlayerName(getLocalPlayer()) if (isVehicleOnGround( vehicle ) == true) then local sx,sy,sz = getElementVelocity ( vehicle ) setElementVelocity( vehicle ,sx+0.5, sy, sz+0.6 ) outputChatBox(localPlayerName.." #CFECEC was KICKED #ffcc33UP UP #00ff33", 213, 255, 255, true) end end addCommandHandler("flyman",fly) debugscript (client-side); -||- (server-side):
  15. Ehh, not working 100%. Look 2 players. test1 and test2 when test1 write /flyman test2 -- then jumping test1 not test2 . What I need to change ?
  16. Hi, I found code: bindKey ( "lshift","down", function () local vehicle = getPedOccupiedVehicle(localPlayer) if (isVehicleOnGround( vehicle ) == true) then local sx,sy,sz = getElementVelocity ( vehicle ) setElementVelocity( vehicle ,sx, sy, sz+0.3 ) end end ) I'm trying to change it to command. (addCommandHandler) I can't do it - someone can help me ? cmd: flyman nick
  17. debugscript ; when I change to: outputChatBox(getPlayerName(player).." #CFECEC lagging his ping: #ff0000:"..pingus,root, 255, 96, 96, true) debugscript:
  18. Hi. Yesterday one guy was help me on script. It's a checker ping. function detektor() for i, player in ipairs(getElementsByType("player")) do if (getPlayerPing(player) >= 150) then outputChatBox(getPlayerName(player).." #CFECEC lagging his ping: #ff0000"..getPlayerPing(player),root, 255, 96, 96, true) end end end setTimer(detektor, 1000, 0) Today I wanna add ' script work only for ALIVE players. So I tried. function detektor () for i, player in ipairs(getElementsByType("player")) do if getElementData(v,"state") == "alive" then local pingus = (getPlayerPing(player) >= 100) outputChatBox(getPlayerName(v):gsub("#%x%x%x%x%x%x","").." #CFECEC lagging his ping: #ff0000:"..pingus,root, 255, 96, 96, true) end end end setTimer(detektor, 1000, 0) debugscript:
×
×
  • Create New...