-
Posts
364 -
Joined
-
Last visited
-
Days Won
6
Everything posted by DRW
-
addEvent ("team9", true) addEventHandler ("team9", getRootElement(), function() local account = getPlayerAccount (source) if not isGuestAccount(account) then local accName = getAccountName (account) if isGangMember ("TMK",accName) then setPlayerTeam (source, escuadron17) outputChatBox ("Bienvenido, miembro de TMK.",source, 255,255,255) setElementPosition (source,188.6015625, -299.2578125, 1.578125) triggerClientEvent (source, "amosnose", source) end end end) attempt to call global isGangMember (a nil value). Whats the problem?
-
getElementType expected element at argument 1, got boolean
-
Hello, I want to disable damage dealing only to players if they are in a colshape. I mean, if a player shoots me he won't deal any damage, but if a zombie attacks me, then he will deal damage to me, it's not working. Client-sided colRec = createColRectangle (-1203.599609375, 2814.75, 500,500) colRad = createRadarArea (-782.689453125, 656.4794921875, 1700,2200,0,0,0,100) addEventHandler ("onClientPlayerDamage",localPlayer, function (attacker) if isElementWithinColShape (localPlayer, colRec) and getElementData (attacker, "player") then cancelEvent () end end )
-
Tried it, still not working EDIT: Sorry, I forgot to log in again, thanks!
-
local chat_range = 30 addCommandHandler ("local",function(source,_,...) local nick=getPlayerName(source) local msg = table.concat({...}, " ") if getPlayerTeam(source) then r,g,b = getTeamColor(getPlayerTeam(source)) else r,g,b = getPlayerNametagColor(source) end if isPedInVehicle(source)then for _,v in ipairs(getVehicleOccupants(getPedOccupiedVehicle(source)))do outputChatBox("(Car Chat) "..nick..": "..msg,v,r,g,b,true) end else local px,py,pz=getElementPosition(source) for _,v in ipairs(getElementsByType("player")) do if isPlayerInRangeOfPoint(v,px,py,pz,chat_range)then outputChatBox("(Local) ".. nick ..": "..msg,v,r,g,b,true) end end end end) function talk2 () bindKey (source,"u","down", "chatbox local") end --Here is the bindKey addEventHandler ("onPlayerLogin", getRootElement(), talk2) I'm adding a bind to a command so people can open that chatbox, the chatbox works perfectly if I /bind u chatbox local, but the script does nothing. What can I do?
-
Yes, I changed it but didn't work. But hey, you helped me to solve this viewtopic.php?f=91&t=88021, that is almost the same as this script, thanks!
-
You mean even medic players can't enter the vehicle if yes try this client side function medicenterVehicle ( player, seat, jacked ) if player == getLocalPlayer() then local playerTeam = getPlayerTeam(player) if (playerTeam) then if not (getTeamName(playerTeam) == "Médico") then cancelEvent() outputChatBox ( "Debes de ser un médico para poder entrar al vehículo.", player ) end end end end addEventHandler("onClientVehicleStartEnter",root,medicenterVehicle) Actually, every player can enter a vehicle, doesn't matter if it's in médico team nor in another team, every player can enter
-
Even people of the team can enter a vehicle
-
Yes but it's still not working, same error
-
function medicenterVehicle ( player, seat, jacked ) if not isPlayerInTeam (source, "Médico") then cancelEvent() outputChatBox ( "Debes de ser un médico para poder entrar al vehículo.", player ) end end ERROR: attempt to call global 'isPlayerInTeam' (a nil value) What's wrong?
-
medicVehicles = { [416]=true, [563]=true } medicTeam = { ['Médicos']=true } function medicenterVehicle ( player, seat, jacked ) if ( medicVehicles[getElementModel ( source )] and ( not medicTeam[getPlayerTeam ( player )] ) and seat == 0 ) then cancelEvent() outputChatBox ( "Debes de ser un médico para poder entrar al vehículo.", player ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), medicenterVehicle )
-
Still doesn`t allow the team to enter to the vehicle
-
It said ']' expected near ' so i removed the é and now it says table index is nil
-
I'm editing the https://community.multitheftauto.com/index.php?p= ... ls&id=4058 resource so I can use it in my server. It's supposed to check two vehicles' models and then if a player is not in the team "Médicos" then it won't be able to enter, the problem is that it doesn't even allow people from "Médicos" to enter. What's wrong? medicVehicles = { [416]=true } medicVehicles2 = { [563]=true } medicTeam = { [Médicos]=true } function medicenterVehicle ( player, seat, jacked ) if ( medicVehicles[getElementModel ( source )] ) and --Here is the wrong thing ( not medicTeam[getPlayerTeam ( player )] ) and ( seat == 0 ) then cancelEvent() outputChatBox ( "Debes de ser un médico para poder entrar al vehículo.", player ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), medicenterVehicle )
-
So I'm using a shader to appear only when the GUI is open. It's called blurshader, here it is: https://community.multitheftauto.com/ind ... ls&id=7349 The thing is that I made something to my script to see if it works, and it actually does, for half a second. For some unknown reason the blurshader appears and dissapears at the same moment, I can see the blurshader for less than a second and then dissapears. Nothing in the debugscript. Client-sided only: local root = getRootElement() local resourceRoot = getResourceRootElement(getThisResource()) local screenWidth, screenHeight = guiGetScreenSize() local blurStrength = 6 local myScreenSource = dxCreateScreenSource(screenWidth, screenHeight) addEventHandler("onClientResourceStart", resourceRoot, function() if getVersion ().sortable < "1.3.1" then outputChatBox("Resource is not compatible with this client.") return else blurShader, blurTec = dxCreateShader("shaders/BlurShader.fx") if (not blurShader) then outputChatBox("Could not create blur shader. Please use debugscript 3.") else outputChatBox(blurTec .. " was started.") end end end) local screenW, screenH = guiGetScreenSize() ventanaclases = guiCreateWindow(10, (screenH - 369) / 2, 352, 369, "[ZNEXT] Elección de clases", false) guiWindowSetSizable(ventanaclases, false) labelclases = guiCreateLabel(10, 22, 89, 19, "Elige una clase:", false, ventanaclases) memoclases = guiCreateMemo(124, 43, 218, 316, "¡Bienvenid@ a ZNEXT: Zombies!\nAquí te vamos a enseñar los tipos de clases que puedes elegir a tu comodidad:\n\n\n\nRecibe una flor que sirve como forma de curar a la gente al golpe, además tiene regeneración de vida. Capacidad nula de atacar bases.\n\n\nArregla coches al entrar en ellos y escribir el comando /repararvehiculo. Tardas 10 segundos en repararlo.\n\n\nVende armas al escribir /vender, sus armas son más baratas y recibes menos dinero del que vendes con las armas.\n\n\nPiloto de rescate de Base 17, ayuda a la gente perdida a volver a la base o a transportar gente de un lugar a otro, gana dinero por cada 10 segundos cuando alguien está de copiloto.\n\n\nAsesina gente y gana 1500$, pero a los asesinos también se les captura, por ello, los que asesinen al bandido, ganarán 3000$.\n\n\nSólo está disponible si eres donante del server, pagando con PayPal al menos 2EUR.\n\n\nEl equipo de Staff: Moderadores, Super Moderadores, Community Managers y Admins.\n\n\nNo trabajas en nada, simplemente quieres jugar sin importarte un rol en general.\n\n\nEstos botones están en prueba, los dejamos ahí para evitar crear botones para futuras clases.", false, ventanaclases) guiMemoSetReadOnly(memoclases, true) botclass1 = guiCreateButton(10, 43, 115, 28, "MÉDICO", false, ventanaclases) guiSetFont(botclass1, "default-bold-small") guiSetProperty(botclass1, "NormalTextColour", "FF76EA84") botclass2 = guiCreateButton(10, 71, 115, 28, "MECÁNICO", false, ventanaclases) guiSetFont(botclass2, "default-bold-small") guiSetProperty(botclass2, "NormalTextColour", "FFF5F16C") botclass3 = guiCreateButton(10, 99, 115, 28, "TRAFICANTE", false, ventanaclases) guiSetFont(botclass3, "default-bold-small") guiSetProperty(botclass3, "NormalTextColour", "FFAE2BEB") botclass4 = guiCreateButton(10, 127, 115, 28, "RESCATE AÉREO", false, ventanaclases) guiSetFont(botclass4, "default-bold-small") guiSetProperty(botclass4, "NormalTextColour", "FF17FCEE") botclass5 = guiCreateButton(10, 155, 115, 28, "BANDIDO", false, ventanaclases) guiSetFont(botclass5, "default-bold-small") guiSetProperty(botclass5, "NormalTextColour", "FFCF0505") botclass6 = guiCreateButton(10, 183, 115, 28, "PROTECCIÓN MILITAR", false, ventanaclases) guiSetFont(botclass6, "default-bold-small") guiSetProperty(botclass6, "NormalTextColour", "FF1E641C") botclass7 = guiCreateButton(10, 211, 115, 28, "STAFF", false, ventanaclases) guiSetFont(botclass7, "default-bold-small") guiSetProperty(botclass7, "NormalTextColour", "FFAAAAAA") botclass8 = guiCreateButton(10, 239, 115, 28, "SIN OFICIO", false, ventanaclases) guiSetFont(botclass8, "default-bold-small") guiSetProperty(botclass8, "NormalTextColour", "FFFFFFFF") botclass9 = guiCreateButton(10, 267, 115, 28, "(Botón inútil)", false, ventanaclases) guiSetProperty(botclass9, "NormalTextColour", "FF0E7164") botclass10 = guiCreateButton(10, 295, 115, 28, "(Botón inútil)", false, ventanaclases) guiSetProperty(botclass10, "NormalTextColour", "FF0E7164") botclass11 = guiCreateButton(10, 321, 115, 28, "(Botón inútil)", false, ventanaclases) guiSetProperty(botclass11, "NormalTextColour", "FF0E7164") addEventHandler ("onClientResourceStart", getResourceRootElement(getThisResource()), function () guiSetVisible (ventanaclases, false) end) addEvent ("abrirventana",true) addEventHandler ("abrirventana", getRootElement(), function () setCameraMatrix (-425,2627,86, -514,2589,54) guiSetVisible (ventanaclases, true) if (blurShader) then dxUpdateScreenSource(myScreenSource) dxSetShaderValue(blurShader, "ScreenSource", myScreenSource); dxSetShaderValue(blurShader, "BlurStrength", blurStrength); dxSetShaderValue(blurShader, "UVSize", screenWidth, screenHeight); dxDrawImage(0, 0, screenWidth, screenHeight, blurShader) showCursor (true) end end ) addEventHandler ("onClientGUIClick", botclass1, function () triggerServerEvent ("team1", localPlayer) end ) addEventHandler ("onClientGUIClick", botclass2, function () triggerServerEvent ("team2", localPlayer) end ) addEventHandler ("onClientGUIClick", botclass3, function () triggerServerEvent ("team3", localPlayer) end ) addEventHandler ("onClientGUIClick", botclass4, function () triggerServerEvent ("team4", localPlayer) end ) addEventHandler ("onClientGUIClick", botclass5, function () triggerServerEvent ("team5", localPlayer) end ) addEventHandler ("onClientGUIClick", botclass6, function () triggerServerEvent ("team6", localPlayer) end ) addEventHandler ("onClientGUIClick", botclass7, function () triggerServerEvent ("team7", localPlayer) end ) addEventHandler ("onClientGUIClick", botclass8, function () triggerServerEvent ("team8", localPlayer) end ) addEvent ("amosnose",true) addEventHandler ("amosnose", getRootElement(), function() guiSetVisible (ventanaclases, false) if (blurShader) then destroyElement(blurShader) blurShader = nil setCameraTarget (localPlayer) showCursor (false) end end)
-
addEvent ("team7", true) addEventHandler ("team7", getRootElement(), function(thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) -- get his account name if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then setPlayerTeam (source, admins) setElementPosition (source,-183,2629,63.3) triggerClientEvent (source, "amosnose", source) elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "Moderator" ) ) then setPlayerTeam (source, mods) triggerClientEvent (source, "amosnose", source) setElementPosition (source,-183,2629,63.3) elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "SuperModerator" ) ) then setPlayerTeam (source, mods) triggerClientEvent (source, "amosnose", source) setElementPosition (source,-183,2629,63.3) elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "cmanager" ) ) then setPlayerTeam (source, mods) triggerClientEvent (source, "amosnose", source) setElementPosition (source,-183,2629,63.3) else outputChatBox ("No eres de ningún equipo de Staff.") end end) Errors: attempt to concatenate local "accname" (a boolean value) Bad argument @getPlayerAccount [Expected element at argument 1, got nil] Bad argument @getAccountName [Expected account at argument 1, got boolean] It's not working, why?
-
Wasn't talking exactly about a button inside the gridlist, just inside the window where is the gridlist, that's why I said the button was external. Look at this screenshot: Now, as you can see, there is a gridlist and a button saying "APARECER" (I'm spanish, so the language is). I want to press "Traficante" for example, after that, click the "APARECER" button, and then spawn somewhere and in a custom team, but If press "Médico" and click "APARECER", I'll appear in other position in another custom team.
-
Hello, sorry for this, but I'd want to ask you for what should I use to create a gridlist with for example 2 items in it and with an external GUI button in the same window, so when I select a gridlist item and then click the GUI button it does a function, and when I click a second gridlist item and click the same GUI button then it does another function.
-
Oh I got it, the problem is that I didn't put the min mta version because of the dual weapons flag. Thanks all!
-
It seems to not work to me. It may be a problem of my server or something. Anyways thanks!
-
It's not working very well, actually it does the same as before but now shows up only one weapon.