-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
addEventHandler ( "onResourceStart", resourceRoot, function () local gate1 = createObject(971, 0, 0, 5) local gate2 = createObject(971, 0, 0, 5) local Car1 = createVehicle ( 567, -1736, -2895, 55, 0, 0, 236 ) local Car2 = createVehicle ( 567, -1744, -2913.3000488281, 55, 0, 354.488, 220 ) attachElements( gate1, Car1, 0.4, 6.2, -0.6, 90, 90, 90 ) attachElements( gate2, Car1, 0.4, 13.2, -0.6, 90, 90, 90 ) addVehicleUpgrade ( Car1, 1087 ) addVehicleUpgrade ( Car2, 1087 ) end) function attach(thePlayer) if not isPedInVehicle(thePlayer) then return end local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Admin" ) ) then local vehicle = getPedOccupiedVehicle(thePlayer) local car1gate1 = createObject(971, 0, 0, 5) local car1gate2 = createObject(971, 0, 0, 5) attachElements( car1gate1, vehicle, 0.4, 6.2, -0.6, 90, 90, 90 ) attachElements( car1gate2, vehicle, 0.4, 13.2, -0.6, 90, 90, 90 ) addVehicleUpgrade ( vehicle, 1087 ) end end addCommandHandler ( "spatula", attach) You can't check onResourceStart if is admin, that makes no sense.
-
I doubt that's a gate that can be opened, you can try opening all gates and see if it opens too. for i=0, 49 do setGarageOpen(i, true) end
-
Are you even using the script as you should? it has exported functions, you must use them with another resource.
-
Well, as you may know, scripting takes time, the scripter's time, he could be doing something else.
-
You can't do that, you must create your own. I suggest you to take a look at the DX drawing functions. https://wiki.multitheftauto.com/wiki/DxDrawText
-
That won't work, Dev-Point.
-
set element data when you jail the player and then check it when they try to suicide.
-
I just tested the script and works perfectly, I got moved to the red team. "You've been moved to the red team!"
-
Good job! keep it up.
-
teamRed = createTeam ( "Red", 255, 0, 0 ) teamBlue = createTeam ( "Blue", 0, 0, 255 ) function balanceTeams ( ) local RedCount = countPlayersInTeam ( teamBlue ) local BlueCount = countPlayersInTeam ( teamRed ) if RedCount ~= BlueCount then if RedCount > BlueCount then setPlayerTeam ( source , teamBlue ) elseif RedCount < BlueCount then setPlayerTeam ( source , teamRed ) end outputChatBox ( "You've been moved to the "..getTeamName ( getPlayerTeam ( source ) ):lower ( ).." team!", source ) outputChatBox ( "teamBlue: ".. tostring ( teamBlue ).. "; teamRed: ".. tostring ( teamRed) ) -- You had ouputChatBox end end addEventHandler ( "onPlayerJoin", getRootElement ( ), balanceTeams )
-
function getPlayerFromPartOfName(playerPart) local pl = getPlayerFromName(playerPart) if isElement(pl) then return pl else for i,v in ipairs (getElementsByType ("player")) do if (string.find(getPlayerName(v),playerPart)) then return v end end end end function Jail (player, command, name) if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(player)), aclGetGroup ( "Admin" ) ) then local thePlayer = getPlayerFromPartOfName(name) if not thePlayer then return end if getElementData( thePlayer, "isJailed") then outputChatBox("This player is already in jail.",player,255,0,0) return end setElementPosition ( thePlayer, 52, 2483, 21 ) setElementData ( thePlayer, "isJailed", true ) outputChatBox (name.." has been jailed", getRootElement(), 255, 0, 0, true ) else outputChatBox ("You cannot use this command!", player, 255, 0, 0, true ) end end addCommandHandler("jail",Jail) function Unjail (player, command, name) if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(player)), aclGetGroup ( "Admin" ) ) then local thePlayer = getPlayerFromPartOfName(name) if not thePlayer then return end if not getElementData( thePlayer, "isJailed") then outputChatBox("This player is not in jail.",player,255,0,0) return end setElementPosition ( thePlayer, 72, 2484, 16.3 ) setElementData ( thePlayer, "isJailed", false ) outputChatBox (name.." has been unjailed. Be good now, "..name, getRootElement(), 0, 255, 0, true ) else outputChatBox ("You cannot use this command!", player, 255, 0, 0, true ) end end addCommandHandler("unjail",Unjail) ped1inside = createPed ( 71, 69, 2503, 17) setElementFrozen (ped1inside, false ) setPedRotation (ped1inside, 180)
-
function getPlayerFromPartOfName(playerPart) local pl = getPlayerFromName(playerPart) if isElement(pl) then return pl else for i,v in ipairs (getElementsByType ("player")) do if (string.find(getPlayerName(v),playerPart)) then return v end end end end function Jail (player, command, name) if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(player)), aclGetGroup ( "Admin" ) ) then local thePlayer = getPlayerFromPartOfName(name) if not thePlayer then return end if getElementData( thePlayer, "isJailed") then outputChatBox("This player is already in jail.",player,255,0,0) return end setElementPosition ( thePlayer, 52, 2483, 21 ) setElementData ( thePlayer, "isJailed", true ) outputChatBox (name.." has been jailed", getRootElement(), 255, 0, 0, true ) end end addCommandHandler("jail",Jail) function Unjail (player, command, name) if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(player)), aclGetGroup ( "Admin" ) ) then local thePlayer = getPlayerFromPartOfName(name) if not thePlayer then return end if not getElementData( thePlayer, "isJailed") then outputChatBox("This player is not in jail.",player,255,0,0) return end setElementPosition ( thePlayer, 72, 2484, 16.3 ) setElementData ( thePlayer, "isJailed", false ) outputChatBox (name.." has been unjailed. Be good now, "..name, getRootElement(), 0, 255, 0, true ) end end addCommandHandler("unjail",Unjail) ped1inside = createPed ( 71, 69, 2503, 17) setElementFrozen (ped1inside, false ) setPedRotation (ped1inside, 180)
-
function getPlayerFromPartOfName(playerPart) local pl = getPlayerFromName(playerPart) if isElement(pl) then return pl else for i,v in ipairs (getElementsByType ("player")) do if (string.find(getPlayerName(v),playerPart)) then return v end end end end function Jail (player, command, name) local thePlayer = getPlayerFromPartOfName(name) if thePlayer then if getElementData( thePlayer, "isJailed") then outputChatBox("This player is already in jail.",player,255,0,0) return end setElementPosition ( thePlayer, 52, 2483, 21 ) setElementData ( thePlayer, "isJailed", true ) outputChatBox (name.." has been jailed", getRootElement(), 255, 0, 0, true ) toggleAllControls ( thePlayer, false ) end end addCommandHandler("jail",Jail) function Unjail (player, command, name) local thePlayer = getPlayerFromPartOfName(name) if thePlayer then if not getElementData( thePlayer, "isJailed") then outputChatBox("This player is not in jail.",player,255,0,0) return end setElementPosition ( thePlayer, 72, 2484, 17 ) setElementData ( thePlayer, "isJailed", false ) outputChatBox (name.." has been unjailed. Be good now, "..name, getRootElement(), 0, 255, 0, true ) toggleAllControls ( thePlayer, true ) end end addCommandHandler("unjail",Unjail)
-
function Jail (player, command, name) local thePlayer = getPlayerFromName(name) if thePlayer then if getElementData( thePlayer, "isJailed") then outputChatBox("This player is already in jail.",player,255,0,0) return end setElementPosition ( thePlayer, 52, 2483, 21 ) setElementData ( thePlayer, "isJailed", true ) outputChatBox (name.." has been jailed", getRootElement(), 255, 0, 0, true ) toggleAllControls ( thePlayer, false ) end end addCommandHandler("jail",Jail) function Unjail (player, command, name) local thePlayer = getPlayerFromName(name) if thePlayer then if not getElementData( thePlayer, "isJailed") then outputChatBox("This player is not in jail.",player,255,0,0) return end setElementPosition ( thePlayer, 72, 2484, 17 ) setElementData ( thePlayer, "isJailed", false ) outputChatBox (name.." has been unjailed. Be good now, "..name, getRootElement(), 0, 255, 0, true ) toggleAllControls ( thePlayer, true ) end end addCommandHandler("unjail",Unjail) Should work.
-
Nice, good luck with it .
-
function Jail (player, command, name) local thePlayer = getPlayerFromName(name) if thePlayer then setElementPosition ( thePlayer, 3, 4, 20 ) setElementData ( thePlayer, "isJailed", true ) outputChatBox (name.." has been jailed", getRootElement(), 255, 255, 255, true ) end end addCommandHandler("jail",Jail) function Unjail (player, command, name) local thePlayer = getPlayerFromName(name) if thePlayer then setElementPosition ( thePlayer, 3, 4, 20 ) setElementData ( thePlayer, "isJailed", false ) outputChatBox (name.." has been unjailed", getRootElement(), 255, 255, 255, true ) end end addCommandHandler("unjail",Unjail) Then in your script you check the "isJailed" element data.
-
I suggest setting a element data to the player and then check it when they type /kill and try to open F1.
-
You're welcome.
-
vehicle1 = createVehicle ( 490, 1474.3525390625, 2836.5068359375, 10.8203125 ) function enterVehicle ( thePlayer, seat, jacked ) if ( source == vehicle1 ) and ( getPlayerTeam(thePlayer) and getTeamName(getPlayerTeam(thePlayer)) ~= "Admin" ) then removePedFromVehicle ( thePlayer ) outputChatBox ( "Admin vehicle", thePlayer ) end end addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle )
-
Heat Seeking also explodes before reach it's target?
-
s2 = createBlip( -2519, -623, 133, 23) dutymarker = createMarker(-2519, -623, 131, 'cylinder', 2.0, 255, 0, 0, 150) function interior(thePlayer) setElementInterior ( thePlayer, 5) end addEventHandler("onMarkerHit",dutymarker,interior)
