-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
I wasn't born with my knowledge, you can learn all I'd if you give it time and patience.
-
Would help if you would gives us more information, what is this? what is wrong with it? do you have any debug error(s)?
-
That's because Draken forgot to check if the hitElement was the localPlayer. GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Edit = {} GUIEditor_Window[1] = guiCreateWindow(195,167,372,244,"Gui Sistema De Mover Objetos",false) GUIEditor_Button[1] = guiCreateButton(61,123,231,49,"Mover",false,GUIEditor_Window[1]) GUIEditor_Edit[1] = guiCreateEdit(53,63,256,44,"Porfavor Pon la Contraseña Correcta----",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(60,180,233,52,"Cancelar",false,GUIEditor_Window[1]) guiSetVisible ( GUIEditor_Window[1], false ) local objeto = createObject ( 2669, 1090.67834, -2704.56226, 8.48407, 0, 0, 270) local Col = createColCuboid ( 1088, -2705.56226, 7.5, 5, 2, 4 ) addEventHandler ( 'onClientGUIClick', root, function ( ) if ( source == GUIEditor_Button[1] ) then local text = guiGetText ( GUIEditor_Edit[1] ) if ( text == 'yourPassword' ) then moveObject ( objeto, 5000, 1090.67834, -2704.56226, 18, 0, 0, 0 ) setTimer ( moveObject, 10000, 1, objeto, 5000, 1090.67834, -2704.56226, 9 ) else outputChatBox ( 'Incorrect password!' ); end end end ) local objeto2 = createObject ( 2669, 1111.05212, -3085.17236, 3.55537, 0, 0, 270) local Col2 = createColCuboid ( 1088, 1111.05212, -3085.17236, 3.55537 ) addEventHandler ( 'onClientGUIClick', root, function ( ) if ( source == GUIEditor_Button[1] ) then local text = guiGetText ( GUIEditor_Edit[1] ) if ( text == 'yourPassword' ) then moveObject ( objeto2, 5000, 1111.05212, -3085.17236, 3.55537 ) setTimer ( moveObject, 10000, 1, objeto2, 5000, 1111.05212, -3085.17236, 3.55537 ) else outputChatBox ( 'Incorrect password!' ); end end end ) addEventHandler ( 'onClientColShapeHit', root, function ( hitElement ) if ( source == Col or source == Col2 and hitElement == localPlayer ) then -- Here. guiSetVisible ( GUIEditor_Window[1], true ) showCursor ( true ) end end )
-
@ElMota: You may want to take a look at this tutorial: https://wiki.multitheftauto.com/wiki/Scr ... Tutorial_2 It explains you how to create gates with passwords ( even with a GUI keypad ).
-
You can get the X and Y coordinates using getElementPosition.
-
-- client side: function info ( ) local rowindex, columnindex = guiGridListGetSelectedItem ( GridListePlayer ) playername = guiGridListGetItemText ( GridListePlayer, rowindex, 1) guiSetText ( LabelName, "Name : " .. playername .. " " ) triggerServerEvent ( "informations", localPlayer, playername ) end -- server side: addEvent ( "informations", true ) addEventHandler ( "informations", root, function ( playerName ) local thePlayer = getPlayerFromName ( playerName ) end ) What was 'targetsource'?
-
El foro esta lleno de temas relacionados a lo que vos preguntas, usa "Search" para buscarlos.
-
No, sorry, I only give it to my friends and people who want to buy scripts from me. Please, stop doing off-topic, use PM to ask personal questions.
-
addEventHandler ( "onPlayerJoin", root, function ( ) bindKey ( source, "lctrl", "down", outputMessage ) end ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) for index, player in ipairs ( getElementsByType "player" ) do bindKey ( player, "lctrl", "down", outputMessage ) end end ) function outputMessage ( thePlayer ) outputChatBox ( getPlayerName ( thePlayer ) .. "#005a5aWho want to me in the ass?", root, 0, 0, 0, true ) end
-
function vehiclepaint ( player, seat ) if ( seat == 0 and getPlayerTeam ( player ) ) then local r,g,b = getTeamColor ( getPlayerTeam ( player ) ) setVehicleColor ( source, r, g, b, 0, 0, 0 ) end end addEventHandler ( "onVehicleEnter",root, vehiclepaint ) addEvent ( "onPlayerPickUpRacePickup", true ) addEventHandler ( "onPlayerPickUpRacePickup", root, function ( pickupID, pickupType, vehicleModel ) if ( pickupType == "vehiclechange" and getPlayerTeam ( source ) ) then local r, g, b = getTeamColor ( getPlayerTeam ( source ) ) setVehicleColor ( getPedOccupiedVehicle ( source ), r, g, b, 0, 0, 0 ) end end ) addCommandHandler("addteam", function(source, cmd, clantag, color, ...) local name = {...} if not name[1] then outputChatBox("syntax: "..cmd.." ", source) return end local r,g,b = getColorFromString(color) if not r then outputChatBox(cmd..": invalid color code", source) return end name = table.concat(name, ' ') local config = xmlLoadFile("config.xml") -- local config = getResourceConfig("config.xml") local teamset, teamname for name,settings in next,teams do if settings.tag == clantag then teamset, teamname = settings, name break end end if teamset then local name_differs, color_differs local c = teamset.color local t = getTeamFromName(teamname) if c[1] ~= r or c[2] ~= g or c[3] ~= b then teamset.color = {r,g,b} color_differs = true if t then setTeamColor(t, r, g, b)end end if teamname ~= name then name_differs = true end if color_differs or name_differs then for k,child in next,xmlNodeGetChildren(config)do if xmlNodeGetAttribute(child, "tag") == clantag then if color_differs then xmlNodeSetAttribute(child, "color", string.format("#%02X%02X%02X", r, g, b)) end if name_differs then xmlNodeSetAttribute(child, "name", name) end break end end end end end )
-
Use: setDevelopmentMode to enable the command /showcol, this way you can see the colshape.
-
Check the colshape position, it mayn't be the position you think it is.
-
function updatePlayerStats ( ammo, attacker, weapon, bodypart ) if ( not attacker or attacker == source ) then return end local account = getPlayerAccount ( attacker ) if ( account and not isGuestAccount ( account ) ) then local kills = tonumber ( getAccountData ( account, "kills" ) ) or 0 local headshots = tonumber ( getAccountData ( account, "headshots" ) ) or 0 setAccountData ( account, "kills", kills + 1 ) if ( bodypart == 9 ) then setAccountData ( account, "headshots", headshots + 1 ) end end local accountS = getPlayerAccount ( source ) if ( accountS and not isGuestAccount ( accountS ) ) then local deaths = tonumber ( getAccountData ( accountS, "deaths" ) ) or 0 setAccountData ( accountS, "deaths", deaths + 1 ) end end addEventHandler ( "onPlayerWasted", root, updatePlayerStats ) function getPlayerStats ( thePlayer ) local account = getPlayerAccount ( thePlayer ) if ( account and not isGuestAccount ( account ) ) then local kills = getAccountData ( account, "kills" ) or 0 local headshots = getAccountData ( account, "headshots" ) or 0 local deaths = getAccountData ( account, "deaths" ) or 0 local ratio = string.format ( "%.2f", kills / deaths ) outputChatBox ( "[sTATS]".. getPlayerName ( thePlayer ) .."'s Stats: Kills: ".. tostring ( kills ) .." (".. tostring ( headshots ) .." Headshots), ".. tostring ( deaths ) .." Deaths, Ratio: ".. tostring ( ratio ), root, 50, 255, 0 ) end end addCommandHandler ( "stats", getPlayerStats ) addCommandHandler ( "st", getPlayerStats )
-
Yours wouldn't have worked, player and ped is not the same thing, so if you want to cancel a ped damage you use onClientPedDamage.
-
He want's to convert the money number in a string, example: $100,000, $10,000,000.
-
You didn't read what I first replied?
-
As you can see, I set it if no position data, it'll be 0 instead.
-
function onPlayerQuit ( ) local playerAccount = getPlayerAccount ( source ) if ( playerAccount ) and not isGuestAccount ( playerAccount ) then local playerMoney = getPlayerMoney ( source ) local playerSkin = getElementModel ( source ) local x, y, z = getElementPosition ( source ) setAccountData ( playerAccount, "money", playerMoney ) setAccountData ( playerAccount, "skin", playerSkin ) setAccountData ( playerAccount, "posX", x ) setAccountData ( playerAccount, "posY", y ) setAccountData ( playerAccount, "posZ", z ) end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) function onPlayerLogin ( _, playerAccount ) if ( not isGuestAccount ( playerAccount ) ) then local playerMoney = tonumber ( getAccountData ( playerAccount, "money" ) ) or 0 local playerSkin = tonumber ( getAccountData ( playerAccount, "skin" ) ) or 0 local x = tonumber ( getAccountData ( playerAccount, "posX" ) ) or 0 local y = tonumber ( getAccountData ( playerAccount, "posY" ) ) or 0 local z = tonumber ( getAccountData ( playerAccount, "posZ" ) ) or 0 if ( playerMoney and playerSkin and x and y and z ) then setPlayerMoney(source, playerMoney) setElementModel(source, playerSkin) setElementPosition ( source, x, y, z ) end end end addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin )
-
Of course you can't, but you can do this: if ( playerMoney and playerSkin and x and y and z ) then
-
getElementPosition returns 3 arguments, not one: x, y, z. Btw, account data doesn't require to create tables, that's for SQLite.