-
Posts
1,056 -
Joined
-
Last visited
Everything posted by Sasu
-
I want that create dx when a player join.
-
Try my resource. https://community.multitheftauto.com/index.php?p= ... ls&id=6772
-
function select() addEventHandler("onClientRender", getLocalPlayer(), draw) showCursor(true) setElementFrozen(localPlayer, true) end addEventHandler("onClientPlayerJoin", getLocalPlayer(), onSelectLanguage) Why this dont work?
-
playerAcc is not defined. OFF: another sasuke EDIT: I changed and it works. Thanks you and Pain. function chatNil(message, messageType) if messageType == 0 then if ( isGuestAccount(getPlayerAccount(source))) then cancelEvent() end end end addEventHandler("onPlayerChat", root, chatNil)
-
Cancel event if the Player isnt logged in.
-
Why it isn't cancel event? function chatNil(message, messageType) if messageType == 0 then local playerAcc = getPlayerAccount(source) if (not playerAcc) then cancelEvent() end end end addEventHandler("onPlayerChat", root, chatNil)
-
Por que no agrega un row ? server: function obtenermiembros(playerName, info) if (not getElementData(source, "Gang") == "None") then local gangName = getElementData(source, "Gang") playerName = executeSQLQuery("SELECT Nombre FROM members WHERE gangName=?", gangName ) triggerClientEvent("gangMiembros", source, playerName) end end addEventHandler("onPlayerLogin", root, obtenermiembros) client: function miembros(playerName, info) for _, nombres in ipairs(playerName) do local row = guiGridListAddRow ( playerGangList ) guiGridListSetItemText ( playerGangList, row, nameColumn, playerName, false, false ) end end addEvent("gangMiembros", true) addEventHandler("gangMiembros", root, miembros)
-
function cursorMecanico(button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement) if (state == "down" and clickedElement and getElementType(clickedElement) == "vehicle") then if (getElementHealth(clickedElement) <= 999) then setElementHealth(clickedElement, 1000) setElementPosition(clickedElement, worldX, worldY, worldZ+2) givePlayerMoney(1000) outputChatBox("Has reparado un auto por lo tanto has ganado $1000.", 255, 255, 0) end end end addEventHandler("onClientClick", root, cursorMecanico) Oh yes thanks. But when I click on vehicle, its explode. Why?
-
Yes ! I can not find the server ! Here, too, at the bottom of Chat ! https://community.multitheftauto.com/ind ... ew&id=6772 I know that there are some scripts to move Window life, armor, money, but Window to chat - I can not find ! generally have at least some options to move it down ? This my photo. I extend the lines because I am admin on Proyecto SX
-
Why this dont work? :C function cursorMecanico(button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement) if (state == "down" and clickedElement and getElementType(clickedElement) == "vehicle") then if (getElementHealth(clickedElement) <= 99) then setElementHealth(clickedElement, 100) givePlayerMoney(1000) outputChatBox("Has reparado un auto por lo tanto has ganado $1000.", 255, 255, 0) end end end addEventHandler("onClientClick", root, cursorMecanico) And no error.
-
Server: exports.scoreboard:addScoreboardColumn("Gang") function check() local account = getPlayerAccount(source) if getAccountData(account, "Gang") then setElementData(source, "Gang", getAccountData(account, "Gang")) else setElementData(source, "Gang", None) end end addEventHandler("onPlayerLogin", root, check) function crearTabla() check = executeSQLQuery("CREATE TABLE IF NOT EXISTS gangSystem(gangs TEXT, members TEXT, infoGang TEXT)") if check then outputDebugString("Creando tabla 'gangSystem'... Se ha creado correctamente") else outputDebugString("Ha ocurrido un error al crear las tablas") end end addEventHandler("onResourceStart", resourceRoot, crearTabla) function crearGang(thePlayer, gangName, liderName) liderText = "lider" infoGang = "Bienvenido al gang "..gangName.."." crear = executeSQLQuery("INSERT INTO gangSystem(gangs, members, infoGang) VALUES(?,?=?=?,?)", gangName, liderText, gangName, liderName, infoGang) local account = getPlayerAccount(thePlayer) setAccountData(account, "Gang", tostring(gangName)) setElementData(thePlayer, "Gang", tostring(gangName)) if crear then outputDebugString("Se ha creado un gang con nombre: "..gangName.." el cual el lider es "..liderName) end end addEvent("onCreateGang", true) addEventHandler("onCreateGang", resourceRoot, crearGang) function obtenerlider(playerName, info) if (not getElementData(source, "Gang") == "None") then local gangName = getElementData(source, "Gang") info = executeSQLQuery("SELECT infoGang FROM gangSystem WHERE ?", gangName ) triggerClientEvent("gangLider", source, playerName, info) end end addEventHandler("onPlayerLogin", root, obtenerlider) Client(a part): function crearGang(thePlayer, gangName, liderName) gangName = guiGetText(gangEdit) liderName = getPlayerName(localPlayer) if gangName then triggerServerEvent("onCreateGang", getRootElement(), getLocalPlayer(), gangName, liderName) end end function miembros(playerName, info) local row = guiGridListAddRow ( playerGangList ) guiGridListSetItemText ( playerGangList, row, nameColumn, getPlayerName ( playerName ), false, false ) guiSetText(infoMemo, info) end addEvent("gangLider", true) addEventHandler("gangLider", root, miembros) I want to save the info gang and set text in the infoMemo. Also I want to create a row with the leader but I cant. Can you help me?
-
Esto me marea un poco. Primera vez que uso SQL. Alguna idea como puedo distinguir el lider del gang . function crearGang(thePlayer, gangName, liderName) liderText = "lider" crear = executeSQLQuery("INSERT INTO gangSystem(gangs, members) VALUES(?,?=?=?)", gangName, liderText, gangName, liderName) local account = getPlayerAccount(thePlayer) setAccountData(account, "Gang", gangName) setElementData(thePlayer, "Gang", gangName) if crear then outputDebugString("Se ha creado un gang con nombre: "..gangName.." el cual el lider es "..liderName) end end addEvent("onCreateGang", true) addEventHandler("onCreateGang", resourceRoot, crearGang)
-
What event can I select to change text? function checkLanguage() local item = guiComboBoxGetSelected(languageCheck) local text = guiComboBoxGetItemText(languageCheck, item) if text == "Español" then guiSetText(gangWindow, "Sistema de Gang V1.0") guiSetText(nameColumn, "Nombre") guiSetText(accountColumn, "Cuenta") guiSetText(addPlayerButton, "Agregar jugador") guiSetText(closeButton, "Cerrar") elseif text == "English" then guiSetText(gangWindow, "Gang System V1.0") guiSetText(nameColumn, "Name") guiSetText(accountColumn, "Account") guiSetText(addPlayerButton, "Add player") guiSetText(closeButton, "Close") end end addEventHandler("onClientGUIChanged", languageCheck, checkLanguage, false) I tried with onClientGUIClick and onClientGUIChanged but nothings happen.
-
Resulta que al final le faltaba crear la funcion "Salir" y estaba pasando mal los argumentos en triggerServerEvent. Solucionado!
-
JesusAliso cuando vaya a mi casa , lo hago, lo testeo y te lo paso.
-
function tienda() Window = guiCreateWindow(243,181,555,488,"Tienda de Armas/Weapon Shop",false) imagen4 = guiCreateStaticImage(0.0595,0.0902,0.2414,0.2172,"images/SNIPER.png",true,Window) imagen3 = guiCreateStaticImage(0.618,0.1004,0.2577,0.207,"images/M4.png",true,Window) imagen2 = guiCreateStaticImage(0.6505,0.5861,0.2306,0.2582,"images/MP5.png",true,Window) imagen1 = guiCreateStaticImage(0.0865,0.5922,0.2126,0.2275,"images/GRENADE.png",true,Window) Sniper = guiCreateButton(0.0631,0.3217,0.2324,0.1352,"Sniper/Costo:155000$",true,Window) M4 = guiCreateButton(0.6144,0.3217,0.2523,0.127,"M4/Costo:120000$",true,Window) Grenade = guiCreateButton(0.0649,0.8525,0.2559,0.1291,"Grenade/Costo:20000$x1",true,Window) MP5 = guiCreateButton(0.6432,0.8504,0.2685,0.1311,"MP5/Costo:25000$",true,Window) Cerrar = guiCreateButton(0.355,0.5082,0.2162,0.168,"Cerrar/Close",true,Window) addEventHandler ( "onClientGUIClick", Cerrar, Salir, false ) addEventHandler ( "onClientGUIClick", M4, arma1, false ) addEventHandler ( "onClientGUIClick", Sniper, arma2, false ) addEventHandler ( "onClientGUIClick", Grenade, arma3, false ) addEventHandler ( "onClientGUIClick", MP5, arma4, false ) guiSetVisible (Window,false) end addEventHandler("onClientResourceStart", root, tienda) Te dije q lo pongas abajo.
-
Lo de addEventHandler lo debes agregar despues de la funcion.
-
No estas creando la gui x ningun lado. Agrega esto en el client side: addEventHandler("onClientResourceStart", root, tienda)
-
Yo solo decia para que se de cuenta. Y en giveWeapon le ponga thePlayer.