-
Posts
405 -
Joined
-
Last visited
Everything posted by Vision
-
No description https://community.multitheftauto.com/index.php?p= ... ls&id=5422 DONE
-
It's 'local' not 'tlocal' local gate = createObject(7033, 1943.2998046875, 848.69921875, 6.7266693115234, 0, 0, 90) local marker = createMarker(1947.6999511719, 849.70001220703, 6.6999998092651, "cylinder", 10, 255, 255, 255, 0) function moveGate(psource) moveObject(gate, 5000, 1937.099609375, 843, 10.39999961853) setTimer(moveBack, 5000, 1) end addEventHandler("onMarkerHit", marker, moveGate) function moveBack() moveObject(gate, 5000, 1943.2998046875, 848.69921875, 6.7266693115234) end
-
You can also use: isObjectInACLGroup
-
No problem
-
Here works fine, it opens only for LV team
-
Did you try albers14's code? LVgateL = createObject ( 986, 2497.3999023438, 2769.1999511719, 11.5, 0, 0, 90 ) LVgateR = createObject ( 985, 2497.3999023438, 2777.1000976563, 11.5, 0, 0, 90 ) LVsensor = createColRectangle(2471.5, 2763.2, 50, 20) function LVgateOpen(theColShape) if theColShape == LVsensor then if getElementType(source) == "player" then local LVTeam = getPlayerTeam(source) if ( LVTeam ) then if LVTeam == getTeamFromName('LV') then moveObject(LVgateL, 2000, 2497.3999023438, 2760, 11.5) moveObject(LVgateR, 2000, 2497.3999023438, 2787, 11.5) end end end end end addEventHandler( "onElementColShapeHit", getRootElement(), LVgateOpen ) function LVgateClose(theColShape) if theColShape == LVsensor then if getElementType(source) == "player" then local LVTeam = getPlayerTeam(source) if ( LVTeam ) then if LVTeam == getTeamFromName('LV') then moveObject(LVgateL, 2000, 2497.3999023438, 2769.1999511719, 11.5) moveObject(LVgateR, 2000, 2497.3999023438, 2777.1000976563, 11.5) end end end end end addEventHandler( "onElementColShapeLeave", getRootElement(), LVgateClose )
-
This? function respawn() local accountname = getAccountName (getPlayerAccount(source)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then outputChatBox("* Respawning ALL Empty Vehicles In 5sec, get to your car to keep it!") setTimer(function () local vehicles = getElementsByType ( "vehicle" ) for k, vehicle in ipairs ( vehicles ) do if checkEmpty( vehicle ) then local seats = getVehicleMaxPassengers(vehicle) resetVehicleIdleTime ( vehicle ) respawnVehicle ( vehicle ) end end end, 5000, 1) end end addEvent( "respawn", true ) addEventHandler( "respawn", getRootElement(), respawn ) function respawn60() local accountname = getAccountName (getPlayerAccount(source)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then outputChatBox("* Respawning all empty vehicles in 10 mins, get to your car to keep it!") setTimer(function () triggerServerEvent ( "respawn10", getLocalPlayer() ) end, 600000, 1) end end addEvent( "respawn60", true ) addEventHandler( "respawn60", getRootElement(), respawn60 ) function respawn10() local accountname = getAccountName (getPlayerAccount(source)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then outputChatBox("* Respawning all empty vehicles in 10 secs, get to your car to keep it!") setTimer(function () triggerServerEvent ( "respawn", getLocalPlayer() ) end, 10000, 1) end end addEvent( "respawn10", true ) addEventHandler( "respawn10", getRootElement(), respawn10 ) function checkEmpty( vehicle ) local passengers = getVehicleMaxPassengers( vehicle ) if type( passengers ) == 'number' then for seat = 0, passengers do if getVehicleOccupant( vehicle, seat ) then return false end end end return true end
-
No problem
-
try this local nonOpenables = { --this is easier [287]=true, [285]=true, [193]=true, [192]=true, [191]=true, [294]=true, [82]=true, [83]=true, [84]=true; } base_area69gate1 = createObject ( 2929, 215.99548339844, 1875.40234375, 13.938992500305, 0, 0, 0 ) base_area69gate2 = createObject ( 2929, 211.94564819336, 1875.40234375, 13.938992500305, 0, 0, 0 ) base_area69col = createColCircle ( 213.94564819336, 1875.40234375, 13.938992500305, 7 ) function openbase_area69gates(thePlayer) local skin = getElementModel (thePlayer) if nonOpenables[skin] then moveObject (base_area69gate1, 5000, 218.99548339844, 1875.40234375, 13.938992500305 ) moveObject (base_area69gate2, 5000, 208.94564819336, 1875.40234375, 13.938992500305 ) end end addEventHandler( "onColShapeHit", base_area69col, openbase_area69gates ) function closebase_area69gates(thePlayer) local skin = getElementModel (thePlayer) if nonOpenables[skin] then moveObject (base_area69gate1, 5000, 215.99548339844, 1875.40234375, 13.938992500305 ) moveObject (base_area69gate2, 5000, 211.94564819336, 1875.40234375, 13.938992500305 ) end end addEventHandler( "onColShapeLeave", base_area69col, closebase_area69gates )
-
Skin mod: https://community.multitheftauto.com/ind ... ls&id=2305 https://community.multitheftauto.com/ind ... ls&id=2306 DONE
-
Car mod https://community.multitheftauto.com/index.php?p= ... ls&id=5390 DONE
-
Type on console: start reload
-
Try this clientside local marker = createMarker( 1037.8309326172, -1029.5063476563, 31.1015625, "Cylinder", 1.5, 255, 153, 0, 150) --- marker createMarker ( float x, float y, float z, [string theType, float size, int r, int g, int b, int a] ) GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Label = {} function guiMyCwindow(w,h,t) local x,y = guiGetScreenSize() return guiCreateWindow((x-w)/2,(y-h)/2,w,h,t,false) end windowjob = guiMyCwindow(301,250,"Mchanic job") guiSetVisible(windowjob, false) GUIEditor_Button[1] = guiCreateButton(22,200,108,35,"Mechanic job",false,windowjob) GUIEditor_Label[1] = guiCreateLabel(193,-103,5,5,"",false,windowjob) GUIEditor_Button[2] = guiCreateButton(179,200,110,36,"Cancel",false,windowjob) GUIEditor_Memo[1] = guiCreateMemo(19,33,273,100,"To take mechanic job, press Take job.\n\nIf you don't want to, press Cancel.",false,windowjob) guiMemoSetReadOnly(GUIEditor_Memo[1],true) --It's a memo not an edit function Mecjob(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then if not guiGetVisible(windowjob) then guiSetVisible(windowjob, true) showCursor(true) end end end addEventHandler("onClientMarkerHit", marker, Mecjob) function Mecjobleave(leaveElement) if getElementType(leaveElement) == "player" and (leaveElement == localPlayer) then if guiGetVisible(windowjob) then guiSetVisible(windowjob, false) showCursor(false) end end end addEventHandler("onClientMarkerLeave", marker, Mecjobleave) function joinTeam() triggerServerEvent("setMec",localPlayer) guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[1] , joinTeam, false) function removeMedicWindow() guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[2] , removeMedicWindow, false) addEventHandler("onClientPlayerDamage",root,function(attacker, weapon, bodypart, loss) local localVehicle = getPedOccupiedVehicle(source) team = getPlayerTeam(attacker) if (attacker and getElementType(attacker) == "player" and weapon == 42 and team and getTeamName(team) == "Mechanic") then cancelEvent() -- Cancels the damage cause by the spray if (not isTimer(pause)) then if (health <= 99) then triggerServerEvent("mechanic:repair", localVehicle, attacker) -- Calls the Server Event pause = setTimer(function() end, 1000, 1) -- Makes a timer for the function so it won't fully heal in the first time end end end end)
-
try function makeAltair() outputChatBox ( "Altair Mod - NooP" ) txd = engineLoadTXD ( "altair.txd" ) engineImportTXD ( txd, 258 ) dff = engineLoadDFF ( "altair.dff", 258 ) engineReplaceModel ( dff, 258 ) end addEventHandler ( "onClientResourceStart", resourceRoot, makeAltair ) function setAltair() setElementModel ( getLocalPlayer(), 258 ) end addCommandHandler("altair", setAltair)
-
checkGateMarker = createMarker ( 2463.6999511719, 1963.3000488281, 10.800000190735, "corona", 9.0, 0, 0, 255, 0 ) function createGate () gatePolice1 = createObject ( 971, 2463.7998046875, 1963.19921875, 13.5, 0, 0, 179.99450683594) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createGate ) function gateCheckingTeam ( hitPlayer, matchingDimension ) if getElementType (hitPlayer) =="player" then moveObject ( gatePolice1, 1000, 2455, 1963.1999511719, 13.5 ) end end addEventHandler ( "onMarkerHit", checkGateMarker, gateCheckingTeam ) function movingBackPolice ( thePlayer, matchingDimension ) moveObject ( gatePolice1, 1000, 2463.7998046875, 1963.19921875, 13.5 ) end addEventHandler ( "onMarkerLeave", checkGateMarker, movingBackPolice )
-
EDIT: https://community.multitheftauto.com/index.php?p= ... ls&id=1284 https://community.multitheftauto.com/index.php?p= ... ls&id=2425 https://community.multitheftauto.com/index.php?p= ... ls&id=1303 https://community.multitheftauto.com/index.php?p= ... ls&id=1576 DONE
-
It worked here perfectly
-
----SPAWN-System-By-ElMota--- createTeam("Admin",180,0,0) createTeam("Todos",0,180,0) addEventHandler("onPlayerLogin",root,function(_,acc) fadeCamera(source,true) setCameraTarget(source) local accName = getAccountName(acc) if isObjectInACLGroup("user."..accName, aclGetGroup("Admin")) then local posX = getAccountData(acc,"PosX") local posY = getAccountData(acc,"PosY") local posZ = getAccountData(acc,"PosZ") local Skin = getAccountData(acc,"Skin") local dim = getAccountData(acc,"Dimension") local int = getAccountData(acc,"Int") local theTeam = getTeamFromName("Admin") if not posX and not posY and not posZ and not Skin and not dim and not int then spawnPlayer(source,posX,posY,posZ,0,Skin,dim,int,theTeam) elseif posX and posY and posZ and Skin and dim and int then spawnPlayer(source,247.00835, 1859.81372, 14.08401,0,282,0,0,theTeam) end else local theTeamE = getTeamFromName("Todos") if not posX and not posY and not posZ and not Skin and not dim and not int then spawnPlayer(source,-342.89999389648,1541.8000488281,74.900001525879,0,16,0,0,theTeamE) elseif posX and posY and posZ and Skin and dim and int then spawnPlayer(source,posX,posY,posZ,0,Skin,dim,int,theTeamE) end end end) addEventHandler("onPlayerQuit",root,function() local playeraccount = getPlayerAccount (source) if (playeraccount) and not isGuestAccount(playeraccount) then local posX,PosY,PosZ = getElementPosition(source) setAccountData(playeraccount,"PosX",posX) setAccountData(playeraccount,"PosY",posY) setAccountData(playeraccount,"PosZ",posZ) local skin = getElementModel(source) setAccountData(playeraccount,"Skin",skin) local dim = getElementDimension(source) setAccountData(playeraccount,"Dimension",dim) local int = getElementInterior(source) setAccountData(playeraccount,"Int",int) end end) addEventHandler("onPlayerWasted",root,function(_,acc,killer) if killer ~= acc then local accName = getAccountName(acc) if isObjectInACLGroup("user."..accName, aclGetGroup("Admin")) then spawnPlayer(source,247.00835, 1859.81372, 14.08401,0,282,0,0,theTeam) elseif not isObjectInACLGroup("user."..accName, aclGetGroup("Admin")) then spawnPlayer(source,-342.89999389648,1541.8000488281,74.900001525879,0,16,0,0,theTeamE) end end end )
-
TAPL's code is working, but he forgot to put 'acc' on line 10
-
Try this ----SPAWN-System-By-ElMota--- createTeam("Admin",180,0,0) createTeam("Todos",0,180,0) addEventHandler("onPlayerLogin",root,function() local acc = getPlayerAccount(source) if isObjectInACLGroup ("user."..tostring(acc), aclGetGroup ( "Admin" ) ) then local posX = getAccountData(acc,"PosX") local posY = getAccountData(acc,"PosY") local posZ = getAccountData(acc,"PosZ") local Skin = getAccountData(acc,"Skin") local dim = getAccountData(acc,"Dimension") local int = getAccountData(acc,"Int") local theTeam = getTeamFromName("Admin") if not posX and not posY and not posZ and not Skin and not dim and not int then spawnPlayer(source,247.04785, 1860.30615, 14.08401,0,282,0,0,getPlayerTeam(theTeam)) elseif posX and posY and posZ and Skin and dim and int then spawnPlayer(source,posX,posY,posZ,0,Skin,dim,int,theTeam) end elseif not isObjectInACLGroup ("user."..tostring(acc), aclGetGroup ( "Admin" ) ) then local theTeamE = getTeamFromName("Todos") if not posX and not posY and not posZ and not Skin and not dim and not int then spawnPlayer(source,-342.89999389648,1541.8000488281,74.900001525879,0,16,0,0,theTeamE) elseif posX and posY and posZ and Skin and dim and int then spawnPlayer(source,posX,posY,posZ,0,Skin,dim,int,theTeamE) end end end ) addEventHandler("onPlayerQuit",root,function() local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local posX,PosY,PosZ = getElementPosition(source) setAccountData(playeraccount,"PosX",posX) setAccountData(playeraccount,"PosY",posY) setAccountData(playeraccount,"PosZ",posZ) local skin = getElementModel(source) setAccountData(playeraccount,"Skin",skin) local dim = getElementDimension(source) setAccountData(playeraccount,"Dimension",dim) local int = getElementInterior(source) setAccountData(playeraccount,"Int",int) end end )
-
Awesome
-
Nice tut, good job
-
executeSQLCreateTable ( "test", "username TEXT" ) function addInfoToSQL() local sourcename = getPlayerName ( source ) local acc = getAccountName ( getPlayerAccount ( source ) ) result = executeSQLSelect ( "test", "username", "username = '" .. getAccountName(getPlayerAccount(source)) .. "'" ) if ( result == false ) then outputChatBox ( "This is your first time here! Welcome " .. sourcename .. "!", source ) executeSQLInsert ( "players","'" .. getAccountName(getPlayerAccount(source)) .. "'" ) else outputChatBox ( "Welcome back " .. acc .. "!", source ) -- what should I put here to get player username ? executeSQLUpdate ( "test", "username = '" .. sourcename .. "'" ) end end addEventHandler ( "onPlayerLogin", getRootElement(), addInfoToSQL)
