Jump to content

TAPL

Retired Staff
  • Posts

    7,337
  • Joined

  • Days Won

    11

Everything posted by TAPL

  1. Dev-PoinT, where is the event? or you think the script will run his self?
  2. or you can use this for extra Health https://community.multitheftauto.com/index.php?p= ... ls&id=1604 viewtopic.php?f=108&t=31550&p=336070#p336070
  3. show the whole code to can help you
  4. local money = vioGetElementData(thePlayer, "money") vioSetElementData ( thePlayer, "money", tonumber(money)+50 ) wtf is this? correct local money = getElementData(thePlayer, "money") setElementData ( thePlayer, "money", tonumber(money)+50 ) bindKey ( thePlayer, "sub_mission", "down", cMarker )
  5. MOJRM-511 has 21 age, we don't know if he finished his school or not lololololololololool
  6. outputChatBox("#FF0000(NOTE) "..name..":#FFFFFF "..text,root,255, 255, 255) outputChatBox("#FF0000(NOTE) "..name..":#FFFFFF "..text,root,255, 255, 255, true) What is the difference between them? The first will be: #FF0000(NOTE) TAPL:#FFFFFF Hello The second will be: (NOTE) TAPL: Hello you see the difference?
  7. wrong wrong wrong look at this local account = getPlayerAccount(source) should be local account = getAccountName(getPlayerAccount(source)) also "true" needed in outputChatBox to enable colorCoded msgtype: not needed because you aren't use event onPlayerChat you use addCommandHandler correct local language = get('language') function note (source,cmd,text) local name = getPlayerName(source) local account = getAccountName(getPlayerAccount(source)) if language == "english" then if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then outputChatBox("#FF0000(NOTE) "..name..":#FFFFFF "..text,root,255, 255, 255, true) outputServerLog("NOTE: ".. name) elseif isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then outputChatBox("#FF0000(NOTE) "..name..":#FFFFFF "..text,root,255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then outputChatBox("#FF0000(NOTE) "..name..":#FFFFFF "..text,root,255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Everyone")) then outputChatBox("#FF0000Access to /note denied!",root,255, 255, 255, true) end elseif language == "spanish" then if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then outputChatBox("#FF0000(NOTA) "..name..":#FFFFFF "..text,root,255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then outputChatBox("#FF0000(NOTA) "..name..":#FFFFFF "..text,root,255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then outputChatBox("#FF0000(NOTA) "..name..":#FFFFFF "..text,root,255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Everyone")) then outputChatBox("#FF0000El acceso a /nota negado!",root,255, 255, 255, true) end elseif language == "arabic" then if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then outputChatBox("#FF0000(ملاحظة) "..name..":#FFFFFF "..text,root,255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then outputChatBox("#FF0000(ملاحظة) "..name..":#FFFFFF "..text,root,255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then outputChatBox("#FF0000(ملاحظة) "..name..":#FFFFFF "..text,root,255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Everyone")) then outputChatBox("#FF0000 الحصول على /note رفض!",root,255, 255, 255, true) end end end addCommandHandler("note", note)
  8. local color = get('joinquitcolor') function playerjoin() local name = getPlayerName(source) local ip = getPlayerIP (source) local version = getPlayerVersion (source) local country = call(getResourceFromName("admin"), "getPlayerCountry", source) if country then outputChatBox(name.." has joined the server. ["..country.."] ["..ip.."] ["..version.."]",root,color) else outputChatBox(name.." has joined the server. [unknow] ["..ip.."] ["..version.."]",root,color) end end addEventHandler("onPlayerJoin",root,playerjoin) function playerquit(reason) local name = getPlayerName(source) if reason == "Quit" then outputChatBox(name.." has disconnected from the server",root, color) elseif (reason == "Kicked" ) then outputChatBox(name.." has been kicked from the server",root,color) elseif (reason == "Banned" ) then outputChatBox(name.." has been banned from the server",root,color) elseif (reason == "Timed out") then outputChatBox(name.." has lost connection with the server",root,color) end end addEventHandler("onPlayerQuit",root,playerquit) function playernickchange(old, new) outputChatBox("* "..old.." has changed his name to "..new,root,255,100,100) end addEventHandler("onPlayerChangeNick", root, playernickchange)
  9. you don't even know what you are doing you put id 99 for object?! local object = createObject(99, x, y, z) and you put the correct id in wrong place local START_POS = {-717, 954, 12, 0, 0, 87} local STOP_POS = {-717, 954, 12, 0, 0, 2651} local MOTION_DURATION = 5000 local WAIT_DURATION = 1000 addCommandHandler("smove", function (player, cmd, strEasingType, period, amplitude, overshoot) if isObjectInACLGroup("user." ..getAccountName(getPlayerAccount (player)), aclGetGroup("Admin" or "SuperModerator")) then local x, y, z = unpack(START_POS) local object = createObject(969, x, y, z) x, y, z = unpack(STOP_POS) strEasingType = strEasingType or "Linear" period = period or 0.3 amplitude = amplitude or 1.0 overshoot = overshoot or 1.70158 outputChatBox(string.format("Server Easing %s %s %s %s", strEasingType, tostring(period), tostring(amplitude), tostring(overshoot))) moveObject(object, MOTION_DURATION, x, y, z, 0, 0, 360, strEasingType, period, amplitude, overshoot) setTimer(destroyElement, MOTION_DURATION+WAIT_DURATION, 1, object) else outputChatBox ("You are not Admin or SuperModerator!", player, 255, 0, 0) end end)
  10. this for push function pushHisFreakingAss (playerSource, cmd, arg1) if isObjectInACLGroup("user." ..getAccountName(getPlayerAccount(playerSource)), aclGetGroup("VIP")) == false then outputChatBox ("You aren't VIP. You can't use that command.", playerSource, 255, 12, 15, false) else if (arg1 == nil ) or ( arg1 == false ) then outputChatBox ("You must to insert a valid player name.", playerSource, 255, 12, 15, false) else if isObjectInACLGroup("user." ..getAccountName(getPlayerAccount (playerSource)), aclGetGroup("VIP")) == true then local playerElement = getPlayerFromName(arg1) local hisCar = getPedOccupiedVehicle(playerElement) if playerElement and hisCar then local name = getPlayerName(playerElement) local sourceName = getPlayerName(playerSource) local hisCar = getPedOccupiedVehicle(playerElement) local x, y, z = getElementVelocity ( hisCar ) setElementVelocity ( hisCar, x , y, z + 0.3 ) outputChatBox ("#0082D8"..name.." pushes "..sourceName.."!", root, 255, 255, 255, true) end end end end end addCommandHandler("push", pushHisFreakingAss) and this for fix cmd function fixx ( playerSource, cmd ) if not isObjectInACLGroup("user." ..getAccountName(getPlayerAccount(playerSource)), aclGetGroup("VIP")) then outputChatBox ("You aren't VIP. You can't use that command.", playerSource, 255, 12, 15, false) else if isPedInVehicle(playerSource) then local veh = getPedOccupiedVehicle(playerSource) fixVehicle(veh) outputChatBox ("#0082D8" .. getPlayerName(playerSource) .." has fixed his self !", root, 255, 255, 255, true) end end end addCommandHandler ( "fix", fixx ) and this for nos cmd function nitro1 ( playerSource, command ) if not isObjectInACLGroup("user." ..getAccountName(getPlayerAccount(playerSource)), aclGetGroup("VIP")) then outputChatBox ("You aren't VIP. You can't use that command.", playerSource, 255, 12, 15, false) else if isPedInVehicle(playerSource) then local veh = getPedOccupiedVehicle(playerSource) addVehicleUpgrade(veh,1010) outputChatBox ("#0082D8" .. getPlayerName(playerSource) .." gives nos to his self !", root, 255, 255, 255, true) end end end addCommandHandler ( "nos", nitro1 )
  11. you want make it can't use it again before 60 sec for only who using the command or for all players?
  12. you have two event onPlayerJoin try this local color = get('joinquitcolor') function playerjoin() local name = getPlayerName(source) local ip = getPlayerIP (source) local version = getPlayerVersion (source) local country = call(getResourceFromName("admin"), "getPlayerCountry", source) if country then outputChatBox(name.." has joined the server. ["..country.."] ["..ip.."] ["..version.."]",root,color) else outputChatBox(name.." has joined the server. [unknow] ["..ip.."] ["..version.."]",root,color) end end addEventHandler("onPlayerJoin",root,playerjoin) function playerquit(reason) local name = getPlayerName(source) if reason == "Quit" then outputChatBox(name.." has disconnected from the server",root, color) elseif (reason == "Kicked" ) then outputChatBox(name.." has been kicked from the server",root,color) elseif (reason == "Banned" ) then outputChatBox(name.." has been banned from the server",root,color) elseif (reason == "Timed out") then outputChatBox(name.." has lost connection with the server",root,color) end end addEventHandler("onPlayerQuit",root,playerquit) function playernickchange(oldNick, newNick) outputChatBox("* "..old.." has changed his name to "..new,root,255,100,100) end addEventHandler("onPlayerChangeNick", root, playernickchange) --------------------------------------------------- "[EGL]Chris" version="0.5" type="script" name="Essentials" description="This script add's alot of features for admin's and players. Hope you like it." /> "*language" value="english" /> "*joinquitcolor" value="255,200,100" />
  13. TAPL

    toggle on/off

    function damageCheck(attacker, weapon) if not ( attacker ) then return end local playeraccount = getPlayerAccount ( attacker ) if ( playeraccount ) and not isGuestAccount(playeraccount) then if getAccountData ( playeraccount, "carshow" ) then if(weapon == 5)then setElementPosition(source,1891.14,-1881.70,13.47) else end end end end local dmg = false function toggleDMG (thePlayer) if (dmg == false) then addEventHandler( "onPlayerDamage", root, damageCheck ) dmg = true else dmg = false removeEventHandler( "onPlayerDamage", root, damageCheck ) end end bindKey ( element, "F1", "down", toggleDMG )
  14. TAPL

    toggle on/off

    function damageCheck(attacker, weapon) local playeraccount = getPlayerAccount ( attacker ) if ( playeraccount ) and not isGuestAccount(playeraccount) then if getAccountData ( playeraccount, "carshow" ) then if(weapon == 5)then setElementPosition(source,1891.14,-1881.70,13.47) else end end end end local dmg = false function toggleDMG (thePlayer) if (dmg == false) then addEventHandler( "onPlayerDamage", root, damageCheck ) else removeEventHandler( "onPlayerDamage", root, damageCheck ) end end bindKey ( element, "F1", "down", toggleDMG ) change element to the player you want bindKey for him or any way you will use you can edit the code..
  15. when i say for you (this is not Request forum) this mean i start insult you? wow this what you think? look up what i give you or what i fix for you you just put a random code and say fix my script your script fixed, now you need more thing, but did you try to make these things by yourself? answer: of course not, you just type your Request in forum without trying anything.
  16. https://wiki.multitheftauto.com/wiki/OnC ... ourceStart https://wiki.multitheftauto.com/wiki/IsTransferBoxActive
  17. i know what you are trying to do and i can make it it's very easy but, this is not Request Forum Make it By YourSelf!!!!!!!!!!! start Learn and Stop Copy and Past From Wiki
  18. server side addEventHandler("onResourceStart",resourceRoot, outputChatBox("War_System|x[Dev-PoinT]x!",root,255,255,0) end) function xxx (ammo, killer, killerweapon, bodypart ) if (killer) and (killer ~= source ) then giveWeapon ( killer, 39, 2, true ) triggerClientEvent ( root, "StartSiren", root ) outputChatBox(getPlayerName(killer) .." has Now a Special Weapon, watch out!", root, 255, 255, 0) end end addEventHandler ("onPlayerWasted", root, xxx) Client side function StartSound () local sound = playSound("sounds/Siren.mp3") setSoundVolume(sound, 0.5) end addEvent( "StartSiren", true ) addEventHandler( "StartSiren", root, StartSound ) function outputWantedLevel () local wantedLvl = getPlayerWantedLevel () if wantedLvl == 0 then outputChatBox ( "You clean", 0, 255, 0) else outputChatBox ( "You have "..wantedLvl.." Wanted stars!", 255, 0, 0) end end addEventHandler ( "onClientResourceStart", resourceRoot, outputWantedLevel )
  19. i suggest to make the script from Server side and triggerClientEvent to playSound
  20. Solidsnake14, getPlayerWantedLevel can be Client and Server functions.
  21. this should work Client-Side --these are the banned vehicle ids where you cannot get drift points. local BannedIDs = { 432, 532 } local rootElem = getRootElement() local thisRoot = getResourceRootElement(getThisResource()) local player = getLocalPlayer() local vehicle local size = 1.2 local modo = 0.01 local score = 0 local screenScore = 0 local tick local idleTime local multTime local driftTime local Yellow = tocolor(255,232,25) local Red = tocolor(234,0,3) local TempCol = Yellow local mult = 1 local tablamult = {350,1400,4200,11200} local anterior = 0 local mejor = 0 local total = 0 local global_mejor = 0 local global_nombre = "N/A" local screenWidth, screenHeight = guiGetScreenSize() local x1,y1,x2,y2 = screenWidth*0.2,screenHeight*0.1,screenWidth*0.8,screenHeight*0.8 addEventHandler("onClientResourceStart", thisRoot, function() addEventHandler("onClientRender", rootElem, showText) outputChatBox("Waiting for server drift data...") triggerServerEvent("driftClienteListo", rootElem, player) end ) addEventHandler("onClientResourceStop", thisRoot, function() removeEventHandler("onClientRender", rootElem, showText) end ) function isValidVehicle() local temp = getPedOccupiedVehicle(player) if not temp or getVehicleOccupant(temp,0) ~= player or getVehicleType(temp) ~= "Automobile" then return false end local vehID = getElementModel(temp) for k,v in ipairs(BannedIDs) do if vehID == v then return false end end return temp end function showText() dxDrawText(string.format("Best Drift: %s - %d",global_nombre,global_mejor),44,screenHeight-43,screenWidth,screenHeight,Yellow,1,"pricedown") vehicle = isValidVehicle() if not vehicle then return end if size > 1.3 then modo = -0.01 elseif size < 1.2 then modo = 0.01 end size = size + modo tick = getTickCount() local angulo,velocidad = angle() local tempBool = tick - (idleTime or 0) < 750 if not tempBool and score ~= 0 then anterior = score setElementData(player, "Last Drift", anterior) total = total+anterior setElementData(player, "Total Drift", total) if score > mejor then mejor = score setElementData(player, "Best Drift", mejor) checkPuntaje(mejor) end triggerEvent("onVehicleDriftEnd", rootElem, tick-driftTime-750) score = 0 end if angulo ~= 0 then if score == 0 then triggerEvent("onVehicleDriftStart", rootElem) driftTime = tick end if tempBool then score = score + math.floor(angulo*velocidad)*mult else score = math.floor(angulo*velocidad)*mult end if TempCol == Red then TempCol = Yellow end screenScore = score idleTime = tick end local temp2 = string.format("Factor: X%d\n%s",mult,mult~=5 and string.format("Gain X%d with %d",mult+1,tablamult[mult]) or "MAX") dxDrawText(temp2, 20,155,screenWidth,screenHeight, Yellow, 1.2, "sans","left","top", false,true,false) if velocidad <= 0.3 and mult ~= 1 then dxDrawText("\n\nToo Slow!", 20,155,screenWidth,screenHeight, Yellow, 1.2, "sans","left","top", false,true,false) end if tick - (idleTime or 0) < 3000 then local temp = "DRIFT" if score >= 100000 then temp = "DRIFT\n\nDrift King!" elseif score >= 50000 then temp = "DRIFT\n\nInsane Drift!" elseif score >= 20000 then temp = "DRIFT\n\nOutrageous!" elseif score >= 15000 then temp = "DRIFT\n\nColossal!" elseif score >= 7000 then temp = "DRIFT\n\nSuberb!" elseif score >= 3000 then temp = "DRIFT\n\nGreat Drift!" elseif score >= 1000 then temp = "DRIFT\n\nGood Drift!" end dxDrawText(temp, x1,y1,x2,y2, TempCol, 2.2, "sans","center","top", false,true,false) dxDrawText(string.format("\n%d",screenScore), x1,y1-10,x2,y2, TempCol, size, "pricedown","center","top", false,true,false) end end function angle() local vx,vy,vz = getElementVelocity(vehicle) local modV = math.sqrt(vx*vx + vy*vy) if not isVehicleOnGround(vehicle) then return 0,modV end local rx,ry,rz = getElementRotation(vehicle) local sn,cs = -math.sin(math.rad(rz)), math.cos(math.rad(rz)) local deltaT = tick - (multTime or 0) if mult~= 1 and modV <= 0.3 and deltaT > 750 then mult = mult-1 multTime = tick elseif deltaT > 1500 then local temp = 1 if score >= 11200 then temp = 5 elseif score >= 4200 then temp = 4 elseif score >= 1400 then temp = 3 elseif score >= 350 then temp = 2 end if temp>mult then mult = temp multTime = tick end end if modV <= 0.2 then return 0,modV end --speed over 40 km/h local cosX = (sn*vx + cs*vy)/modV if cosX > 0.966 or cosX < 0 then return 0,modV end --angle between 15 and 90 degrees return math.deg(math.acos(cosX))*0.5, modV end addEvent("driftCarCrashed", true) addEventHandler("driftCarCrashed", rootElem, function() if score ~= 0 then score = 0 mult = 1 TempCol = Red triggerEvent("onVehicleDriftEnd", rootElem, 0) end end ) addEvent("driftActualizarRecord", true) addEventHandler("driftActualizarRecord", rootElem, function(score, name) global_mejor = score global_nombre = name end ) function resetScore() anterior,mejor,total = 0,0,0 setElementData(player, "Last Drift", anterior) setElementData(player, "Total Drift", total) setElementData(player, "Best Drift", mejor) end addEvent("driftResetAllScores", true) addEventHandler("driftResetAllScores", rootElem, resetScore) addCommandHandler("resetdrift", resetScore) function checkPuntaje(BestDrift) triggerServerEvent("driftNuevoRecord", rootElem, BestDrift, string.gsub(getPlayerName(player), "#%x%x%x%x%x%x", "")) end
  22. try this function zombiedamaged ( attacker, weapon, bodypart ) local health = getElementHealth ( source ) if (health < 60) then thePed = source triggerServerEvent ("onDamage", getRootElement(), attacker, thePed, weapon) end end addEventHandler ( "onClientPedDamage", getRootElement(), zombiedamaged ) function damageHandler(killer, thePed, theWeapon) killPed(thePed, killer, theWeapon ) givePlayerMoney ( killer, 30 ) end addEvent("onDamage", true) addEventHandler("onDamage", getRootElement(), damageHandler) --------------- setPedStat ( source, 24, 1000 ) work with me i tested it
  23. addCommandHandler("ltd", function (thePlayer, cmd, tarPlayer) local name = getPlayerFromName ( tarPlayer ) if name then outputChatBox(getPlayerName(thePlayer).." #0099ffSays #ffffffLearn To #0099ffDrive "..getPlayerName(name).." !!",root, 255, 255, 255, true ) else outputChatBox("Player not found",thePlayer, 255, 255, 255, true ) end end)
  24. This function allows you to register a custom event. did you read wiki? I suggest you to read wiki before post anything https://wiki.multitheftauto.com/wiki/AddEvent addEvent is only for Custom events
×
×
  • Create New...