-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
object = createObject ( 980, 2910.4899902344, -683.85998535156, 12.270000457764, 0, 0, 88.886291503906) maker = createMarker ( 2910.4299316406, -683.61999511719, 9.75, "cylinder", 2, 0, 0, 0, 0 ) object2 = createObject ( 980, 3026.1298828125, -686.88000488281, 23.39999961853, 0, 0, 88.907897949219) maker2 = createMarker ( 3026.1799316406, -687.07000732422, 21.129999160767, "cylinder", 2, 0, 0, 0, 0 ) object3 = createObject ( 980, 2914.8701171875, -608.76000976563, 11.210000038147, 0, 0, 89.231903076172) maker3 = createMarker ( 2914.7199707031, -608.51000976563, 8.539999961853, "cylinder", 2, 0, 0, 0, 0 ) object4 = createObject ( 980, 2951.8999023438, -608.34997558594, 8.6899995803833, 0, 0, 89.915710449219) maker4 = createMarker ( 2952, -608.52001953125, 6.0900001525879, "cylinder", 2, 0, 0, 0, 0 ) function gateo ( player ) if ( getElementType ( player ) == "vehicle" ) then player = getVehicleController ( player ) end if ( source == maker ) then local skin = getElementModel ( player ) if ( skin == 164 ) then moveObject ( object, 2800, 2910.4899902344, -683.85998535156, 17.200000762939, 0, 0, 0 ) else outputChatBox ( "sorry, you're not a British Armed Forces member, You can't enter in this base.", player, 255, 0, 0 ) end elseif ( source == maker2 ) then local skin = getElementModel ( player ) if ( skin == 164 ) then moveObject ( object2, 2800, 3026.1298828125, -686.88000488281, 28.299999237061, 0, 0, 0 ) else outputChatBox ( "sorry, you're not a British Armed Forces member, You can't enter in this base.", player, 255, 0, 0 ) end elseif ( source == maker3 ) then local skin = getElementModel ( player ) if ( skin == 164 ) then moveObject ( object3, 2800, 2914.8701171875, -608.76000976563, 16.540000915527, 0, 0, 0 ) else outputChatBox ( "sorry, you're not a British Armed Forces member, You can't enter in this area.", player, 255, 0, 0 ) end elseif (source == maker4 ) then local skin = getElementModel ( player ) if (skin == 164 ) then moveObject ( object4, 2800, 2951.8999023438, -608.34997558594, 13.699999809265, 0, 0, 0 ) else outputChatBox ( "sorry, you're not a British Armed Forces member, You can't enter in this area.", player, 255, 0, 0 ) end end end addEventHandler ( "onMarkerHit", root, gateo ) function getec ( player ) if ( source == maker ) then moveObject ( object, 980, 2910.4899902344, -683.85998535156, 12.270000457764, 0, 0, 0 ) elseif ( source == maker2 ) then moveObject ( object2, 980, 3026.1298828125, -686.88000488281, 23.39999961853, 0, 0, 0 ) elseif ( source == maker3 ) then moveObject (object3, 980 , 2914.8701171875, -608.76000976563, 11.210000038147, 0, 0, 0 ) elseif (source == maker4 ) then moveObject (object4, 980 , 2951.8999023438, -608.34997558594, 8.6899995803833, 0, 0, 0) end end addEventHandler ( "onMarkerLeave", root, getec ) Try it.
-
local gates = {} function gatesLoad() setTimer(function() local xmlNode = xmlLoadFile("gates.xml") if not xmlNode then outputDebugString("Invalid xml file") return end local children = xmlNodeGetChildren(xmlNode) for k, node in ipairs(children) do if xmlNodeGetName(node) == "gate" then local colX, colY, colZ, colSize = tonumber(xmlNodeGetAttribute(node, "colX")), tonumber(xmlNodeGetAttribute(node, "colY")), tonumber(xmlNodeGetAttribute(node, "colZ")), tonumber(xmlNodeGetAttribute(node, "colSize")) local model, posX, posY, posZ = tonumber(xmlNodeGetAttribute(node, "model")), tonumber(xmlNodeGetAttribute(node, "posX")), tonumber(xmlNodeGetAttribute(node, "posY")), tonumber(xmlNodeGetAttribute(node, "posZ")) local rotX, rotY, rotZ = tonumber(xmlNodeGetAttribute(node, "rotX")),tonumber(xmlNodeGetAttribute(node, "rotY")),tonumber(xmlNodeGetAttribute(node, "rotZ")) local team, moveSpeed, moveX, moveY, moveZ = tonumber(xmlNodeGetAttribute(node, "teamLock")), tonumber(xmlNodeGetAttribute(node, "moveSpeed")), tonumber(xmlNodeGetAttribute(node, "moveX")), tonumber(xmlNodeGetAttribute(node, "moveY")), tonumber(xmlNodeGetAttribute(node, "moveZ")) table.insert(gates, {colX, colY, colZ, colSize, model, posX, posY, posZ, rotX, rotY, rotZ, team, moveSpeed, moveX, moveY, moveZ}) end end outputDebugString("Gates successfully loaded") for i,v in ipairs(gates) do local colX, colY, colZ, colSize, model, posX, posY, posZ, rotX, rotY, rotZ, team, moveSpeed, moveX, moveY, moveZ = unpack(v) local col = createColSphere(colX,colY,colZ,colSize) local gate = createObject(model,posX,posY,posZ,rotX,rotY,rotZ) --setElementVisibleTo(col,getRootElement (),false) addEventHandler("onColShapeHit", col, function(hitElement) local theTeam = getPlayerTeam(hitElement) if not theTeam then return end if (getTeamName(theTeam) == "Staff") then moveObject(gate,moveSpeed,moveX,moveY,moveZ, 0, 0, 0) end end ) addEventHandler("onColShapeLeave", col, function(leaveElement) local theTeam2 = getPlayerTeam(leaveElement) if not theTeam2 then return end if (getTeamName(theTeam2) == "Staff") then moveObject(gate,moveSpeed,posX,posY,posZ, 0, 0, 0) end end ) end end , 5000, 1) end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), gatesLoad)
-
elseif (sorce == maker4 ) then You put 'sorce' but is 'source'.
-
Before: for i,v in ipairs(gates) do put: outputChatBox ( "TOTAL GATES: ".. #gates ) for i,v in ipairs(gates) do
-
After this line: local colX, colY, colZ, colSize, model, posX, posY, posZ, rotX, rotY, rotZ, team, moveSpeed, moveX, moveY, moveZ = unpack(v) Put: local colX, colY, colZ, colSize, model, posX, posY, posZ, rotX, rotY, rotZ, team, moveSpeed, moveX, moveY, moveZ = unpack(v) outputChatBox ( tostring ( posX ) ..", ".. tostring ( posY ) ..", ".. tostring ( posZ ) )
-
Are you sure? are the coordinates valid?
-
You can use spawnpoints and set the spawn method at the meta.xml of the zombies resource to use only spawnpoints.
-
Do you get errors on the debugscript?
-
Deberia funcionar entonces.
-
object = createObject ( 980, 2910.4899902344, -683.85998535156, 12.270000457764, 0, 0, 88.886291503906) maker = createMarker ( 2910.5300292969, -683.94000244141, 9.4399995803833, "cylinder", 2, 0, 0, 0, 0 ) object2 = createObject ( 980, 3026.1298828125, -686.88000488281, 23.39999961853, 0, 0, 88.907897949219) maker2 = createMarker ( 3026.7399902344, -686.38000488281, 20.290000915527, "cylinder", 2, 0, 0, 0, 0 ) function gateo ( player ) if ( source == maker ) then local skin = getElementModel ( player ) if ( skin == 164 ) then moveObject ( object, 2500, 2910.4899902344, -683.85998535156, 17.200000762939, 0, 0, 0 ) else outputChatBox ( "", player, 255, 0, 0 ) end elseif ( source == maker2 ) then local skin = getElementModel ( player ) if ( skin == 164 ) then moveObject ( object2, 2500, 3026.1298828125, -686.88000488281, 28.299999237061, 0, 0, 0 ) else outputChatBox ( "", player, 255, 0, 0 ) end end end addEventHandler ( "onMarkerHit", root, gateo ) function getec ( player ) if ( source == maker ) then moveObject ( object, 980, 2910.4899902344, -683.85998535156, 12.270000457764, 0, 0, 0 ) elseif ( source == maker2 ) then moveObject ( object2, 980, 3026.1298828125, -686.88000488281, 23.39999961853, 0, 0, 0 ) end end addEventHandler ( "onMarkerLeave", root, getec )
-
I've tested it on my server and setPedWalkingStyle is always returning 'false'.
-
Use the same script for another one, that's one method.
-
I mean errors on the debugscript.
-
I used the second link that csiguusz posted.
-
You must use the function moveObject
-
Download the resource "zombies" made by Slothman. Link: https://community.multitheftauto.com/in ... ils&id=347
-
He's not using GUI, which you can notice if you read the entire topic ( well, just the first post actually ).
-
Why don't you try them and see if they still work?
-
Vos cambiaste de nombre al recurso del admin panel?
-
timeLimit[source] = setTimer(customTimer(source), 1000, 1) Change that to: timeLimit[source] = setTimer(customTimer, 1000, 1, source) Arguments go after the setTimer arguments list.
-
Eso no funcionara que yo sepa. Talvez para el de 'login' funcione, pero para el otro no.