Jump to content

Al3grab

Members
  • Posts

    431
  • Joined

Everything posted by Al3grab

  1. You have some errors .. local unique = md5(math.random(1,999)..'smama') function start() Speedboost = { createMarker (-3004,-841,0.11,"corona",10,255,0,0,105), } for i,v in pairs(Speedboost) do setElementData(v, unique, true, false) end end addEventHandler ( "onClientResourceStart",resourceRoot, start ) Multiplier = 5.0 function SpeedBoost (player) if player ~= getLocalPlayer() then return end if not getElementData(source, unique) then return end if getElementType(player) == "player" then if isPedInVehicle ( player ) then local car = getPedOccupiedVehicle(player) if getVehicleController(car) == player then speedx, speedy, speedz = getElementVelocity ( car ) speedcnx = (speedx*Multiplier) speedcny = (speedy*Multiplier) speedcnz = (speedz*Multiplier) setElementVelocity ( car, speedcnx-1.2,speedcny,speedcnz) fixVehicle(car) playSoundFrontEnd(46) end end end end addEventHandler ( "onClientMarkerHit",root, Speed)
  2. safecol = createColCuboid ( 300.177734375, -2226.9956054688, 17.64, 300, 200, 60 ) safecol2 = createColCuboid (190.32346, 1946.84485,17.7, 200, 150, 60 ) safecol3 = createColCuboid (-398.96045, 1502.05359,75.35696, 200, 150, 60 ) safeZoneRadar = createRadarArea ( 57.57347, 1768.47424, 300, 200, 0, 255, 0, 0 ) safeZoneRadar2 = createRadarArea ( 190.32346, 1946.84485, 200, 150, 0, 0, 0, 0 ) safeZoneRadar3 = createRadarArea ( -398.96045, 1502.05359, 200, 150, 0, 0, 120, 0 ) setElementData (safeZoneRadar, "zombieProof", true) setElementData (safeZoneRadar2, "zombieProof", true) setElementData (safeZoneRadar3, "zombieProof", true) function enterZone( hitElement, matchingDimension) if source == safecol or source == safecol2 or source == safecol3 then if getElementType(hitElement) == "ped" then killPed(hitElement) elseif getElementType(hitElement) == "player" then local acc = getPlayerAccount(hitElement) -- if isGuestAccount(acc) then killPed(hitElement) return end -- local accName = getAccountName(acc) if not isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then killPed(hitElement) end end end end addEventHandler( "onColShapeHit", root, enterZone ) Tested and worked for me , i tested it on this colshape :
  3. The most thing i like in MTA:SE is feature : - On-the-fly (live) Lua syntax checker Adding something like that in your project will be great , good luck .
  4. You should kill the players without account too if isGuestAccount(acc) then killPed(hitElement) return end
  5. The command is 'refresh' , and also make sure of resource permissions ( CHMOD )
  6. safecol = createColCuboid ( 300.177734375, -2226.9956054688, 17.64, 300, 200, 60 ) safecol2 = createColCuboid (190.32346, 1946.84485,17.7, 200, 150, 60 ) safecol3 = createColCuboid (-398.96045, 1502.05359,75.35696, 200, 150, 60 ) safeZoneRadar = createRadarArea ( 57.57347, 1768.47424, 300, 200, 0, 255, 0, 0 ) safeZoneRadar2 = createRadarArea ( 190.32346, 1946.84485, 200, 150, 0, 0, 0, 0 ) safeZoneRadar3 = createRadarArea ( -398.96045, 1502.05359, 200, 150, 0, 0, 120, 0 ) setElementData (safeZoneRadar, "zombieProof", true) setElementData (safeZoneRadar2, "zombieProof", true) setElementData (safeZoneRadar3, "zombieProof", true) function enterZone( hitElement, matchingDimension) if source == safecol or source == safecol2 then if getElementType(hitElement) == "ped" then killPed(hitElement) elseif getElementType(hitElement) == "player" then local acc = getPlayerAccount(hitElement) -- if isGuestAccount(acc) then return end -- local accName = getAccountName(acc) if not isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then killPed(hitElement) end end end end addEventHandler( "onColShapeHit", root, enterZone ) addEventHandler("onColShapeHit",root,function(hitElement,matchingDimension) if source == safecol3 then if getElementType(hitElement) == "ped" then killPed(hitElement) end end end )
  7. Please use ( lua ) button instead of ( Code ) , and good luck !
  8. OR function displayLoadedRes () -- Some stuff... end addEventHandler("onResourceStart",resourceRoot,displayLoadedRes) -- resourceRoot = getResourceRootElement(getThisResource())
  9. addCommandHandler("tp", function() removeEventHandler("onClientPreRender",root,firstPerson) setCameraTarget(localPlayer,localPlayer) end) You can't use gta crosshair while using setCameraMatrix , you will need to make your own
  10. Bump. I know that, but the problem is when you use setCameraMatrix, your crosshair will be locked, you can't aim anything. I saw the script truefps, but that it does is colliding the camera with an object, but what I need is to put the camera beside of the player. I still need this, although it seems to be not possible in MTA, that the weird part. Then make the object beside the player and collide the camera to it !
  11. Can you explain better ?
  12. addCommandHandler("exec",function(Me,Cmd,pName,Cmd,...) -- pName : The other player name | Cmd : the command to execute | ... : arguments if ( exports.global:isPlayerOwner(thePlayer) ) then if ( not pName or not Cmd ) then outputChatBox("Syntax: /"..Cmd.." [player name] [cmd name] [arguments]", Me, 255, 0, 0) return end local args = table.concat({...}," ") local target = getPlayerFromName(pName) if not target then outputChatBox("Player does not exist!",Me,255,0,0,true) return end if executeCommandHandler(Cmd,target,tostring(args)) then outputChatBox("Command Execution successful!", Me, 0, 255, 0) else outputChatBox("Command Execution failed!", Me, 255, 0, 0) end else outputChatBox("This.",Me,255,0,0) end end ) Using this function : https://wiki.multitheftauto.com/wiki/Get ... omNamePart will be good.
  13. Vehz = {} addEvent("sonata2012",true) addEventHandler("sonata2012",root, function() if (getPlayerMoney(source) >= 605000) then takePlayerMoney(source,605000) if Vehz[source] then if isElement(Vehz[source]) then destroyElement(Vehz[source]) end end local x, y, z = getElementPosition(source) Vehz[source] = createVehicle(411, x, y, z) warpPedIntoVehicle(source, Vehz[source]) setCameraMatrix(source, x-2,y-3,z,x,y,z) -- change the math numbers fadeCamera(source, false) setTimer ( fadeCamera , 50000, 1 ,source,true) setTimer ( destroyElement , 50000, 1, Vehz[source]) outputChatBox("#ffffff"..getPlayerName(source).." #ffffff Buy Car ...", root, 255, 0, 0, true) else outputChatBox("You don't have $605000 to buy car", source, 255, 0, 0, true) end end)
  14. It's very easy to enter in Resource Browser. With account name, everybody with some knowledge enters it. nah , they kind of remove the firewall and you can enter without an account
  15. عزيزي عناد كلمة رمضان كريم مو شرط معناها بالي تفهمه انت ، كلمة رمضان كريم بسبب أن الله كرم شهر رمضان وفضله عن باقي الشهور حيث أنزل القرآن فيه وجعله شهر التوبة ، وسؤال ليش نقول القرآن الكريم ؟ بسبب ان الله كرم القرآن عن باقي الكتب السماوية وحفظه من التحريف فـ هل كلمة القرآن الكريم بدعة ! ، وهذا الكلام حسب قناعتي الشخصية وكل شخص وقناعته
  16. I'll be glad to apply for a mod .. this section really need mods , I've been sending reports and i haven't seen any action about them , i have a good knowledge of english , arabic , and scripting and i will be glad to help in the forum
  17. OHHH!!!! So i have to use source? No , addCommandHandler function have 3 parameters : player , command and the passed arguments .. so your function should be "function outputPOS ( player , command )" while player is the player who wrote the command you will use player instead of getRootElement() .. "local x, y, z = getElementPosition( player )" and so on.
  18. kemo = guiCreateStaticImage ( 0,0,799,599, "kemo.png", true ) guiSetVisible(kemo ,false) setTimer(guiSetVisible,10 * 1000,1,kemo ,true) setTimer(guiSetVisible,15 * 1000,1,kemo ,false)
  19. Yes, I know it but the problem is that when you use setCameraMatrix, you can't target anything. Seems like setCameraMatrix locks the ped target. I hope you understand what I mean, because I don't speak english very often. Check this resource by slothman and EvgeniZ and see how it works : https://community.multitheftauto.com/ind ... ls&id=1603
  20. This is how it works .. function myFunc ( ) -- create the function -- add your code end -- close the function addEventHandler("onPlayerSpawn",getRootElement(),myFunc) -- Link the function with the event
  21. You can use these functions to draw the aim cursor getPedTargetStart getScreenFromWorldPosition dxDrawImage
×
×
  • Create New...