-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
addEventHandler("onPlayerChat",root, function (msg, msgType) local canChat = getElementData(source,"canChat") local r, g, b = getPlayerNametagColor(source) if (msgType == 0 and canChat) then outputChatBox(getPlayerName(source) .. ': #FFFFFF' .. msg, root, r, g, b, true) elseif (msgType == 2 and getPlayerTeam(source) and not canChat) then for index, player in ipairs(getPlayersInTeam(getPlayerTeam(source))) do outputChatBox("[TEAM]: ".. getPlayerName(source) .. ': #FFFFFF' .. msg, player, r, g, b, true) end end cancelEvent() end ) If that's not what you wanted, then you should either search for someone who understand's you in your native language or learn to fix your problem on your own.
-
Pues entonces mejor que aprendas ingles .
-
I don't know, maybe you can make a check to see if the target is the same as current. Something like this could work: local targeting = {} function onPlayerTarget ( targetElem ) if (targetElem and isElement(targetElem) and targeting[source] ~= targetElem) then if (getElementType ( targetElem ) == 'player') then exports.global:sendLocalMeAction(source, "tinteste spre ".. getPlayerName(targetElem) ..".") elseif (getElementType ( targetElem ) == 'vehicle' ) then exports.global:sendLocalMeAction(source, "tinteste spre ".. getVehicleName(targetElem) ..".") end targeting[source] = targetElem end end addEventHandler ( "onPlayerTarget", getRootElement(), onPlayerTarget )
-
function onPlayerTarget ( targetElem ) if (targetElem and isElement(targetElem)) then if (getElementType ( targetElem ) == 'player') then exports.global:sendLocalMeAction(source, "tinteste spre ".. getPlayerName(targetElem) ..".") elseif (getElementType ( targetElem ) == 'vehicle' ) then exports.global:sendLocalMeAction(source, "tinteste spre ".. getVehicleName(targetElem) ..".") end end end addEventHandler ( "onPlayerTarget", getRootElement(), onPlayerTarget ) Do you mean that?
-
You can try checking if the player is on a vehicle. function weaponSwitch ( previousWeaponID, currentWeaponID ) if isPedInVehicle(source) then return end if (currentWeaponID == 3) then exports.global:sendLocalMeAction(source, "scoate un baston de politist.") elseif (currentWeaponID == 4) then exports.global:sendLocalMeAction(source, "scoate un cutit.") elseif (currentWeaponID == 2) then exports.global:sendLocalMeAction(source, "scoate o crosa de golf.") elseif (currentWeaponID == 5) then exports.global:sendLocalMeAction(source, "scoate o bata de baseball.") elseif (currentWeaponID == 6) then exports.global:sendLocalMeAction(source, "scoate o lopata.") elseif (currentWeaponID == 7) then exports.global:sendLocalMeAction(source, "scoate o bata de biliard.") elseif (currentWeaponID == -- s8) --> then exports.global:sendLocalMeAction(source, "scoate o sabie.") elseif (currentWeaponID == 9) then exports.global:sendLocalMeAction(source, "scoate o drujba.") elseif (currentWeaponID == 22) then exports.global:sendLocalMeAction(source, "scoate un pistol.") elseif (currentWeaponID == 23) then exports.global:sendLocalMeAction(source, "scoate un pistol cu amortizor.") elseif (currentWeaponID == 24) then exports.global:sendLocalMeAction(source, "scoate un pistol.") elseif (currentWeaponID == 25) then exports.global:sendLocalMeAction(source, "scoate un shotgun.") elseif (currentWeaponID == 26) then exports.global:sendLocalMeAction(source, "scoate un shotgun improvizat.") elseif (currentWeaponID == 27) then exports.global:sendLocalMeAction(source, "scoate un shotgun de elita.") elseif (currentWeaponID == 28) then exports.global:sendLocalMeAction(source, "scoate un Uzi.") elseif (currentWeaponID == 29) then exports.global:sendLocalMeAction(source, "scoate un MP5.") elseif (currentWeaponID == 30) then exports.global:sendLocalMeAction(source, "scoate un Ak-47.") elseif (currentWeaponID == 31) then exports.global:sendLocalMeAction(source, "scoate un M4.") elseif (currentWeaponID == 32) then exports.global:sendLocalMeAction(source, "scoate un Tech-9.") elseif (currentWeaponID == 34) then exports.global:sendLocalMeAction(source, "scoate un Sniper.") end end addEventHandler ( "onPlayerWeaponSwitch", getRootElement(), weaponSwitch ) -- When someone changes his weapon, a local me action is sent P.S: Don't listen to Evil, he keep's posting random stuff to increase his post count.
-
And you haven't renamed the "extrahealth" resource to something else?
-
https://wiki.multitheftauto.com/wiki/ES/ ... B3n_de_GUI
-
addEventHandler("onPlayerChat",root, function (msg, msgType) local canChat = getElementData(source,"canChat") local r, g, b = getPlayerNametagColor(source) if (msgType == 0 and canChat) then cancelEvent() outputChatBox(getPlayerName(source) .. ': #FFFFFF' .. msg, root, r, g, b, true) else cancelEvent() end if (msgType == 2 and getPlayerTeam(source)) then if (canChat) then cancelEvent() for index, player in ipairs(getPlayersInTeam(getPlayerTeam(source))) do outputChatBox("[TEAM]: ".. getPlayerName(source) .. ': #FFFFFF' .. msg, player, r, g, b, true) end else outputChatBox("Warring- You Cant Type in This Chat !",source,255,255,255,true) end end end )
-
You're welcome. Topic locked.
-
Tema cerado.
-
function giveAdminRights (playerSource, commandName, accountName, groupName) if (accountName and accountName ~= "" and groupName and groupName ~= "") then aclGroupAddObject (aclGetGroup(groupName), "user."..accountName) outputChatBox ("Account '".. accountName .."' succesfully added to '".. groupName .."'", playerSource) else outputChatBox ("Correct syntax: /groupadd [accountName] [groupName]", playerSource) end end addCommandHandler ("groupadd", giveAdminRights)
-
@Draken: Your code is wrong . local current local songID = { [ 1 ] = 'Your sound url / directory', [ 2 ] = 'Your sound url / directory', [ 3 ] = 'Your sound url / directory' } addEventHandler ( 'onClientResourceStart', resourceRoot, function ( ) local sound = songID [ math.random ( #songID ) ] current = playSound ( sound, false ) setRadioChannel ( 0 ) end ) function radioOff ( ) setRadioChannel ( 0 ) cancelEvent ( ) end addEventHandler ( 'onClientPlayerRadioSwitch', root, radioOff ) addEventHandler ( 'onClientPlayerVehicleEnter', root, radioOff ) addCommandHandler ( 'sound', function ( command, id ) local id = tonumber(id) if isElement ( current ) then destroyElement ( current ) end if ( songID[id] ) then current = playSound ( songID[id], false ) end end )
-
Vehicle mod: https://community.multitheftauto.com/index.php?p= ... ls&id=3959
-
addEvent("onMapStarting",true) addEventHandler("onMapStarting",root, function () for index, player in ipairs(getElementsByType"player") do showPlayerHudComponent ( player, "all", false ) end end )
-
You should learn to use the 'search' feature, this question has been asked before. viewtopic.php?f=91&t=35564&p=373950&hilit=onClientClick function onPedClick(button, state, absX, absY, wx, wy, wz, element) if (element and getElementType(element) == "ped" and state=="down") then local x, y, z = getElementPosition(localPlayer) if (getDistanceBetweenPoints3D(x, y, z, wx, wy, wz) <=3) then guiSetVisible(myGUIElement, true) end end end addEventHandler("onClientClick", getRootElement(), onPedClick)
-
You want to save the original lights and set them when cancel? if so, try this: local oRed, oGreen, oBlue = 255, 255, 255 lights = guiCreateWindow(259,238,290,202,"Vehicle Headlight - $2500",false) guiSetVisible(lights, false) redEdit = guiCreateEdit(110,54,100,21,"255",false,lights) guiEditSetMaxLength ( redEdit, 3 ) greenEdit = guiCreateEdit(110,87,100,21,"255",false,lights) guiEditSetMaxLength ( greenEdit, 3 ) blueEdit = guiCreateEdit(110,125,100,21,"255",false,lights) guiEditSetMaxLength ( blueEdit, 3 ) redtx = guiCreateLabel(39,58,64,19,"Red, 0-255:",false,lights) greentx = guiCreateLabel(24,93,75,19,"Green, 0-255:",false,lights) bluetx = guiCreateLabel(32,129,67,17,"Blue, 0-255:",false,lights) buyVLightsButton = guiCreateButton(97,176,70,17,"Purchase",false,lights) cancelPurchaseButton = guiCreateButton(166,176,74,17,"Cancel",false,lights) addEventHandler("onClientGUIChanged", root, function () if (source == redEdit or source == greenEdit or source == blueEdit) then local red = guiGetText ( redEdit ) local green = guiGetText ( greenEdit ) local blue = guiGetText ( blueEdit ) if ( red ~= "" and green ~= "" and blue ~= "" and tonumber(red) and tonumber(green) and tonumber(blue) ) then local veh = getPedOccupiedVehicle ( localPlayer ) if (veh) then setVehicleHeadLightColor(veh, red, green, blue) end end end end ) addEventHandler ( 'onClientGUIClick', root, function ( ) if (source == bMechanicNine ) then guiSetInputEnabled(true) guiSetVisible(lights, true) guiSetVisible(wMechanic, false) local veh = getPedOccupiedVehicle ( localPlayer ) if (veh) then oRed, oGreen, oBlue = getVehicleHeadLightColor(veh) end elseif ( source == buyVLightsButton ) then local red = guiGetText ( redEdit ) local green = guiGetText ( greenEdit ) local blue = guiGetText ( blueEdit ) if ( red ~= "" and green ~= "" and blue ~= "" and tonumber(red) and tonumber(green) and tonumber(blue) ) then if ( isPedInVehicle ( localPlayer ) ) then local veh = getPedOccupiedVehicle ( localPlayer ) triggerServerEvent("onHeadLightsChange",localPlayer,veh,red,green,blue) guiSetInputEnabled(false) guiSetVisible ( lights, false ) guiSetVisible(wMechanic, true) else outputChatBox ( 'You are not in a vehicle!' ) end end elseif ( source == cancelPurchaseButton ) then guiSetInputEnabled(false) guiSetVisible ( lights, false ) showCursor ( false ) guiSetVisible(wMechanic, true) local veh = getPedOccupiedVehicle ( localPlayer ) if (veh) then setVehicleHeadLightColor(veh, oRed, oGreen, oBlue) end end end )
-
local x = 1088.0643310547 local y = 1074.5938720703 local z = 10.838157653809 local skin = 2 local weapon = 38 local team = terrorist local mode = "hunting" local interior =0 local dimension = 0 local rot = 90 function Destroyer () local bot = call (getResourceFromName("slothbot"), "spawnBot", x, y, z, rot, skin, interior, dimension, team, weapon, mode, modesubject) exports["extrahealth"]:setElementExtraHealth(bot, 9999) end addEventHandler ( "onResourceStart", resourceRoot, Destroyer )
-
team1 = createVehicle ( 470, -1490.802734375, 2642.0087890625, 55.8359375, 0, 0, 0 ) team2 = createVehicle ( 470, -1490.802734375, 2642.0087890625, 55.8359375, 0, 0, 0 ) -- i know same coords just for showing militaryVehicles = { [team1]=true, [team2]=true } militaryTeams = {["Military"]=true, ["Naval"]=true} function lockTheHydras(player, seat, jacked) if ( militaryVehicles[source] ) and ( getPlayerTeam( player ) ) and ( not militaryTeams[getTeamName(getPlayerTeam( player ))] ) and ( seat == 0 ) then outputChatBox ( "You aren't a Military Officer , you mayn't drive this.", player ) --and tell the player why cancelEvent() end end addEventHandler ( "onVehicleStartEnter", getRootElement(), lockTheHydras )
-
@Scooby: He's not using a GTA native interior, he's using a custom interior map. @TheNightRider: I'm not sure if 50p's resource has dimension support.
-
Abri el archivo "modshops.xml" y ahi vas a ver esto: "TransFender"> "1990.6890" Y="2056.8046" Z="9.7844" /> "Loco Low Co."> "2499.6159" Y="-1779.8135" Z="12.3" /> "Wheel Arch Angles"> "-2723.7060" Y="217.2689" Z="3.1133" /> Cambia X, Y, Z que son las coordenadas, y name es el nombre.
-
Ok, mira, arregle un par de errores en el recurso y agregue para que los garajes se puedan editar desde el "modshops.xml", asi es mas facil. Link de descarga: http://www.mediafire.com/?nc6m88u0l8luncc
-
El recurso tiene un "modshops.xml", pero no funciona. Asi que tenes que agregar/editar cada garaje en el archivo 'server.lua".
-
That link doesn't work.