Jump to content

LiOneLMeSsIShoT

Members
  • Posts

    609
  • Joined

  • Last visited

Everything posted by LiOneLMeSsIShoT

  1. whatever when i remove it .. the ped don't even follow me or move forward too !!!!
  2. Actually i think you have to create account there first. https://wiki.multitheftauto.com/index.p ... =Main_Page
  3. Yes man i will try but how i give name to the first pickup to use it? i mean how to give the x,y,z names to use them? How to give a variable for the object?
  4. I've made this simple script to set the player position...but when i try to do /setpos 125 156..like use x, y..i get error in debugscript 3 ...and i don't want this error move to debugscript 3 because it's mistake to write x and y..or even z only..so how to fix this? function pSet (source, commandName, arg, posX, posY, posZ) if arg then setElementPosition (source, posX, posY, posZ) else outputChatBox ("Use: /setpos x,y,z", source, 255, 0, 0, false) end end addCommandHandler ( "setpos", pSet )
  5. how to get the vehicle ids? i don't mean about that the normal ids for them....i mean like..put ids for them to use them...like when you type /vehicleids it's outputChatBox the ids of the vehicles near you.
  6. Sure it can be Steavy...try it in your server.
  7. function() local skill = getPedStat(localPlayer, 69) (math.floor(0.1 * 10/)10) for i, o in ipairs(Levels) do if skill >= o[2] then Level = o[1] guiSetText(Colt45_Levels, Level) Error: ambiguous syntax (function call x new statement) near '(' Actually did it..but still not shows 0.1 local skill = math.floor(getPedStat(localPlayer, 69) * 10/10)
  8. function() local skill = getPedStat(localPlayer, 69) (math.floor(0.1 * 10/)10) for i, o in ipairs(Levels) do if skill >= o[2] then Level = o[1] guiSetText(Colt45_Levels, Level) Error: ambiguous syntax (function call x new statement) near '('
  9. i want it to be here...so how ? local skill = getPedStat(localPlayer, 69) guiSetText(Colt45_Levels, Level)
  10. Thanks but when i do the stat + 0.1 it shows in the gui label like 0.1545646541641 .... a lot of numbers so how to make it only 0.1 when i kill..not like 0.1541515616 setPedStat ( killer, Stats[tonumber(weapon)][1], getPedStat ( killer, Stats[tonumber(weapon)][1] ) + 0.1 )
  11. I got an error in my table... help please. local stats = { {69,22} {70,23} {71,24} {72,25} {73,26} {74,27} {75,28} {76,29} {77,30} {78,31} {79,34} } function weaponstats (killer, weapon) local stat = getPedStat(killer, stats ) if killer and killer ~= source then if (weapon == stats) then setPedStat( killer, 78, stat+0.1) end end end addEventHandler( "onZombieWasted", getRootElement(),weaponstats) error: '}' expected (to close '{' at line 1) near '{'
  12. In this script no errors...whatever the ped don't even move forward and follows me. server: function follow (thePlayer) local x, y, z = getElementPosition(thePlayer) local guard = createPed (240, x, y, z) local tx, ty, tz = getElementPosition(guard) local dis = getDistanceBetweenPoints2D (x, y, tx, ty) setPedRotation(guard, findRotation(tx, ty, x, y)) if dis > 2 then setElementData (guard, "Move!", guard) triggerClientEvent (thePlayer, "moveGuard", guard) else setElementData (guard, "Stop!", guard) triggerClientEvent (thePlayer, "stopGuard", guard) end end addCommandHandler ("guard", follow) function findRotation(x1,y1,x2,y2) local t = -math.deg(math.atan2(x2-x1,y2-y1)) if t < 0 then t = t + 360 end return t end client: function moveGuard() getElementData (source, "Move!", guard) setPedControlState (source, "forwards", true) end addEvent("moveGuard",true) addEventHandler ("moveGuard", getRootElement(), moveGuard) function stopGuard () getElementData (source, "Stop!", guard) setPedControlState (source, "forwards", false) end addEvent("stopGuard", true) addEventHandler ("stopGuard", getRootElement(), stopGuard)
  13. but when i pm myself it says nothing ... whatever else outputchatbox ("you cannot pm yourself") added and no error
  14. Works Fine ...Thank You myonlake you always fix the problems in my scripts and Tapl too ... Thanks guys!
  15. I have edited it : addCommandHandler("pm", function(thePlayer, commandName, sendTo, ...) local sendTo = tonumber(sendTo) local pmMessage = table.concat({...}, " ") local target if (sendTo) then target = exports.ID_System:getPlayerFromID(sendTo) else target = getPlayerFromPartialName(sendTo, thePlayer) end if (target) then if (target ~= thePlayer) then if (#pmMessage > 0) then outputChatBox("#0044FF[PM]#FFFFFF Message to #FFFFFF" .. getPlayerName(toPlayer) .. "#FFFFFF: " .. pmMessage, thePlayer, 255, 255, 255, true) outputChatBox("#0044FF[PM]#FFFFFF Message from #FFFFFF" .. getPlayerName(thePlayer) .. "#FFFFFF: " .. pmMessage, toPlayer, 255, 255, 255, true) else outputChatBox("#0044FF[PM]#FFFFFF Invalid syntax! Usage:#FFFFFF /" .. commandName .. " [partial player name] [message]", thePlayer, 255, 255, 255, true) end end else outputChatBox("#0044FF[PM]#FFFFFF Player not found! #FFFF00(#FFFFFF" .. sendTo .. "#FFFF00)", thePlayer, 255, 255, 255, true) end end, false, false ) function getPlayerFromPartialName(name, sourcePlayer) if (sourcePlayer) then if (name == "*") or (string.gsub(getPlayerName(sourcePlayer), "#%x%x%x%x%x%x", ""):lower() == name:lower()) then return sourcePlayer end end local match = {} for _,player in ipairs(getElementsByType("player")) do local matchName = string.gsub(getPlayerName(v), "#%x%x%x%x%x%x", "") if (matchName:find(name:lower(), 0)) then table.insert(match, player) end return (#match > 1 and false or match[1]) end end then got error in 31: :31: attempt to index local 'name' (a nil value)
  16. Alright i have no one in my server now because local...and i can't pm myself so can you make me able to pm myself to test?
  17. in this script when i do /pm nothing happen function privateMessage(thePlayer,commandName,arg,sendToName,...) local pmWords = { ... } local pmMessage = table.concat( pmWords, " " ) local ID = tonumber(arg) if ID then target = exports.ID_System:getPlayerFromID(ID) else target = getPlayerFromName(arg) end if target then if target ~= player then if sendToName then if (getPlayerFromParticalName (sendToName)) then toPlayer = (getPlayerFromParticalName (sendToName)) if not (toPlayer == thePlayer) then if not (pmMessage == "") then outputChatBox("#0044FF[PM]#FFFFFF Message to #FFFFFF" .. getPlayerName(toPlayer) .. "#FFFFFF: " .. pmMessage, thePlayer, 255, 255, 255, true) outputChatBox("#0044FF[PM]#FFFFFF Message from #FFFFFF" .. getPlayerName(thePlayer) .. "#FFFFFF: " .. pmMessage, toPlayer, 255, 255, 255, true) else outputChatBox("#0044FF[PM]#FFFFFF Invalid syntax! Usage:#FFFFFF /pm [partical player name] [message]", thePlayer, 255, 255, 255, true) return false end else outputChatBox("#0044FF[PM]#FFFFFF You cannot PM yourself#FFFFFF!", thePlayer, 255, 255, 255, true) return false end else outputChatBox("#0044FF[PM]#FFFFFF Player not found! #FFFF00(#FFFFFF"..sendToName.."#FFFF00)", thePlayer, 255, 255, 255, true) return false end else outputChatBox("#0044FF[PM]#FFFFFF Invalid syntax! Usage:#FFFFFF /pm [partical player name] [message]", thePlayer, 255, 255, 255, true) return false end end end end addCommandHandler("pm", privateMessage) function getPlayerFromParticalName(thePlayerName) local thePlayer = getPlayerFromName(thePlayerName) if thePlayer then return thePlayer end for _,thePlayer in ipairs(getElementsByType("player")) do if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), thePlayerName:lower(), 1, true) then return thePlayer end end return false end no error
  18. Alright but there's some zombies i can't kill from head..they need couple of shots to die..but they don't even lose -1.. Client: myZombies = { } helmetzombies = { 27, 51, 52, 99, 27, 137, 153, 167, 205, 260, 277, 278, 279, 284, 285 } resourceRoot = getResourceRootElement() --FORCES ZOMBIES TO MOVE ALONG AFTER THEIR TARGET PLAYER DIES function playerdead () setTimer ( Zomb_release, 4000, 1 ) end addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), playerdead ) function Zomb_release () for k, ped in pairs( myZombies ) do if (isElement(ped)) then if (getElementData (ped, "zombie") == true) then setElementData ( ped, "target", nil ) setElementData ( ped, "status", "idle" ) table.remove(myZombies,k) end end end end --REMOVES A ZOMBIE FROM INFLUENCE AFTER ITS KILLED function pedkilled ( killer, weapon, bodypart ) if (getElementData (source, "zombie") == true) and (getElementData (source, "status") ~= "dead" ) then setElementData ( source, "target", nil ) setElementData ( source, "status", "dead" ) end end addEventHandler ( "onClientPedWasted", getRootElement(), pedkilled ) --THIS CHECKS ALL ZOMBIES EVERY SECOND TO SEE IF THEY ARE IN SIGHT function zombie_check () if (getElementData (getLocalPlayer (), "zombie") ~= true) and ( isPlayerDead ( getLocalPlayer () ) == false ) then local zombies = getElementsByType ( "ped",getRootElement(),true ) local Px,Py,Pz = getElementPosition( getLocalPlayer () ) if isPedDucked ( getLocalPlayer ()) then local Pz = Pz-1 end for theKey,theZomb in ipairs(zombies) do if (isElement(theZomb)) then local Zx,Zy,Zz = getElementPosition( theZomb ) if (getDistanceBetweenPoints3D(Px, Py, Pz, Zx, Zy, Zz) < 45 ) then if (getElementData (theZomb, "zombie") == true) then if ( getElementData ( theZomb, "status" ) == "idle" ) then --CHECKS IF AN IDLE ZOMBIE IS IN SIGHT local isclear = isLineOfSightClear (Px, Py, Pz+1, Zx, Zy, Zz +1, true, false, false, true, false, false, false) if (isclear == true) then setElementData ( theZomb, "status", "chasing" ) setElementData ( theZomb, "target", getLocalPlayer() ) table.insert( myZombies, theZomb ) --ADDS ZOMBIE TO PLAYERS COLLECTION table.remove( zombies, theKey) zombieradiusalert (theZomb) end elseif (getElementData(theZomb,"status") == "chasing") and (getElementData(theZomb,"target") == nil) then --CHECKS IF AN AGGRESSIVE LOST ZOMBIE IS IN SIGHT local isclear = isLineOfSightClear (Px, Py, Pz+1, Zx, Zy, Zz +1, true, false, false, true, false, false, false) if (isclear == true) then setElementData ( theZomb, "target", getLocalPlayer() ) isthere = "no" for k, ped in pairs( myZombies ) do if ped == theZomb then isthere = "yes" end end if isthere == "no" then table.insert( myZombies, theZomb ) --ADDS THE WAYWARD ZOMBIE TO THE PLAYERS COLLECTION table.remove( zombies, theKey) end end elseif ( getElementData ( theZomb, "target" ) == getLocalPlayer() ) then --CHECKS IF AN ALREADY AGGRESSIVE ZOMBIE IS IN SIGHT local isclear = isLineOfSightClear (Px, Py, Pz+1, Zx, Zy, Zz +1, true, false, false, true, false, false, false) if (isclear == false) then --IF YOUR ZOMBIE LOST YOU, MAKES IT REMEMBER YOUR LAST COORDS setElementData ( theZomb, "target", nil ) triggerServerEvent ("onZombieLostPlayer", theZomb, oldPx, oldPy, oldPz) end end end end end end --this second half is for checking peds and zombies local nonzombies = getElementsByType ( "ped",getRootElement(),true ) for theKey,theZomb in ipairs(zombies) do if (isElement(theZomb)) then if (getElementData (theZomb, "zombie") == true) then local Zx,Zy,Zz = getElementPosition( theZomb ) for theKey,theNonZomb in ipairs(nonzombies) do if (getElementData (theNonZomb, "zombie") ~= true) then -- if the ped isnt a zombie local Px,Py,Pz = getElementPosition( theNonZomb ) if (getDistanceBetweenPoints3D(Px, Py, Pz, Zx, Zy, Zz) < 45 ) then local isclear = isLineOfSightClear (Px, Py, Pz+1, Zx, Zy, Zz +1, true, false, false, true, false, false, false ) if (isclear == true) and ( getElementHealth ( theNonZomb ) > 0) then if ( getElementData ( theZomb, "status" ) == "idle" ) then --CHECKS IF AN IDLE ZOMBIE IS IN SIGHT triggerServerEvent ("onZombieLostPlayer", theZomb, Px, Py, Pz) setElementData ( theZomb, "status", "chasing" ) setElementData ( theZomb, "target", theNonZomb ) zombieradiusalert (theZomb) elseif ( getElementData ( theZomb, "status" ) == "chasing" ) and ( getElementData ( theZomb, "target" ) == nil) then triggerServerEvent ("onZombieLostPlayer", theZomb, Px, Py, Pz) setElementData ( theZomb, "target", theNonZomb ) end end end if ( getElementData ( theZomb, "target" ) == theNonZomb ) then --CHECKS IF AN ALREADY AGGRESSIVE ZOMBIE IS IN SIGHT OF THE PED local Px,Py,Pz = getElementPosition( theNonZomb ) if (getDistanceBetweenPoints3D(Px, Py, Pz, Zx, Zy, Zz) < 45 ) then local isclear = isLineOfSightClear (Px, Py, Pz+1, Zx, Zy, Zz+1, true, false, false, true, false, false, false) if (isclear == false) then --IF YOUR ZOMBIE LOST THE PED, MAKES IT REMEMBER the peds LAST COORDS triggerServerEvent ("onZombieLostPlayer", theZomb, Px, Py, Pz) setElementData ( theZomb, "target", nil ) end end end end end end end end end for k, ped in pairs( myZombies ) do if (isElement(ped) == false) then table.remove( myZombies, k) end end oldPx,oldPy,oldPz = getElementPosition( getLocalPlayer () ) end --INITAL SETUP function clientsetupstarter(startedresource) if startedresource == getThisResource() then setTimer ( clientsetup, 1234, 1) MainClientTimer1 = setTimer ( zombie_check, 1000, 0) --STARTS THE TIMER TO CHECK FOR ZOMBIES end end addEventHandler("onClientResourceStart", getRootElement(), clientsetupstarter) function clientsetup() oldPx,oldPy,oldPz = getElementPosition( getLocalPlayer () ) throatcol = createColSphere ( 0, 0, 0, .3) woodpic = guiCreateStaticImage( .65, .06, .1, .12, "zombiewood.png", true ) guiSetVisible ( woodpic, false ) --ALL ZOMBIES STFU local zombies = getElementsByType ( "ped" ) for theKey,theZomb in ipairs(zombies) do if (isElement(theZomb)) then if (getElementData (theZomb, "zombie") == true) then setPedVoice(theZomb, "PED_TYPE_DISABLED") end end end --SKIN REPLACEMENTS local skin = engineLoadTXD ( "skins/13.txd" ) --bleedin eyes 31 by Slothman engineImportTXD ( skin, 13 ) local skin = engineLoadTXD ( "skins/22.txd" ) -- slashed 12 by Wall-E engineImportTXD ( skin, 22 ) local skin = engineLoadTXD ( "skins/56.txd" ) --young and blue by Slothman engineImportTXD ( skin, 56 ) local skin = engineLoadTXD ( "skins/67.txd" ) -- slit r* employee engineImportTXD ( skin, 67 ) local skin = engineLoadTXD ( "skins/68.txd" ) -- shredded preist by Deixell engineImportTXD ( skin, 68 ) local skin = engineLoadTXD ( "skins/69.txd" ) --bleedin eyes in denim by Capitanazop engineImportTXD ( skin, 69 ) local skin = engineLoadTXD ( "skins/70.txd" ) --ultra gory scientist by 50p engineImportTXD ( skin, 70 ) local skin = engineLoadTXD ( "skins/84.txd" ) --guitar wolf (nonzombie) by Slothman engineImportTXD ( skin, 84 ) local skin = engineLoadTXD ( "skins/92.txd" ) -- peeled flesh by xbost engineImportTXD ( skin, 92 ) local skin = engineLoadTXD ( "skins/97.txd" ) -- easterboy by Slothman engineImportTXD ( skin, 97 ) local skin = engineLoadTXD ( "skins/105.txd" ) --Scarred Grove Gangster by Wall-E engineImportTXD ( skin, 105 ) local skin = engineLoadTXD ( "skins/107.txd" ) --ripped and slashed grove by Wall-E engineImportTXD ( skin, 107 ) local skin = engineLoadTXD ( "skins/108.txd" ) -- skeleton thug by Deixell engineImportTXD ( skin, 108 ) local skin = engineLoadTXD ( "skins/111.txd" ) --Frank West from dead rising (nonzombie) by Slothman engineImportTXD ( skin, 111 ) local skin = engineLoadTXD ( "skins/126.txd" ) -- bullet ridden wiseguy by Slothman engineImportTXD ( skin, 126 ) local skin = engineLoadTXD ( "skins/127.txd" ) --flyboy from dawn of the dead by Slothman engineImportTXD ( skin, 127 ) local skin = engineLoadTXD ( "skins/128.txd" ) --holy native by Slothman engineImportTXD ( skin, 128 ) local skin = engineLoadTXD ( "skins/152.txd" ) --bitten schoolgirl by Slothman engineImportTXD ( skin, 152 ) local skin = engineLoadTXD ( "skins/162.txd" ) --shirtless redneck by Slothman engineImportTXD ( skin, 162 ) local skin = engineLoadTXD ( "skins/167.txd" ) --dead chickenman by 50p engineImportTXD ( skin, 167 ) local skin = engineLoadTXD ( "skins/188.txd" ) --burnt greenshirt by Slothman engineImportTXD ( skin, 188 ) local skin = engineLoadTXD ( "skins/192.txd" ) --Alice from resident evil (nonzombie) by Slothman engineImportTXD ( skin, 192 ) local skin = engineLoadTXD ( "skins/195.txd" ) --bloody ex by Slothman engineImportTXD ( skin, 195 ) local skin = engineLoadTXD ( "skins/206.txd" ) -- faceless zombie by Slothman engineImportTXD ( skin, 206 ) local skin = engineLoadTXD ( "skins/209.txd" ) --Noodle vendor by 50p engineImportTXD ( skin, 209 ) local skin = engineLoadTXD ( "skins/212.txd" ) --brainy hobo by Slothman engineImportTXD ( skin, 212 ) local skin = engineLoadTXD ( "skins/229.txd" ) --infected tourist by Slothman engineImportTXD ( skin, 229 ) local skin = engineLoadTXD ( "skins/230.txd" ) --will work for brains hobo by Slothman engineImportTXD ( skin, 230 ) local skin = engineLoadTXD ( "skins/258.txd" ) --bloody sided suburbanite by Slothman engineImportTXD ( skin, 258 ) local skin = engineLoadTXD ( "skins/264.txd" ) --scary clown by 50p engineImportTXD ( skin, 264 ) local skin = engineLoadTXD ( "skins/274.txd" ) --Ash Williams (nonzombie) by Slothman engineImportTXD ( skin, 274 ) local skin = engineLoadTXD ( "skins/277.txd" ) -- gutted firefighter by Wall-E engineImportTXD ( skin, 277 ) local skin = engineLoadTXD ( "skins/280.txd" ) --infected cop by Lordy engineImportTXD ( skin, 280 ) local skin = engineLoadTXD ( "skins/287.txd" ) --torn army by Deixell engineImportTXD ( skin, 287 ) end --UPDATES PLAYERS COUNT OF AGGRESIVE ZOMBIES addEventHandler ( "onClientElementDataChange", getRootElement(), function ( dataName ) if getElementType ( source ) == "ped" and dataName == "status" then local thestatus = (getElementData ( source, "status" )) if (thestatus == "idle") or (thestatus == "dead") then for k, ped in pairs( myZombies ) do if ped == source and (getElementData (ped, "zombie") == true) then setElementData ( ped, "target", nil ) table.remove( myZombies, k) setElementData ( getLocalPlayer(), "dangercount", tonumber(table.getn( myZombies )) ) end end end end end ) --MAKES A ZOMBIE JUMP addEvent( "Zomb_Jump", true ) function Zjump ( ped ) if (isElement(ped)) then setPedControlState( ped, "jump", true ) setTimer ( function (ped) if ( isElement ( ped ) ) then setPedControlState ( ped, "jump", false) end end, 800, 1, ped ) end end
×
×
  • Create New...