Jump to content

Jaysds1

Members
  • Posts

    4,961
  • Joined

  • Last visited

Everything posted by Jaysds1

  1. I think he means getting the element data from the scoreboard... @tim you can't get the element data from the table, the element data is on the player, so if you want to get the class from a certain player, use: getElementsByType("player") for i,v in ipairs(--[[the table from the getElementsByType]])do --code end
  2. np, You just quoted the elements in the destroyElement() and added root to the eventHandlers instead of guiRoot
  3. try this: ---------Client------------ GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(0.36,0.225,0.2412,0.6017,"GUI Blips",true) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Image[1] = guiCreateStaticImage(34,63,31,26,"images/Blip58.png",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(69,63,105,28,"Buy Blip58",false,GUIEditor_Window[1]) GUIEditor_Image[2] = guiCreateStaticImage(33,106,32,30,"images/Blip59.png",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(69,108,105,28,"Buy Blip59",false,GUIEditor_Window[1]) GUIEditor_Image[3] = guiCreateStaticImage(33,151,32,32,"images/Blip60.png",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(69,157,105,28,"Buy Blip60",false,GUIEditor_Window[1]) GUIEditor_Image[4] = guiCreateStaticImage(33,204,32,31,"images/Blip61.png",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(69,208,105,28,"Buy Blip61",false,GUIEditor_Window[1]) GUIEditor_Image[5] = guiCreateStaticImage(33,253,32,27,"images/Blip62.png",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(69,255,105,28,"Buy Blip62",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(31,292,149,18,"GUI Blips by ElMota",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[1],255,255,0) GUIEditor_Button[6] = guiCreateButton(68,322,108,28,"Usar el de defecto",false,GUIEditor_Window[1]) guiSetVisible(GUIEditor_Window[1],false) showCursor(false) bindKey("F7","down",function() guiSetVisible(GUIEditor_Window[1], not guiGetVisible(GUIEditor_Window[1])) showCursor(not isCursorShowing()) end) addEventHandler("onClientMouseEnter", guiRoot, function() if source == GUIEditor_Button[1] then guiSetText(GUIEditor_Label[1], "Price : 6000") guiLabelSetColor(GUIEditor_Label[1], 0, 0, 255) elseif source == GUIEditor_Button[2] then guiLabelSetColor(GUIEditor_Label[1], 0, 0, 255) guiSetText(GUIEditor_Label[1], "Price : 6000") elseif source == GUIEditor_Button[3] then guiLabelSetColor(GUIEditor_Label[1], 0, 0, 255) guiSetText(GUIEditor_Label[1], "Price : 6000") elseif source == GUIEditor_Button[4] then guiLabelSetColor(GUIEditor_Label[1], 0, 0, 255) guiSetText(GUIEditor_Label[1], "Price : 6000") elseif source == GUIEditor_Button[5] then guiLabelSetColor(GUIEditor_Label[1], 0, 0, 255) guiSetText(GUIEditor_Label[1], "Price : 6000") end end) addEventHandler("onClientMouseLeave", guiRoot,function() if source == GUIEditor_Button[1] then guiLabelSetColor(GUIEditor_Label[1], 255, 255, 0) guiSetText(GUIEditor_Label[1], "GUI Blips by ElMota") elseif source == GUIEditor_Button[2] then guiLabelSetColor(GUIEditor_Label[1], 255, 255, 0) guiSetText(GUIEditor_Label[1], "GUI Blips by ElMota") elseif source == GUIEditor_Button[3] then guiLabelSetColor(GUIEditor_Label[1], 255, 255, 0) guiSetText(GUIEditor_Label[1], "GUI Blips by ElMota") elseif source == GUIEditor_Button[4] then guiLabelSetColor(GUIEditor_Label[1], 255, 255, 0) guiSetText(GUIEditor_Label[1], "GUI Blips by ElMota") elseif source == GUIEditor_Button[5] then guiLabelSetColor(GUIEditor_Label[1], 255, 255, 0) guiSetText(GUIEditor_Label[1], "GUI Blips by ElMota") end end) addEventHandler("onClientGUIClick",guiRoot,function() if source == GUIEditor_Button[1] then triggerServerEvent("comprarBlip1", getLocalPlayer()) elseif source == GUIEditor_Button[2] then triggerServerEvent("comprarBlip2", getLocalPlayer()) elseif source == GUIEditor_Button[3] then triggerServerEvent("comprarBlip3", getLocalPlayer()) elseif source == GUIEditor_Button[4] then triggerServerEvent("comprarBlip4", getLocalPlayer()) elseif source == GUIEditor_Button[5] then triggerServerEvent("comprarBlip5", getLocalPlayer()) elseif source == GUIEditor_Button[6] then triggerServerEvent("comprarBlip6", getLocalPlayer()) end end) -------------Server--------- function cb1 ( ) local money = getPlayerMoney ( source ) local name = getPlayerName ( source ) if name == "~ElMota~" then destroyElement(blip2) destroyElement(blip3) destroyElement(blip4) destroyElement(blip5) blip1 = createBlipAttachedTo( source, 58 ) else if ( money >= 6000 ) then takePlayerMoney ( source, 6000 ) destroyElement(blip2) destroyElement(blip3) destroyElement(blip4) destroyElement(blip5) blip1 = createBlipAttachedTo( source, 58 ) else outputChatBox ( "No Tienes Suficiente Dinero", source ) end end end addEvent( "comprarBlip1", true ) addEventHandler( "comprarBlip1", getRootElement(), cb1 ) function cb2() local money = getPlayerMoney ( source ) local name = getPlayerName ( source ) if name == "~ElMota~" then destroyElement("blip1") destroyElement("blip3") destroyElement("blip4") destroyElement("blip5") blip2 = createBlipAttachedTo( source, 59 ) else if ( money >= 6000 ) then takePlayerMoney ( source, 6000 ) destroyElement("blip1") destroyElement("blip3") destroyElement("blip4") destroyElement("blip5") blip2 = createBlipAttachedTo( source, 59 ) else outputChatBox ( "No Tienes Suficiente Dinero", source ) end end end addEvent( "comprarBlip2", true ) addEventHandler( "comprarBlip2", getRootElement(), cb2 ) function cb3() local money = getPlayerMoney ( source ) local name = getPlayerName ( source ) if name == "~ElMota~" then destroyElement(blip1) destroyElement(blip2) destroyElement(blip4) destroyElement(blip5) blip3 = createBlipAttachedTo( source, 60 ) else if ( money >= 6000 ) then takePlayerMoney ( source, 6000 ) destroyElement(blip1) destroyElement(blip2) destroyElement(blip4) destroyElement(blip5) blip3 = createBlipAttachedTo( source, 60 ) else outputChatBox ( "No Tienes Suficiente Dinero", source ) end end end addEvent( "comprarBlip3", true ) addEventHandler( "comprarBlip3", getRootElement(), cb3 ) function cb4() local money = getPlayerMoney ( source ) local name = getPlayerName ( source ) if name == "~ElMota~" then destroyElement(blip1) destroyElement(blip2) destroyElement(blip3) destroyElement(blip5) blip4 = createBlipAttachedTo( source, 61 ) else if ( money >= 6000 ) then takePlayerMoney ( source, 6000 ) destroyElement(blip1) destroyElement(blip2) destroyElement(blip3) destroyElement(blip5) blip4 = createBlipAttachedTo( source, 61 ) else outputChatBox ( "No Tienes Suficiente Dinero", source ) end end end addEvent( "comprarBlip4", true ) addEventHandler( "comprarBlip4", getRootElement(), cb4 ) function cb5() local money = getPlayerMoney ( source ) local name = getPlayerName ( source ) if name == "~ElMota~" then destroyElement(blip1) destroyElement(blip2) destroyElement(blip3) destroyElement(blip4) blip5 = createBlipAttachedTo( source, 62 ) else if ( money >= 6000 ) then takePlayerMoney ( source, 6000 ) destroyElement(blip1) destroyElement(blip2) destroyElement(blip3) destroyElement(blip4) blip5 = createBlipAttachedTo( source, 62 ) else outputChatBox ( "No Tienes Suficiente Dinero", source ) end end end addEvent( "comprarBlip5", true ) addEventHandler( "comprarBlip5", getRootElement(), cb5 ) function cb6() destroyElement(blip1) destroyElement(blip2) destroyElement(blip3) destroyElement(blip4) destroyElement(blip5) end addEvent( "comprarBlip6", true ) addEventHandler( "comprarBlip6", getRootElement(), cb6 )
  4. Jaysds1

    vehicleColor

    theCode: addEventHandler("onResourceStart",resourceRoot,function() for i, v in ipairs (getElementsByType("veh")) do local model = getElementData(v,"model") local ID = getElementData(v,"ID") local x = getElementData(v,"posX") local y = getElementData(v,"posY") local z = getElementData(v,"posZ") local rotZ = tonumber(getElementData(v,"rotation")) local color1 = getElementData(v,"color1") local color2 = getElementData(v,"color2") cars[i] = createVehicle(model,x,y,z,0,0,rotZ) setElementData (cars[i],"vehID",ID) setElementData (cars[i],"posX",x) setElementData (cars[i],"posY",y) setElementData (cars[i],"posZ",z) setElementData (cars[i],"rotation", rotZ) setElementData (cars[i], "color1", color1) setElementData (cars[i], "color2", color2) setVehicleColor(cars[i], tonumber(color1), tonumber(color2), 0, 0 ) local owner = getElementData(v,"owner") local team = getElementData(v,"team") local locked = getElementData(v,"Locked") if owner then setElementData(cars[i], "owner", owner) end if team then setElementData(cars[i], "team", team) end if locked then setElementData(cars[i], "Locked", locked) end toggleVehicleRespawn(v,true) setVehicleIdleRespawnDelay(v,120000) end end)
  5. So, you already solved the issue? BTW, What's "getVar"?
  6. Try this: https://community.multitheftauto.com/index.php?p= ... ls&id=1691 You could try getting some code out of this and posting it on your site.
  7. here: function testFunction(thePlayer,command) --You forgot the variables local variable = getVar(thePlayer) outputChatBox("Debug message",thePlayer) if (variable == 0 ) then if (variable2 == false) then outputChatBox("Debug message",thePlayer) takeAction() testFunction2() end end end function testFunction2() local variable = getVar(thePlayer) if (variable ~= 0) then outputChatBox("Debug message",thePlayer) takeAction2() testFunction() end end function takeAction() -- Do things. testFunction() end function takeAction2() -- Do different things. testFunction() end addCommandHandler("command", testFunction) EDIT: I found my mistake, Copy again
  8. You could use: isGuestAccount()
  9. Here: https://community.multitheftauto.com/index.php?p=resources&s=list
  10. lol, You were right Callum
  11. Jaysds1

    Playerblip panel

    Sorry, I found my mistake: addEventHandler("onClientGUIClick", guiRoot,function(button) if (button == "left") then if (source == closeBut) then guiSetVisible( playerBlipWindow, false) showCursor(false) elseif ( source == blipUnblipBut ) then local playerName = guiGridListGetItemText ( gridListOfPlayers, guiGridListGetSelectedItem ( gridListOfPlayers ), 1 ) if(getElementData(getPlayerFromName(playerName), "isPlayerBlipped"))then destroyElement(playerBlip) setElementData(getPlayerFromName(playerName), "isPlayerBlipped", false) else playerBlip = createBlipAttachedTo( playerName, 40 ) setElementData(getPlayerFromName(playerName), "isPlayerBlipped", true) end end end end,true)
  12. Jaysds1

    MySQL Error

    I think you forgot to close the bracket by the accounts table creation.
  13. Jaysds1

    Playerblip panel

    try this now: addEventHandler("onClientGUIClick", guiRoot,function(button) if (button) == "left" then if (source == closeBut) then guiSetVisible( playerBlipWindow, false) showCursor(false) elseif ( source == blipUnblipBut ) then playerBlip = createBlipAttachedTo( playerName, 40 ) local playerName = guiGridListGetItemText ( gridListOfPlayers, guiGridListGetSelectedItem ( gridListOfPlayers ), 1 ) setElementData(getPlayerFromName(playerName), "isPlayerBlipped", true) if(getElementData(getPlayerFromName(playerName), "isPlayerBlipped"))then destroyElement(playerBlip) setElementData(getPlayerFromName(playerName), "isPlayerBlipped", false) end end end end,false)
  14. addEventHandler("onResourceStart", getResourceRootElement(getThisResource()),
  15. What's your interior script?
  16. you could change ped models and textures but SAMP isn't compatible with MTA
  17. try this: local elementPlayer = getRootElement() addEventHandler( "onResourceStart", resourceRoot,function() executeSQLCreateTable( "HouseData", "Name STRING, Preis INT, Int INT, PosX FLOAT, PosY FLOAT, PosZ FLOAT, IntX, IntY, IntZ" ) local db = executeSQLSelect( "HouseData", "*" ) for i,v in ipairs(db)do name,preis,Int,posX,posY,posZ,IntX,IntY,IntZ = unpack(v) createPickup( posX, posY,posZ,3, 1272, 2000 ) end end ) addCommandHandler( "house",function( thePlayer, cmd, Int, Preis ) if ( getDatabase( thePlayer, "Admin" ) == 1 ) then local X1, Y1, Z1 = getElementPosition( thePlayer ) if(Int)then Int = tonumber(Int) local Interiors = { {5,1298.9,-796.4,1084.0}, {1,223.2,1287.5,1082.1}, {5,2233.7,-1115.1,1050.9}, {8,2365.3,-1135.6,1050.9}, {11,2283.0,-1139.7,1050.9}, {6,2196.2,-1204.4,1049.0}, {10,2269.8,-1210.5,1047.6}, {6,2308.8,-1212.8,1049.0}, {2,2237.5,-1080.5,1049.0}, {9,2317.9,-1026.2,1050.2}, {5,140.4,1366.6,1083.9} } local In,X2,Y2,Z2 = unpack(Interiors[Int]) end end executeSQLInsert( "HouseData", "'0', '"..Preis.."', '"..In.."', '"..X1.."', '"..Y1.."', '"..Z1.."', '"..X2.."', '"..Y2.."', '"..Z2.."'" ) createPickup( X1, Y1, Z1, 3, 1272, 2000 ) end end ) addCommandHandler( "checkH",function( thePlayer, cmd, Int ) if ( getDatabase( thePlayer, "Admin" ) == 1 ) then setElementData(thePlayer,"prePos",getElementPosition(thePlayer)) if(Int)then Int = tonumber(Int) local Interiors = { {5,1298.9,-796.4,1084.0}, {1,223.2,1287.5,1082.1}, {5,2233.7,-1115.1,1050.9}, {8,2365.3,-1135.6,1050.9}, {11,2283.0,-1139.7,1050.9}, {6,2196.2,-1204.4,1049.0}, {10,2269.8,-1210.5,1047.6}, {6,2308.8,-1212.8,1049.0}, {2,2237.5,-1080.5,1049.0}, {9,2317.9,-1026.2,1050.2}, {5,140.4,1366.6,1083.9} } local In,X2,Y2,Z2 = unpack(Interiors[Int]) setElementInterior(thePlayer,In,X2,Y2,Z2) end bindKey( thePlayer, "space", "down",out) end ) function out( player ) x,y,z = getElementData(player,"prePos") setElementInterior( player, 0, x, y, z ) unbindKey( player, "space", "down",out ) end function getDatabase( element, value ) local user = getPlayerName( element ) local db = executeSQLSelect( "HouseData", "*", "Name = '"..user.."'" ) if ( db ) and ( #db == 1 ) then local data = db[1][value] return data end end function setDatabase( element, value, data ) local user = getPlayerName( element ) local db = executeSQLSelect ( "HouseData", "*", "Name = '"..user.."'") if ( db ) and ( #db == 1 ) then executeSQLUpdate( "HouseData", value.." = '"..tostring( data ).."'", "Name = '"..user.."'" ) end end
  18. https://community.multitheftauto.com/index.php?p= ... ls&id=4677
  19. try uploading the resource again...
  20. Jaysds1

    Playerblip panel

    try this: function randomFunction(button) if (button) == "left" then if (source == closeBut) then guiSetVisible( playerBlipWindow, false) showCursor(false) elseif ( source == blipUnblipBut ) then playerBlip = createBlipAttachedTo( playerName, 40 ) local playerName = guiGridListGetItemText ( gridListOfPlayers, guiGridListGetSelectedItem ( gridListOfPlayers ), 1 ) setElementData(getPlayerFromName(playerName), "isPlayerBlipped", true) if(getElementData(getPlayerFromName(playerName), "isPlayerBlipped"))then destroyElement(playerBlip) setElementData(getPlayerFromName(playerName), "isPlayerBlipped", false) end end end end addEventHandler("onClientGUIClick", guiRoot,randomFunction, true)
  21. SAMP stuff/objects don't work here anymore, MTA changed every single thing that SAMP players used...
×
×
  • Create New...