Anubhav
Members-
Posts
2,277 -
Joined
-
Last visited
Everything posted by Anubhav
-
function firstGUI(player) X_button_Cancel = 0.6 Y_button_Cancel = 0.7 Width_button_Cancel = 0.25 Height_button_Cancel = 0.2 btnCancel = guiCreateButton(X_button_Cancel, Y_button_Cancel, Width_button_Cancel, Height_button_Cancel, "Cancel", true, register) guiWindowSetSizable(register, false) guiSetVisible ( register, true ) showCursor(true) addEventHandler("onClientGUIClick", btnCancel, zamknijgui, false) end addCommandHandler("gui", firstGUI)
-
function createHero(heroname,herolastname, heroage, herocountry, herolang) if not (heroname == "") then if not (herolastname == "") then if not heroname:find("%W") then if not (heroage == "") then if not (herocountry == "") then if not (herolang == "") then local account = getPlayerAccount(source) local accountname = getAccountName(account) local herona = dbQuery( connection, "SELECT heroname FROM character") local heroln = dbQuery( connection, "SELECT herolastname FROM character") local heroInA = dbPoll(heroIn, -1) local heronaA = dbPoll(herone, -1) if not (heroname == heronaA) and not ( herolastname == heroInA ) then dbExec( connection,"INSERT INTO character VALUES(?, ?, ?, ?, ?, ?)", accountname, heroname, herolastname, heroage, herocountry, herolang) triggerClientEvent(source,"changeMessage",getRootElement(),"2","Character seccessfully created","green") else triggerClientEvent(source,"changeMessage",getRootElement(),"2","This name already taken", "red") triggerClientEvent(source,"changeMessage",getRootElement(),"4","", "red") end else triggerClientEvent(source,"changeMessage",getRootElement(),"2","Please enter your language", "red") triggerClientEvent(source,"changeMessage",getRootElement(),"4","", "red") end else triggerClientEvent(source,"changeMessage",getRootElement(),"2","Please enter your country", "red") triggerClientEvent(source,"changeMessage",getRootElement(),"4","", "red") end else triggerClientEvent(source,"changeMessage",getRootElement(),"2","Please enter your birthday date", "red") triggerClientEvent(source,"changeMessage",getRootElement(),"4","", "red") end else triggerClientEvent(source,"changeMessage", getRootElement(), "2","Your name has invalid characters", "red") end else triggerClientEvent(source,"changeMessage", getRootElement(), "2","Please enter your last name", "red") end else triggerClientEvent(source,"changeMessage", getRootElement(), "2","Please enter your name", "red") end end addEvent("createHero",true) addEventHandler("createHero",getRootElement(),createHero)
-
addEventHandler("onClientVehicleEnter", root, function(theVehicle, seat, jacked) local eM = getElementMatrix( theVehicle ) local x, y, z, lx, ly, lz = getCameraMatrix( theVehicle ) local pitch = math.deg( math.asin( eM[2][3] ) ) -- (-90,90) local roll = math.deg( math.atan2( eM[1][3], eM[3][3] ) ) --(-180,180) - You should only need this one (roll) local yaw = math.deg( math.atan2( eM[2][1], eM[2][2] ) ) --(-180,180) if (isPedInVehicle( getLocalPlayer() )) then if ( getVehicleType( source ) == "Plane" ) then --setElementMatrix ( theVehicle, roll, y, z, lx, ly, lz) setCameraMatrix ( x, y, z, lx, ly, lz, roll) end end end)
-
https://community.multitheftauto.com/index.php?p= ... ls&id=9828 Copied from forums Original: viewtopic.php?f=108&t=78639 viewtopic.php?f=91&t=78656 Telling everyone to make his script and he is releasing them on community, he din't did a piece of it.
-
LOL. A typo at last line. (addCommmandHandler -- loooooooooooooool ) function banCommand ( plr, cmd, serial, days, ... ) if ( not serial or not days or not ... or not tonumber ( days ) ) then return outputChatBox ( "Syntax error. /"..tostring(cmd).." [serial] [days] [reason]", plr, 255, 0, 0 ) end local days = math.floor ( tonumber ( days ) ) if ( days <= 0 ) then return outputChatBox ( "Invalid number of days. Must be greater than 0", plr, 255, 0, 0 ) end local ip = nil local username = nil local reason = table.concat ( { ... }, " " ) local time = ( ( days * 24 ) * 60 ) * 60 -- I think the math is right -- handle the player kick for i, v in pairs ( getElementsByType ( "player" ) ) do if ( getPlayerSerial ( v ) == serial ) then ip = getPlayerIP ( v ) local acc = getPlayerAccount ( v ) if ( not isGuestAccount ( acc ) ) then username = getAccountName ( acc ) end kickPlayer ( v ) end end addBan ( ip, username, serial, plr, reason, time ) end addCommandHandler ( "iban", banCommand ) Fixed code
-
local Marker = createMarker ( -2235.21, -1736.60, 479.80, "cylinder", 2.5, 0, 0, 255, 170 ) function paraquedismo ( thePlayer, matchingDimension ) if isElementWithinMarker( thePlayer, Marker) then outputChatBox("Para pular de paraquedas digite /pular!", thePlayer, 255, 0, 0) end end addEventHandler ("onMarkerHit", Marker, paraquedismo) function pular ( playerSource, matchingDimension ) if isElementWithinMarker( playerSource, Marker) then setElementPosition( playerSource, -2235.21, -1736.60, 1300.80 ) giveWeapon ( playerSource, 46 ) setPedWeaponSlot(playerSource, getSlotFromWeapon(46)) outputChatBox("Caia no Alvo para ganhar 5000$!", thePlayer, 255, 0, 0) local Marker1 = createMarker ( -2407.97, -596.58, 131.80, "cylinder", 7.0, 0, 0, 255, 170 ) local blip1 = createBlip( -2407.97, -596.58, 132.64, 0, 0, 0, 255, 255 ) setBlipSize ( blip1, 5 ) else outputChatBox("Você não está na área de Paraquedismo!", thePlayer, 255, 0, 0) end end addCommandHandler ( "pular", pular ) function cairmarker ( thePlayer, matchingDimension ) if isElementWithinMarker( thePlayer, Marker) then setPlayerMoney(thePlayer, 5000) outputChatBox("Você ganhou 5000$ por cair no alvo!", thePlayer, 255, 0, 0) else outputChatBox("Você não conseguiu cair no Alvo!", thePlayer, 255, 0, 0) end end addEventHandler ("onMarkerHit", Marker, cairmarker)
-
function Spawndoggy (source) local x,y,z = getElementPosition (source) local rot= 90 local skin=79 local interior=0 local dimension=0 local team = getPlayerTeam ( source ) local weapon=0 local mode= "following" local modesubject=source setElementData(source, "isDogSpawned", true) dog = call (getResourceFromName("slothbot"), "spawnBot", x, y+5, z, rot, skin, interior, dimension, team, weapon, mode, modesubject) setTimer ( call, 5000, 1, getResourceFromName("slothbot"), "setBotAttackEnabled",dog,false ) follow = exports.slothbot:setBotFollow(dog, ) -- someone you want to follow. I am leaving it empty! end addCommandHandler("spawndog", Spawndoggy) function dogA(source) if not getElementData(source, "isDogSpawned") then outputChatBox("Spawn one dog first! Use /spawndog", source) else outputChatBox("Your dog will start attacking now!", source) setTimer ( call, 5000, 1, getResourceFromName("slothbot"), "setBotAttackEnabled",dog, true ) end end addCommandHandler("Dogattack", dogA) function dopWarp(source) if isPedInVehicle( source ) then local vehi = getPedOccupiedVehicle( source ) local x,y,z = getElementPosition( source ) setElementData(dog, "canBeGlued", true) setElementFrozen(dog, true) setElementPosition(dog, x+2,y+5,z) outputChatBox("Please get into a vehicle and use /Gluedog", source) else local x,y,z = getElementPosition(source) setElementPosition(dog, x, y, z ) setElementData(dog, "canBeGlued", true) setElementFrozen(dog, true) outputChatBox("Please get into a vehicle and use /Gluedog", source) end end addCommandHandler("dogwarp", dopWarp) function dogGlue(source) if not getElementData(dog, "canBeGlued") then outputChatBox("Please use /dogwarp first!", source) return end if not isPedInVehicle ( source ) then outputChatBox("Get a vehicle first.", source) return end if not getElementData(source, "isDogSpawned") then outputChatBox("Spawn one dog first! Use /spawndog", source) else attachElements(source, dog) removeElementData( dog, "canBeGlued" ) end end addCommandHandler('Gluedog', dogGlue)
-
function BuyTractor () local money = getPlayerMoney(source) if (money > 5000) then takePlayerMoney(source,5000) local vehicleModel = 411 local x,y,z = getElementPosition(source) y = y + 5 local veh = createVehicle(tonumber(vehicleModel),x,y,z) setElementData(veh, "owner", getPlayerName(source)) else outputChatBox ( "* Earn more OP (Oil Points) to buy this vehicle", source, 255, 255, 255, true ) end end addEvent("Car1",true) addEventHandler( "Car1", getRootElement(), BuyTractor ) function enterVehicle ( player, seat, jacked ) --when a player enters a vehicle if ( getElementData(source, "owner") and getPlayerName(player) ~= getElementData(source, "owner") ) then cancelEvent() outputChatBox ( "You don't have the keys for this vehicle", player ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle )
-
function BuyTractor () local money = getPlayerMoney(source) if (money > 5000) then takePlayerMoney(source,5000) local vehicleModel = 411 local x,y,z = getElementPosition(source) y = y + 5 local veh = createVehicle(tonumber(vehicleModel),x,y,z) setElementData(veh, "owner", getPlayerName(source)) else outputChatBox ( "* Earn more OP (Oil Points) to buy this vehicle", source, 255, 255, 255, true ) end end addEvent("Car1",true) addEventHandler( "Car1", getRootElement(), BuyTractor ) function enterVehicle ( player, seat, jacked ) --when a player enters a vehicle if ( getElementData(source, "owner") and getPlayerName(player) ~= getElementData(source, "owner") ) then cancelEvent() outputChatBox ( "You don't have the keys for this vehicle", player ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle )
-
Thanks, I got everything!
-
Explain it to me please
-
Any help? Please help me guyz! Don't be lazy to answer, I realy want to know how to use this this functions!
-
NaN means Not A Number. I am not sure whats wrong. Show us the image of /debugscript 3
-
Hey guyz, After searching and researching about OOP in 1.4, I found the function list of OOP ( server ). I wanted to make my scripts easier but I din't understood how to use some functions. THESE are they - create (function: dbConnect) exec (function: dbExec) query (function: dbQuery) please help
-
exports.scoreboard:addScoreboardColumn('Score') addEventHandler("onPlayerWasted", root, function(attacker,attackerweapon) if getElementData(attacker, "Score") == false or getElementData(attacker, "Score") == nil then setElementData(attacker, "Score", 1) setElementData(source, "Score", -1) else setElementData( attacker, "Score", getElementData(attacker,"Score")+1) setElementData( source, "Score", getElementData(source,"Score")-1) end )
-
Whoops . I never tested that script lel!!! Thanks for correcting anywas..
-
VentanaT = guiCreateWindow(462, 218, 522, 295, "CL Trabajos", false) guiWindowSetSizable(VentanaT, false) guiSetVisible(VentanaT, false) RenunciarB = guiCreateButton(10, 77, 114, 37, "Renunciar", false, VentanaT) guiSetProperty(RenunciarB, "NormalTextColour", "FFAAAAAA") DescansarB = guiCreateButton(10, 30, 114, 37, "Descansar", false, VentanaT) guiSetProperty(DescansarB, "NormalTextColour", "FFAAAAAA") OcupacionT = guiCreateLabel(142, 53, 63, 14, "Team:", false, VentanaT) CuentaT = guiCreateLabel(140, 33, 100, 15, "Nombre: ", false, VentanaT) Imagen = guiCreateStaticImage(336, 33, 176, 152, ":login_panel/logo.png", false, VentanaT) CerrarB = guiCreateButton(336, 244, 177, 41, "Cerrar Ventana", false, VentanaT) guiSetProperty(CerrarB, "NormalTextColour", "FFAAAAAA") Info = guiCreateLabel(10, 136, 157, 98, "Sistema de trabajos de CL\nAca Podras Renunciar\nA Tu Trabajo,\nO Descansar De Tu Trabajo", false, VentanaT) Cuenta = guiCreateLabel(187, 33, 200, 150, "" ..getPlayerName(localPlayer).. "", false, VentanaT) Ocupacion = guiCreateLabel(205, 53, 91, 15, "n/n", false, VentanaT) VentanaE = guiCreateWindow(519, 285, 224, 157, "CL Trabajos", false) guiWindowSetSizable(VentanaE, false) guiSetVisible(VentanaE, false) BotonSi = guiCreateButton(16, 102, 74, 45, "Si", false, VentanaE) guiSetProperty(BotonSi, "NormalTextColour", "FFAAAAAA") BotonNo = guiCreateButton(124, 102, 74, 45, "No", false, VentanaE) guiSetProperty(BotonNo, "NormalTextColour", "FFAAAAAA") Label = guiCreateLabel(26, 33, 163, 50, "Estas Seguro De Renunciar?", false, VentanaE) function openT(thePlayer) if (guiGetVisible (VentanaT) == false) then local plrTeam = getPlayerTeam( thePlayer ) guiSetText(Ocupacion, tostring(plrTeam) or plrTeam) guiSetVisible(VentanaT, true) showCursor(true) elseif (guiGetVisible (VentanaT) == true) then guiSetVisible(VentanaT, false) showCursor(false) end end bindKey ("F4", "down", openT) function cerrarventanaT() guiSetVisible(VentanaT, false) showCursor(false) end addEventHandler("onClientGUIClick", CerrarB , cerrarventanaT, false) function AbrirE() guiSetVisible(VentanaT, false) guiSetVisible(VentanaE, true) showCursor(true) end addEventHandler("onClientGUIClick", RenunciarB , AbrirE, false) function BotonNo1() guiSetVisible(VentanaT, true) guiSetVisible(VentanaE, false) showCursor(true) end addEventHandler("onClientGUIClick", BotonNo , BotonNo1, false) function BotonSi1() guiSetVisible(VentanaT, false) guiSetVisible(VentanaE, false) triggerServerEvent("Sacarteam1", localPlayer) showCursor(false) end addEventHandler("onClientGUIClick", BotonSi , BotonSi1, false)
-
function Spawndoggy (source) local x,y,z = getElementPosition (source) local rot= 90 local skin=79 local interior=0 local dimension=0 local team = getPlayerTeam ( source ) local weapon=0 local mode= "following" local modesubject=source setElementData(source, "isDogSpawned", true) dog = call (getResourceFromName("slothbot"), "spawnBot", x, y+5, z, rot, skin, interior, dimension, team, weapon, mode, modesubject) setTimer ( call, 5000, 1, getResourceFromName("slothbot"), "setBotAttackEnabled",dog,false ) follow = exports.slothbot:setBotFollow(dog, ) -- someone you want to follow. I am leaving it empty! end addCommandHandler("spawndog", Spawndoggy) function dogA(source) if not getElementData(source, "isDogSpawned") then outputChatBox("Spawn one dog first! Use /spawndog", source) else outputChatBox("Your dog will start attacking now!", source) setTimer ( call, 5000, 1, getResourceFromName("slothbot"), "setBotAttackEnabled",dog, true ) end end addCommandHandler("Dogattack", dogA) function dogGlue(source) if not isPedInVehicle ( source ) then outputChatBox("Get a vehicle first.", source) return end if not getElementData(source, "isDogSpawned") then outputChatBox("Spawn one dog first! Use /spawndog", source) else attachElements(source, dog) end end addCommandHandler('Gluedog', dogGlue)
-
function Spawndoggy (source) local x,y,z = getElementPosition (source) local rot= 90 local skin=79 local interior=0 local dimension=0 local team = getPlayerTeam ( source ) local weapon=0 local mode= "following" local modesubject=source setElementData(source, "isDogSpawned", true) dog = call (getResourceFromName("slothbot"), "spawnBot", x, y+5, z, rot, skin, interior, dimension, team, weapon, mode, modesubject) setTimer ( call, 5000, 1, getResourceFromName("slothbot"), "setBotAttackEnabled",dog,false ) end addCommandHandler("spawndog", Spawndoggy) function dogA(source) if not getElementData(source, "isDogSpawned") then outputChatBox("Spawn one dog first! Use /spawndog", source) else outputChatBox("Your dog will start attacking now!", source) setTimer ( call, 5000, 1, getResourceFromName("slothbot"), "setBotAttackEnabled",dog, true ) end end addCommandHandler("Dogattack", dogA)
-
exports.scoreboard:addScoreboardColumn('Score') addEventHandler("onPlayerWasted", root, function(attacker,attackerweapon) setElementData( attacker, "Score", getElementData(attacker,"Score")+1) setElementData( source, "Score", getElementData(source,"Score")-1) end )
-
function Spawndoggy (source) if not getElementData(source, "isDogSpawned") then local x,y,z = getElementPosition (source) local rot= 90 local skin=79 local interior=0 local dimension=0 local team = getPlayerTeam ( source ) local weapon=0 local mode= "following" local modesubject=source setElementData(source, "isDogSpawned", true) dog = call (getResourceFromName("slothbot"), "spawnBot", x, y+5, z, rot, skin, interior, dimension, team, weapon, mode, modesubject) setTimer ( call, 5000, 1, getResourceFromName("slothbot"), "setBotAttackEnabled",dog,false ) else dog = call (getResourceFromName("slothbot"), "spawnBot", x, y+5, z, rot, skin, interior, dimension, team, weapon, mode, modesubject) setTimer( call, 5000, 1, getResourceFromName("slothbot"), "setBotAttackEnabled", dog, true) end end addCommandHandler("spawndog", Spawndoggy)
-
Not at all. Bad usage on setTimer is fixed.
-
function Spawndoggy (source) local x,y,z = getElementPosition (source) local rot= 90 local skin=79 local interior=0 local dimension=0 local team = getPlayerTeam ( source ) local weapon=0 local mode= "following" local modesubject=source setTimer ( call, 5000, 1, getResourceFromName("slothbot"), "setBotAttackEnabled",dog,false ) call (getResourceFromName("slothbot"), "spawnBot", x, y+5, z, rot, skin, interior, dimension, team, weapon, mode, modesubject) end addCommandHandler("spawndog", Spawndoggy)