-
Posts
1,903 -
Joined
-
Last visited
-
Days Won
1
Everything posted by xeon17
-
I tried to do it like you before , but no work.. the weapon no fire ://// on players & vehicles
-
Damn the weapon no fire anymore , nooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo addCommandHandler ('mini', function ( ) local nx, ny, nz = getElementPosition ( localPlayer ) local minigunw = createWeapon ( 'minigun', nx, ny, nz +1 ) setWeaponClipAmmo ( minigunw,99999) setWeaponState ( minigunw,"firing") setWeaponProperty( minigunw, "fire_rotation", 0, -30, 0 ) for _, nMax in ipairs ( getElementsByType ('player' )) do for _, nThat in ipairs ( getElementsByType ('vehicle' )) do x, y, z = getElementPosition ( nMax ) x, y, z = getElementPosition ( nThat ) setWeaponTarget ( minigunw ,nMax, 255 ) setWeaponTarget ( minigunw ,nThat, 255 ) end end end )
-
Ah forget what i said , the problem was the weapons always killed me when i created ( fixed ) can you make the weapons aslo fire on vehicles please ? ._.
-
the problem was in utill function because dosen't work in client side your code is awesome Max+ , but can you make better weapon rotation ? please.
-
It output nothing , the functions are client side ( weapon functions )
-
Fixed ( but still no work ) Code: function weapons ( localPlayer) if not (isAllownedPlayer(localPlayer)) then return end local x,y,z = getElementPosition(localPlayer) local minigunw = createWeapon("minigun", x, y, z + 1) setWeaponClipAmmo ( minigunw,99999) setWeaponState ( minigunw,"firing") for _, player in ipairs(getElementsByType("player")) do xz , xs , xt = getElementPosition (player) setWeaponTarget ( minigunw , xz , xs , xt ) end end end addCommandHandler("mini", weapons)
-
I tried but ._. Nothing happen , no bugs in debug.. function weapons ( localPlayer) if not (isAllownedPlayer(thePlayer)) then return end local x,y,z = getElementPosition(thePlayer) local minigunw = createWeapon("minigun", x, y, z + 1) setWeaponClipAmmo ( minigunw,99999) setWeaponState ( minigunw,"firing") for _, player in ipairs(getElementsByType("player")) do xz , xs , xt = getElementPosition (player) setWeaponTarget ( minigunw , xz , xs , xt ) end end end addCommandHandler("mini", weapons)
-
If I was you I should use what Sasu just said. Ye ye Sasu is pro
-
I did what Et-win said and the code worked ( finally ) Thank you Sasu and thank to everyone who tried to help me.
-
Can anyone fix it ._.
-
i have a error with your code , line : 17 addEventHandler onClientPlayerWeaponSwitch with this function is already handled wtf?
-
The problem isn't in my function, because the function work without problems in all my other commands.. Here is the function function isAllownedPlayer(player) local account = getPlayerAccount(player) if (not account or isGuestAccount(account)) then return false end local accountName = getAccountName(account) for i, v in pairs ( acls ) do if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( v ) ) ) then return true end end outputChatBox("#FFF000[sERVER]#FFFFFF You aren't an admin.", player, 255,255,255, true) return false end I'll check your code and answer soon
-
Like this ? -------------------------------------------------- -- Turn image data into a texture at the client addEvent("onMyClientScreenShot",true) addEventHandler( "onMyClientScreenShot", resourceRoot, function(player, pixels ) if image then destroyElement(image) image = nil end if(pixels) then image = dxCreateTexture( pixels ) end screenShotPlayer = player; end ) -------------------------------------------------- -- Show image addEventHandler( "onClientRender", root, function() if image and isElement(screenShotPlayer) then dxDrawImage( 100, 250, 400, 300, image ) dxDrawText("SS - ".. getPlayerName(screenShotPlayer), 100, 250, 400, 300, tocolor ( 255, 255, 255, 255 ), 1, "pricedown" ) end if myTexture then local sw,sh = guiGetScreenSize () local w,h = dxGetMaterialSize( myTexture ) dxDrawImage( 10, sh/2-h/2, w, h, myTexture ) end end ) addEvent( "onClientGotImage", true ) addEventHandler( "onClientGotImage", resourceRoot, function( pixels ) if(pixels) then myTexture = dxCreateTexture( pixels ) else myTexture = nil end end ) local keyTable = { "mouse1", "mouse2", "mouse3", "mouse4", "mouse5", "mouse_wheel_up", "mouse_wheel_down", "arrow_l", "arrow_u", "arrow_r", "arrow_d", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "num_0", "num_1", "num_2", "num_3", "num_4", "num_5", "num_6", "num_7", "num_8", "num_9", "num_mul", "num_add", "num_sep", "num_sub", "num_div", "num_dec", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", "backspace", "tab", "lalt", "ralt", "enter", "space", "pgup", "pgdn", "end", "home", "insert", "delete", "lshift", "rshift", "lctrl", "rctrl", "[", "]", "pause", "capslock", "scroll", ";", ",", "-", ".", "/", "#", "\\", "=" } addEvent( "onRequestCommandsBoundToKey", true ) addEventHandler( "onRequestCommandsBoundToKey", root, function( theKey, keyState ) triggerServerEvent("onResponseCommandsBoundToKey", localPlayer,theKey, keyState, getCommandsBoundToKey( theKey, keyState )) end )
-
Tried dosen't work i write /tirarsoco and get the outputchatbox , but i still can fire with hands...
-
I got a bug with my screenshot script , idk how to solve.. --Server - Modifikuj -- LocX = 50 -- Lokacija slike X LocY = 50 -- Lokacija slike Y ImageSizeX = 320 -- Sirina slike ImageSizeY = 240 -- Visina slike ImageTimer = 10 -- Koliko ce dugo vremena slika biti prikazana (u sekundama) Quality = 30 -- Kvaliteta slike od 0 do 100 MaxBandwith = 5000 -- Maksimalna brzina slanja slike u Bps (Byte-u po sekundi) -- Ne modifikuj -- CurrentAdmin = nil function getPic(player,command,arg1) if (arg1) then local PlayerX = getPlayerFromID(tonumber(arg1)) if (PlayerX) then CurrentAdmin = player takePlayerScreenShot(PlayerX,ImageSizeX,ImageSizeY,nil,Quality,MaxBandwith) else outputChatBox("Incorrect player ID!",player) end else outputChatBox("Please enter player ID!",player) end end addCommandHandler("ss",getPic,false,false) function onPlayerScreenShotz(res,status,jpeg,timestamp,tag) local player = CurrentAdmin if (status == "ok") then outputChatBox("Screenshot from: " .. tostring(getPlayerName(source)),player) triggerClientEvent(player,"drawMeTheImage",player,jpeg,LocX,LocY,ImageSizeX,ImageSizeY,ImageTimer) elseif (status == "disabled") then outputChatBox("That player has disabled taking screenshots of their screen!",player) elseif (status == "minimized") then outputChatBox("That player has alt-tabbed at this moment!",player) end end addEventHandler("onPlayerScreenShot",getRootElement(),onPlayerScreenShotz) --Client function drawMeTheImage(jpeg,LocX,LocY,ImageSizeX,ImageSizeY,ImageTimer) cjpeg = jpeg cLocX = LocX cLocY = LocY cISX = ImageSizeX cISY = ImageSizeY drawimg = true setTimer(disdraw,ImageTimer * 1000,1) end addEvent("drawMeTheImage", true) addEventHandler("drawMeTheImage",getLocalPlayer(),drawMeTheImage) function disdraw() drawimg = nil end function renderx() if (drawimg) then dxDrawImage(cLocX,cLocY,cISX,cISY,cjpeg) end end addEventHandler("onClientRender",getRootElement(),renderx) The text in Server side is from my language ._. Client bug , bad file path dxDrawImage line 19
-
I tried this , but dosen't work.. addEventHandler("onClientPlayerWeaponFire",root, function ( weapon ) if ( weapon == 0 ) and (getElementData(localPlayer, 'soco') == true) then toggleControl ( "fire", false) else toggleControl ( "fire", true) end end)
-
Sorry for so much double posts ._. but i'll explain everything better now When the player enter event he have the elementdata ''Evento'' and with this command i check have players elementdata ''Evento'' the players who have will get a new elementdata ''soco'' and when a player fire with hands ( fist ) weapon id : 0 then he can't because he have the elementdata ''soco'' my first code worked good ( server side ) but the problem is in client side i think..
-
Ahh , i found the resource https://community.multitheftauto.com/index.php?p= ... ls&id=7766 But i have one more question , does someone know some cool kill messages resource
-
A guy posted this resource in scripting section i seen ( i was on phone ) i can't find the resource now
-
Hello , can someone give me the resource from community to draw images or text when player is downloading. I can't find the resource :-:
-
Problem is clientside..
-
No work , bad argument at getPlayerName got nill. nothing wrong at my other functions..