-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
'source' of 'onVehicleDamage' is the vehicle that got damaged, not a player.
-
function enterZone ( thePlayer, matchingDimension ) if ( getElementType ( thePlayer ) == "player" ) then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ( "user.".. accName, aclGetGroup ( "bkz" ) ) then outputChatBox ( "bienvenido a la base BKZ ".. getPlayerName ( thePlayer ), thePlayer, 255, 255, 255, true ) else killPed ( thePlayer ) end end end addEventHandler ( "onColShapeHit", radarC[1], enterZone ) El 'true' al final de outputChatBox es para activar los codigos HEX.
-
function enterZone ( thePlayer, matchingDimension ) if ( getElementType ( thePlayer ) == "player" ) then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ( "user.".. accName, aclGetGroup ( "bkz" ) ) then outputChatBox ( "bienvenido a la base BKZ ".. getPlayerName ( thePlayer ), thePlayer ) else killPed ( thePlayer ) end end end addEventHandler ( "onColShapeHit", radarC[1], enterZone )
-
getElementType(hitElement) == "Player" then 1: No cambiaste hitElement. 2: Es "player", no "Player".
-
Mira, no quiero que te enojes, pero solo necesitas un ARGUMENTO, borra hitElement y remplazalo en el script con thePlayer.
-
Aun no entendes como usar los argumentos ... function markerHit(thePlayer, hitElement, matchingDimension) Para que pusiste thePlayer y hitElement?
-
function playerTeamC () local playerTeam = getPlayerTeam ( source ) outputChatBox ( getTeamName ( playerTeam ), source ) end addEventHandler ( "onPlayerSpawn", root, playerTeamC)
-
May I ask, what are you doing here if you're not using the help I gave you? why aren't you using the script I posted?
-
There's no event handler on that line.
-
I would create one table and then store every map as a row.
-
If the colshape is sucessfully created, then I don't see why it's causing that error.
-
local playerZones = { } addEventHandler ( "onResourceStart", resourceRoot, function ( ) for index, player in ipairs ( getElementsByType ( "player" ) ) do playerZones [ player ] = createColTube ( 0, 0, 0, 10.0, 100.0 ) attachElements ( playerZones [ player ], player, 0, 0, 0 ) setElementData ( playerZones [ player ], "zoneOwner", player ) addEventHandler ( "onColShapeHit", playerZones [ player ], zoneEnter ) end end ) function createZone ( ) playerZones [ source ] = createColTube ( 0, 0, 0, 10.0, 100.0 ) attachElements ( playerZones [ source ], source, 0, 0, 0 ) setElementData ( playerZones [ source ], "zoneOwner", source ) addEventHandler ( "onColShapeHit", playerZones [ source ], zoneEnter ) end addEventHandler ( "onPlayerJoin", root, createZone ) function destroyZone ( ) if ( isElement ( playerZones [ source ] ) ) then destroyElement ( playerZones [ source ] ) end end addEventHandler ( "onPlayerQuit", root, destroyZone ) function zoneEnter ( ) local zoneOwner = getElementData ( source, "zoneOwner" ) if ( zoneOwner ) then outputChatBox ( "A Player is in Your Zone!", zoneOwner ) end end function giveMoney ( ) for index, player in ipairs ( getElementsWithinColShape ( playerZone, "player" ) ) do givePlayerMoney ( player, 5000 ) end end addEventHandler ( "onPlayerWasted", root, giveMoney ) Only thing I didn't understood was the giveMoney function.
-
Just attach it when a player joins, also when the resource starts, loop players and create them as well.
-
for index, player in ipairs ( getElementsWithinColShape ( theColshape, "player" ) ) do -- Your code here. end
-
1: The problem is that you set as window variable name: "windowjob", but is: "GUIEditor_Window[1]". 2: You must hide the window just after created. local marker = createMarker( 1954.3000488281, -2174.5, 12.5, "Cylinder", 1.5, 0, 0, 255, 150) GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Window[1] = guiCreateWindow(204,89,235,437,"SWAT Job",false) guiSetVisible ( GUIEditor_Window[1], false ) GUIEditor_Button[1] = guiCreateButton(11,384,79,39,"Take Job",false,GUIEditor_Window[1]) GUIEditor_Memo[1] = guiCreateMemo(9,28,217,321,"Welcome To Swat Job.To Take This Job Press \"Take Job\".IF you want to close this window press \"Cancel\"",false,GUIEditor_Window[1]) guiMemoSetReadOnly(GUIEditor_Memo[1],true) GUIEditor_Button[2] = guiCreateButton(103,384,79,39,"Cancel",false,GUIEditor_Window[1]) function SWATjob(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then if not guiGetVisible(GUIEditor_Window[1]) then guiSetVisible(GUIEditor_Window[1], true) showCursor(true) end end end addEventHandler("onClientMarkerHit", marker, SWATjob) function SWATjobleave(leaveElement) if getElementType(leaveElement) == "player" and (leaveElement == localPlayer) then if guiGetVisible(GUIEditor_Window[1]) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor(false) end end end addEventHandler("onClientMarkerLeave", marker, SWATjobleave) function joinTeam() triggerServerEvent("setSWAT",localPlayer) guiSetVisible ( GUIEditor_Window[1], false ) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[1] , joinTeam, false) function removeSWATWindow() guiSetVisible ( GUIEditor_Window[1], false ) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[2] , removeSWATWindow, false)
-
createColTube attachElements givePlayerMoney
-
Does the map name has multi quote characters ( ' ) in it?
-
You have a missing "
-
The problem must be on the meta.xml, as the only problem I see in your script is at this line: addEventHandler('onClientResourceStart',root, If you set it as "root", every time a resource starts ( ANY RESOURCE ) it'll execute that code, so you should change it to: addEventHandler('onClientResourceStart',resourceRoot, Post your "meta.xml" content.
-
No, if you replace one model, you replace all.