-
Posts
476 -
Joined
-
Last visited
-
Days Won
1
Everything posted by iiv03
-
جرب local mycrpmpartner = {} function thePM(thePlayer,commandName,sendToName,...) local pmWords = { ... } local pmMessage = table.concat( pmWords, " " ) if sendToName then if getPlayerFromNamePart2(sendToName) then local toPlayer = getPlayerFromNamePart2(sendToName) if not (toPlayer == thePlayer) then --that () needed if not (pmMessage == "") then outputChatBox("#757575[PM] Message to #ff00ff" .. getPlayerName(toPlayer) .. ":#ffffff " .. pmMessage, thePlayer, 255, 255, 255, true) outputChatBox("#757575[PM] Message from #ff00ff" .. getPlayerName(thePlayer) .. ":#ffffff " .. pmMessage, toPlayer, 255, 255, 255, true) mycrpmpartner[thePlayer]=toPlayer mycrpmpartner[toPlayer]=thePlayer else outputChatBox("#757575[PM]Use:#ff9900 /pm [part of name] [message]", thePlayer, 255, 255, 255, true) end else outputChatBox("#757575[PM] You cannot PM yourself #ff9900!", thePlayer, 255, 255, 255, true) end else outputChatBox("#757575[PM] Player not found! #FFFF00[#ff9900"..sendToName.."#FFFF00]", thePlayer, 255, 255, 255, true) end else outputChatBox("#757575[PM]Use:#ff9900 /pm [part of name] [message]", thePlayer, 255, 255, 255, true) end end addCommandHandler("pm", thePM) function reply(thePlayer,commandName,...) local pmWords = { ... } local pmMessage = table.concat( pmWords, " " ) local toPlayer = mycrpmpartner[thePlayer] if toPlayer and isElement(toPlayer) then if not (pmMessage == "") then outputChatBox("#757575[PM] Message to #ff00ff" .. getPlayerName(toPlayer) .. ":#ffffff " .. pmMessage, thePlayer, 255, 255, 255, true) outputChatBox("#757575[PM] Message from #ff00ff" .. getPlayerName(thePlayer) .. ":#ffffff " .. pmMessage, toPlayer, 255, 255, 255, true) else outputChatBox("#757575[PM]Use:#ff9900 /repm [message]", thePlayer, 255, 255, 255, true) end else outputChatBox("#757575[PM]There is no pm partner", thePlayer, 255, 255, 255, true) end end addCommandHandler("repm", reply) addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() for i,player in pairs(getElementsByType("player")) do bindKey(player,"l","down","chatbox","pm") end for i,player in pairs(getElementsByType("player")) do bindKey(player,"i","down","chatbox","repm") end end) function getPlayerFromNamePart2 ( name ) --MY EPIC PLAYER FIND PART :D if ( name ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do local name_ = getPlayerName ( player ):gsub ( "#%x%x%x%x%x%x", "" ):lower ( ) if name_:find ( tostring ( name ):lower ( ), 1, true ) then return player end end end end addEventHandler ( "onPlayerQuit", getRootElement(), function() mycrpmpartner[source]=nil end)
-
لو يبغى زر يضغطه عشان يسوي الحدث يستخدم bindKey
-
hey i'm forget to telling you so if i set command like this /give bot 5 unknown 3 robot 4 player amount, player amount, player amount smth like this how?
-
ofc but this work in two players if i change value argus_count to 1 will cause a problems ? bcs i'm alone in my local
-
is there a way to get players name like this? name players example : bot , robot, unknown /give bot robot unknown 9999 i mean comes the name of players at according to the mentioning of the names, meaning like if you mentioned 5 names or 2 names depending on the name you want https://wiki.multitheftauto.com/wiki/GetPlayerFromPartialName
-
[DM] NeiT ft. Gteatero ft. nX_ - Demons Skills 3 was really best map in 2019 merry xmas all
-
thank you for answer but what u mean between start and end point? dxDrawText(v, startRectangleX, startRectangleY, sizeX,startRectangleY+sizeY+i,tocolor(255,255,255,255),1,"default-bold","right","center") -- loop almost like this but when i hit (i)*70 the text goes down below It's like I'm moving Y and I haven't touched it
-
hey i have a little problem here when converting a screen from 1600x900 to 800x600 i used some scaling tutorial @IIYAMA so i did loop and had some problem with screen sizes my screen screen user's 800x600: code: local devScreenX = 1920 local devScreenY = 1080 local screenX, screenY = guiGetScreenSize() local scaleValue = screenY / devScreenY scaleValue = math.max(scaleValue, 0.65) -- < here add the limit addEventHandler("onClientResourceStart",resourceRoot, function() setPlayerHudComponentVisible("all", false) end) local dash = { menu = {"Hello There","Hello There2","Hello There3","Hello There4","Hello There5","Hello There6"}, } addEventHandler("onClientRender", root, function () -- create a scaled size local sizeX = scaleValue * 180 local sizeY = scaleValue * 40 -- get the center of the screen local centerX = screenX - screenX local centerY = screenY / 2 -- calculate the starting point of the rectangle local startRectangleX = centerX local startRectangleY = centerY - (sizeY / 0.5) local offsetY = 0 dxDrawRectangle ( startRectangleX, startRectangleY, sizeX, sizeY, tocolor ( 0, 0, 0, 180 ) ) offsetY = offsetY + startRectangleY*0.15 dxDrawRectangle ( startRectangleX, startRectangleY+offsetY, sizeX, sizeY, tocolor ( 0, 0, 0, 180 ) ) offsetY = offsetY + startRectangleY*0.15 dxDrawRectangle ( startRectangleX, startRectangleY+offsetY, sizeX, sizeY, tocolor ( 0, 0, 0, 180 ) ) offsetY = offsetY + startRectangleY*0.15 dxDrawRectangle ( startRectangleX, startRectangleY+offsetY, sizeX, sizeY, tocolor ( 0, 0, 0, 180 ) ) offsetY = offsetY + startRectangleY*0.15 dxDrawRectangle ( startRectangleX, startRectangleY+offsetY, sizeX, sizeY, tocolor ( 0, 0, 0, 180 ) ) offsetY = offsetY + startRectangleY*0.15 dxDrawRectangle ( startRectangleX, startRectangleY+offsetY, sizeX, sizeY, tocolor ( 0, 0, 0, 180 ) ) --[[local offsetY = 0 local posY = startRectangleY * 0.022 dxDrawText("Hello There!", startRectangleX, startRectangleY+posY, sizeX, sizeY,tocolor(255,255,255,255),1,"default-bold","right","top") offsetY = offsetY + startRectangleY * 0.17 dxDrawText("Hello There!", startRectangleX, startRectangleY+offsetY, sizeX, sizeY,tocolor(255,255,255,255),1,"default-bold","right","top") offsetY = offsetY + startRectangleY * 0.15 dxDrawText("Hello There!", startRectangleX, startRectangleY+offsetY, sizeX, sizeY,tocolor(255,255,255,255),1,"default-bold","right","top") offsetY = offsetY + startRectangleY * 0.155 dxDrawText("Hello There!", startRectangleX, startRectangleY+offsetY, sizeX, sizeY,tocolor(255,255,255,255),1,"default-bold","right","top") offsetY = offsetY + startRectangleY * 0.145 dxDrawText("Hello There!", startRectangleX, startRectangleY+offsetY, sizeX, sizeY,tocolor(255,255,255,255),1,"default-bold","right","top") offsetY = offsetY + startRectangleY * 0.15 dxDrawText("Hello There!", startRectangleX, startRectangleY+offsetY, sizeX, sizeY,tocolor(255,255,255,255),1,"default-bold","right","top")]] -- THIS WORK WITHOUT LOOP local posY = startRectangleY * 1.88 for i,v in ipairs(dash.menu) do dxDrawText(v, startRectangleX, posY-startRectangleY+i*57, sizeX, sizeY,tocolor(255,255,255,255),1,"default-bold","right","top") end end)
-
so easy just make other function here we go function openandclose() if removeEventHandler("onClientRender", root, yournamefunctiondx) then removEventHandler("onClientRender", root, yournamefunctiondx) else addEventHandler("onClientRender", root, yournamefunctiondx) end end bindKey("r","down",openandclose) just change the name argument 3 in removeEventHandler addEventHandler good luck
-
because u put bindKey over a function this means that argument 3 is not defined u need to put it under function or do it like that bindKey("r","down", function () end end)
-
thx and i wanna loop only in vehicle infernus so do like this? function test() for id, vehicle in ipairs(getElementsByType("vehicle")) do if vehicle == 411 then setTimer(setVehicleComponentVisible, 100, 1, vehicle, "blablabla", false) end end end addEventHandler("onClientResourceStart", resourceRoot, test) edit: nvm i forget add getElementModel
-
hey why setVehicleComponentVisible not work with createVehicle?
-
EDIT2: i got here table why?? addEventHandler("onMapStarting", root, updateKiller) function updateKiller(player) if getElementData(player, "state") == "alive" then setElementHealth(player,0) end end i'm trying now like this but there is no error in debug function updateKiller() if getElementData(source,"state") == "alive" then setTimer(function () setElementHealth(source,0) end, 2500, 0) end end
-
hello guys i have two problem so when player write a command /garage he move into garage tunning i wanna do like if he staying in garage he start giving like slap.. so i used this setTimer(function () killPlayer(player) end, 5000, 1) he gives once and this setTimer(function () setElementHealth(player,0) end, 5000, 1) problem two if a player is in a garage and there is a random map the problem is that he moves to the spawn map and i wan't like this. i want if he is in a garage he stays in a garage If he is out player return to spawn map so what i use for functions? onMapStarting getElementData setElementData like this? EDIT:: the first problem i fixed i think problem it was on number 1 i mean here end, 5000, 1) i changed to 0 and work so could anyone help me in problem two?
-
thx for help i forget that's but u remember me
-
something like this? local gOutput = false function project1() if gOutput == true then outputChatBox("1") --elseif outputChatBox == false then if gOutput == false then outputChatBox("2") end end end addCommandHandler("code", project1) it's just random between ("1,2")
-
i wanna do like something start first local gOutput = false but i forget... can u remember it to me? excuse
-
hey yo all i have simple question if i write one command that come outputchatbox ("1") and if i type it again come outputchatbox ("2") i wan't it by math.random is there some other way? thx
-
hey JeViCo i use on onClientClick and i put each mouse1 push into another function addEventHandler("onClientClick", root, tabsPage) so.. my problem in function is already handled how stop this spamming? and If it is a large number of players give lag
-
Hi all i have a problem here, i added an onClientClick when i pressed the button i used this isCursorWithin getKeyState I did if i pressed the button then delete the render to the first page i also added another render to the second page soo.. , i made buttons on the first page and when i pressed the button above this will delete render the first page and comes on the second page like this the problem is if i click on the second page and i close the panel and open it again comes Render event first page with second page i don't know how fix that this my code: -- TABS ON TOP function tabsPage() local offsetX = 0 if getKeyState("mouse1") then if isCursorWithin(posX, referee.y, sizeX, sizeY) then outputChatBox("page 1") addEventHandler("onClientRender", root, referee.dxPage1) addEventHandler("onClientClick", root, onClickPage1) -- playersPanel = false removeEventHandler("onClientRender", root, referee.dxPage2) -- end offsetX = offsetX + textmoveX + textmoveX if isCursorWithin(posX - textmoveX + offsetX, referee.y, sizeX, sizeY) then outputChatBox("page 2") removeEventHandler("onClientRender", root, referee.dxPage1) removeEventHandler("onClientClick", root, onClickPage1) -- addEventHandler("onClientRender", root, referee.dxPage2) -- end end end -- WHEN PLAYER PRESS KEY TO OPEN PANEL function Opendx() referee.ShowDxPanel = not referee.ShowDxPanel if referee.ShowDxPanel then referee.tick = getTickCount() removeEventHandler("onClientRender", root, referee.render) removeEventHandler("onClientRender", root, referee.dxPage1) showCursor(true) addEventHandler("onClientRender", root, referee.render) addEventHandler("onClientRender", root, referee.dxPage1) addEventHandler("onClientClick", root, onClickPage1) addEventHandler("onClientClick", root, tabsPage) else removeEventHandler("onClientClick", root, onClickPage1) removeEventHandler("onClientClick", root, tabsPage) showCursor(false) referee.tick = getTickCount() end end bindKey("f2", "down", Opendx) could someone help me please? EDIT: i'm fixed like this if removeEventHandler("onClientRender", root, referee.dxPage2) then addEventHandler("onClientRender", root, referee.dxPage1) end but in debug i get already handled how fix this error's? ?
-
other question ^^ how make color in table like "Running" i wanna give color green and "Waiting" give color orange etc... is there a way?
-
have question when i moved the coordinates and they do not move why? dxDrawText(column[1], referee.x + textmoveX + moveSide, referee.y + positionY, sizeX, sizeY + offsetY,tocolor(255,255,255,255*referee.getPanelAlpha), referee.fontSize, referee.font, "center","top",false) offsetY = offsetY + referee.y it's not move like this Running Waiting etc..
-
in first, i'm test dxdrawtext like this function referee.renderColumns() --for i, column in ipairs (columns) do dxDrawText("test", referee.x + textmoveX + moveSide, referee.y + positionY, sizeX, sizeY,tocolor(255,255,255,255*referee.getPanelAlpha), referee.fontSize, referee.font, "center","top",false) -- offsetY = offsetY + column.height --end end and work but when put table give me error hm does not work attempt to index field 'status' (a nil value)
-
function Opendx() referee.ShowDxPanel = not referee.ShowDxPanel if referee.ShowDxPanel then referee.tick = getTickCount() removeEventHandler("onClientRender", root, referee.renderColumns) showCursor(true) addEventHandler("onClientRender", root, referee.renderColumns) --addEventHandler("onClientClick", root, onClick) else --removeEventHandler("onClientClick", root, onClick) showCursor(false) referee.tick = getTickCount() end end bindKey("f2", "down", Opendx)