-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
Help me, a small problem but Idk how to fix it
Castillo replied to montenegro11's topic in Scripting
https://wiki.multitheftauto.com/wiki/Meta.xml https://wiki.multitheftauto.com/wiki/Resources About auto start, go to the end of "mtaserver.conf", there are many resources set to auto start. -
Help me, a small problem but Idk how to fix it
Castillo replied to montenegro11's topic in Scripting
The only way you can run that script is by creating a resource. You can put it to auto start in the mtaserver.conf. -
But these messages only show up to the person who clicks, so what's the problem?
-
You can just check the ped health with getElementHealth. function isClientPedDead ( thePed ) if isElement ( thePed ) then return ( getElementHealth ( thePed ) <= 0 ) else return false end end
-
I don't understand what do you mean.
-
Eso es porque bindKey server-side tiene un argumento de jugador antes de la tecla ( el primer argumento es el jugador al que se le asignara el bind ).
-
Yes, use attachElements.
-
Crea el bind server-side.
-
marker16 = createMarker(-62.98583984375,-1121.4749755859,0.172990322113, "cylinder", 2, 0, 255, 0, 255 ) function PlayerHaveLevel ( hitElement ) if ( getElementType ( hitElement ) == "player" and not isPedInVehicle ( hitElement ) ) then local accName = getAccountName ( getPlayerAccount ( hitElement ) ) if ( isObjectInACLGroup ("user.".. accName, aclGetGroup ( "VIP" ) ) ) then triggerClientEvent ( hitElement, "ShowVipPanel", hitElement ) else outputChatBox ( "Você não e V.I.P para usar esse comando", hitElement ) end end end addEventHandler ( "onMarkerHit", marker16, PlayerHaveLevel ) addEvent( "ClientHaveLevel", true ) addEventHandler( "ClientHaveLevel", getRootElement(), PlayerHaveLevel ) blip = createBlip( -62.98583984375,-1121.4749755859,0.172990322113, 6 )
-
No, the only way to fix it is by obtaining the source code and recompiling with the new MTA compiler.
-
Oh, me equivoque al escribir, perdon. addEventHandler ( "onClientGUIClick", gridlist1, sanfierro, false )
-
function sanfierro ( ) local row, col = guiGridListGetSelectedItem ( gridlist1 ) if ( row and col and row ~= -1 and col ~= -1 ) then local cityName = guiGridListGetItemText ( gridlist1, row, col ) if ( cityName == "San Fierro" ) then guiGridListSetItemText ( gridlist2, guiGridListAddRow ( gridlist2 ), 1, "Civiles", false, false ) guiGridListSetItemText ( gridlist2, guiGridListAddRow ( gridlist2 ), 1, "Agentes Especiales", false, false ) guiGridListSetItemText ( gridlist2, guiGridListAddRow ( gridlist2 ), 1, "Criminales", false, false ) end end end
-
guiGridListGetSelectedItem guiGridListGetItemText
-
if ( getPlayerMoney ( client ) < theMoney ) then return outputChatBox ( "[sHOP] You do not have enough money to buy!", client, 255, 0, 0 ) end Add that before setElementData.
-
Sabes que al mirar el script la primera vez vi que decia "guiCreateGridList" y no "guiGridListSetItemText". @Jesus: Cambia "gui1" en addEventHandler por "gridlist1", y luego tendras que verificar que item clickeo el jugador.
-
Not possible, because you can't attach an event client side to a server side function.
-
Postea el script completo.
-
I tested it and no more errors came but the ones saying the functions used by addEventHandler didn't exist ( obviously, you didn't post them ).
-
Mostrame donde lo pusiste.
-
I don't know where'd you look for errors, but when I executed "vip2" function the debugscript shown many errors. function vip() triggerServerEvent ( "ClientHaveLevel", getLocalPlayer() ) end addCommandHandler ("vip", vip) addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), vip ) function armavip () showCursor (true) triggerServerEvent ( "onGreeting", getLocalPlayer() ) end function armavipsniper () showCursor (true) triggerServerEvent ( "onGreeting4", getLocalPlayer() ) end function equipvip () showCursor (true) triggerServerEvent ( "onGreeting2", getLocalPlayer() ) end function equipvipchezh () showCursor (true) triggerServerEvent ( "onGreeting5", getLocalPlayer() ) end function carr () showCursor (true) triggerServerEvent ( "onGreeting3", getLocalPlayer() ) end function tire () showCursor (true) triggerServerEvent ( "onGreeting6", getLocalPlayer() ) end local tabpanel = {} function vip2() label = { } img = { } tab = { } fundo = { } texto = { } window = guiCreateWindow(0.29, 0.18, 0.46, 0.68, "", true) guiWindowSetSizable(window, false) showCursor ( true ) logo = guiCreateStaticImage(0.06, 0.83, 0.90, 0.13, "images/radio.png", true,window) close = guiCreateButton(430, 26, 25, 25, "X", false,window) guiSetFont(close, "default-bold-small") guiSetProperty(close, "NormalTextColour", "FF960000") tabpanel.mytab = guiCreateTabPanel(0.10, 0.09, 0.80, 0.69, true,window) tabpanel.kit = guiCreateTab("KIT aa",tabpanel.mytab) fundoarmas = guiCreateStaticImage(-26, -37, 427, 403, "images/FUNDO.png", false, tabpanel.kit) guiSetProperty(fundoarmas, "ImageColours", "tl:FF000000 tr:FF000000 bl:FF000000 br:FF000000") label1 = guiCreateLabel(0.24, 0.32, 0.16, 0.09, " M4A1 \n 50 z$", true,fundoarmas) guiSetFont(label1, "default-bold-small") imgm4 = guiCreateStaticImage(0.11, 0.14, 0.31, 0.15, "images/m4a1.png", true,fundoarmas) label2 = guiCreateLabel(0.71, 0.32, 0.16, 0.09, " CZ550 \n 90 z$", true,fundoarmas) guiSetFont(label2, "default-bold-small") img.sniper = guiCreateStaticImage(0.59, 0.14, 0.33, 0.15, "images/sniper.png", true,fundoarmas) ---------------------- tabpanel.itens = guiCreateTab("KIT ITENS",tabpanel.mytab) fundoitens = guiCreateStaticImage(-31, -14, 447, 365, "images/FUNDO.png", false, tabpanel.itens) guiSetProperty(fundoitens, "ImageColours", "tl:FF000000 tr:FF000000 bl:FF000000 br:FF000000") img.coyote = guiCreateStaticImage(0.13, 0.12, 0.26, 0.28, "images/coyote.png", true, fundoitens) img.chezh = guiCreateStaticImage(0.63, 0.12, 0.26, 0.30, "images/chezh.png", true, fundoitens) label.coyote = guiCreateLabel(0.22, 0.43, 0.22, 0.10, "COYOTE \n 60Z$", true, fundoitens) guiSetFont(label.coyote, "default-bold-small") label.chezh = guiCreateLabel(0.71, 0.43, 0.22, 0.10, "CHEZH\n 60Z$", true, fundoitens) guiSetFont(label.chezh, "default-bold-small") tab.mecanico = guiCreateTab("KIT MECÂNICO",tab) fundo.mecanico = guiCreateStaticImage(-7, -7, 393, 352, "images/FUNDO.png", false, tab.mecanico) guiSetProperty(fundo.mecanico, "ImageColours", "tl:FF000000 tr:FF000000 bl:FF000000 br:FF000000") img.engine = guiCreateStaticImage(0.11, 0.14, 0.27, 0.29, "images/engine.png", true, fundo.mecanico) img.tire = guiCreateStaticImage(0.63, 0.14, 0.25, 0.30, "images/wheel.png", true, fundo.mecanico) label.engine = guiCreateLabel(0.20, 0.45, 0.25, 0.12, "ENGINE \n 31 Z$", true, fundo.mecanico) guiSetFont(label.engine, "default-bold-small") label.tire = guiCreateLabel(0.71, 0.45, 0.25, 0.12, "TIRE \n31 Z$", true, fundo.mecanico) guiSetFont(label.tire, "default-bold-small") tab.survivor = guiCreateTab("CREDITOS",tab) fundo.creditos = guiCreateStaticImage(-18, -14, 408, 358, "images/FUNDO.png", false, tab.survivor) guiSetProperty(fundo.creditos, "ImageColours", "tl:FF000000 tr:FF000000 bl:FF000000 br:FF000000") texto.creditos = guiCreateMemo(0.14, 0.23, 0.76, 0.53, "--xD", true, fundo.creditos) guiMemoSetReadOnly(texto.creditos, true) addEvent( "showvip",true ) addEventHandler ( "onClientGUIClick", imgm4, armavip, false ) addEventHandler ( "onClientGUIClick", img.sniper, armavipsniper, false ) addEventHandler ( "onClientGUIClick", img.coyote, equipvip, false ) addEventHandler ( "onClientGUIClick", img.chezh, equipvipchezh, false ) addEventHandler ( "onClientGUIClick", img.engine, carr, false ) addEventHandler ( "onClientGUIClick", img.tire, tire, false ) playSound("button.mp3") addEventHandler ( "onClientGUIClick", close, function() guiSetVisible(window, false) showCursor(false) end, false ) end addEvent( "ShowVipPanel", true ) addEventHandler( "ShowVipPanel", getRootElement(), vip2)