
LiOneLMeSsIShoT
Members-
Posts
609 -
Joined
-
Last visited
Everything posted by LiOneLMeSsIShoT
-
Yep this one's the error.
-
NOw tried it : function kiss (thePlayer, cmd, otherPlayer) local otherPlayer = exports["ID_System"]:getPlayerFromPartialName(thePlayer, otherPlayer, true) local x, y, z = getElementPosition(thePlayer) local tx, ty, tz = getElementPosition(otherPlayer) if (not otherPlayer) then return end if (getPedOccupiedVehicle(thePlayer) == false and getPedOccupiedVehicle(otherPlayer) == false) then if (getDistanceBetweenPoints3D(x, y, z, tx, ty, tz)<1) then setPedAnimation (thePlayer, "KISSING", "Grlfrd_Kiss_03", -1, true, false, false ) setPedAnimation (otherPlayer, "KISSING", "Grlfrd_Kiss_03", -1, true, false, false ) end end end addCommandHandler ("kiss", kiss) Still the same errors.
-
Alright this is the Id_system Function, so what's the problem?> function getPlayerFromPartialName ( source, player_name, script ) if ( player_name ) then local sucess, value = getNameMatches ( player_name ) if ( sucess ) then local matches = ( type ( value ) == "table" ) and #value or 1 if ( matches == 1 ) then if ( script ) then return value else local player_nick = getPlayerName ( value ) local player_id = getElementData ( value, "ID" ) outputChatBox ( "(" .. player_id .. ") " .. player_nick, source, 255, 255, 0 ) end else outputChatBox ( "Players matching your search are: ", source, 255, 255, 0 ) for k, player in ipairs ( value ) do local player_nick = getPlayerName ( value[k] ) local player_id = getElementData ( value[k], "ID" ) outputChatBox ( "(" .. player_id .. ") " .. player_nick, source, 255, 255, 0 ) end return true, true end else if ( script ) then return false else outputChatBox ( "Players matching your search are: ", source, 255, 255, 0 ) outputChatBox ( value, source, 255, 0, 0 ) end end end end
-
Any help please?
-
I'm Trying to make a script to shakehands with another player when command be written so i tried to do it function kiss (thePlayer, cmd, otherPlayer) local otherPlayer = exports["ID_System"]:getPlayerFromPartialName(thePlayer, otherPlayer) local x, y, z = getElementPosition(thePlayer) local tx, ty, tz = getElementPosition(otherPlayer) if (getPedOccupiedVehicle(thePlayer) == false and getPedOccupiedVehicle(otherPlayer) == false) and otherPlayer then if (getDistanceBetweenPoints3D(x, y, z, tx, ty, tz)<1) then setPedAnimation (thePlayer, "KISSING", "Grlfrd_Kiss_03", -1, true, false, false ) setPedAnimation (otherPlayer, "KISSING", "Grlfrd_Kiss_03", -1, true, false, false ) end end end addCommandHandler ("kiss", kiss) Errors: [16:42:47] ERROR: call: failed to call 'ID_System:getPlayerFromPartialName' [string "?"] [16:42:47] WARNING: Animation_system\Kiss_Anim\anim.lua:4: Bad argument @ 'getElementPosition' [Expected element at argument 1, got boolean] [16:42:47] WARNING: Animation_system\Kiss_Anim\anim.lua:5: Bad argument @ 'getPedOccupiedVehicle'
-
so i have to do it true ? did it true but still the same errors: if zombies == true and isElement (guards[source]) then if clear then So man/ ? ?
-
so i have to do it true ? did it true but still the same errors: if zombies == true and isElement (guards[source]) then if clear then
-
so i have to do it true ?
-
I'm sorry, but now i have made it by myself but i got error: function Example () table.insert (guards, source) local guard = guards local zombies = exports ["zombies"]:isPedZombie (source) local gx, gy, gz = getElementPosition(guard) -- guards local zx, zy, zz = getElementPosition(zombies) -- zombies local clear = isLineOfSightClear (gx, gy, gz, zx, zy, zz,true, false, false, true, false, false, false) if zombies and isElement (guards[source]) then if clear then setPedControlState( ped, "fire", true ) outputChatBox ("Attack! ") end end end addEventHandler ("onClientPlayerDamage",getRootElement(),Example) Bad argument @ 'isLineOfSightClear' [Expected number at argument 1, got boolean] bad argument @ 'getElementPositon' bad argument @ 'getElementPosition'
-
isLineOfSightClear processLineOfSight ِAlright man ! but the other problem here : function Example (killer) table.insert (guards, source) if killer == exports ["zombies"]:isPedZombie (source) and isElement (guards[source]) then --- i need now to make the guard hit the zombie...after the zombie just hurted the owner... and if some player hit the owner the guard will shot him too idk how i do it. help addEventHandler ("onClientPlayerDamage",getRootElement(),Example) can you help me with that? startX: The first point's world X coordinate. startY: The first point's world Y coordinate. startZ: The first point's world Z coordinate. endX: The second point's world X coordinate. endY: The second point's world Y coordinate. endZ: The second point's world Z coordinate. do that endX, endY,endZ means rotations? or what..i don't understand what endX,endY,endZ means.
-
isLineOfSightClear processLineOfSight ِAlright man ! but the other problem here : function Example (killer) table.insert (guards, source) if killer == exports ["zombies"]:isPedZombie (source) and isElement (guards[source]) then --- i need now to make the guard hit the zombie...after the zombie just hurted the owner... and if some player hit the owner the guard will shot him too idk how i do it. help addEventHandler ("onClientPlayerDamage",getRootElement(),Example) can you help me with that?
-
Oh yeah ! ! That's what i'm Talking about man and i've tried it but need you to tell me what should i do now function Example (killer) table.insert (guards, source) if killer == exports ["zombies"]:isPedZombie (source) and isElement (guards[source]) then --- i need now to make the guard hit the zombie...after the zombie just hurted the owner... and if some player hit the owner the guard will shot him too idk how i do it. help addEventHandler ("onClientPlayerDamage",getRootElement(),Example) and also how to check if there's object infront of the ped that make him can't move so he jump to cross it.
-
So i don't need this? function cancelPedDamage ( attacker ) local guardsrecieved = triggerServerEvent("returnTable", attacker) if (guardsrecieved[attacker][1] == source) then cancelEvent() -- cancel any damage done to peds end end addEventHandler ( "onClientPedDamage", getRootElement(), cancelPedDamage ) and this? function returnTable() return guards end addEvent("returnTable", true) addEventHandler("returnTable", getRootElement(), returnTable) and also that script you fixed is giving weapons to all peds that spawned in one type "man i want to give the weapons to the peds one by one not in one time because i'm gonna do a gui that sell weapons to the guards so when i click on the gui he wont be able to buy one weapon and give it to all avilable guards he have, i hope you understand me !
-
Wait a second please, I've edited the client to make the ped sprint when he's away and edited somethings, so can you check it: local guards = {} function moveGuard() table.insert(guards, source) end addEvent("moveGuard",true) addEventHandler ("moveGuard", getRootElement(), moveGuard) function followPlayer() for index, guard in pairs(guards) do if (not isElement(guard) or isPedDead(guard)) then table.remove(guards, index) else local int, dim = getElementInterior(localPlayer), getElementDimension(localPlayer) local tint, tdim = getElementInterior(guard), getElementDimension(guard) if (int ~= tint) then setElementInterior(guard, int) end if (dim ~= tdim) then setElementDimension(guard, dim) end local x, y, z = getElementPosition(localPlayer) local tx, ty, tz = getElementPosition(guard) local dis = getDistanceBetweenPoints2D (x, y, tx, ty) setPedRotation(guard, findRotation(tx, ty, x, y)) if (dis > 2) then setPedControlState(guard, 'forwards', true) else setPedControlState(guard, 'forwards', false) end if (dis > 4) then setPedControlState(guard, 'sprint', true) else setPedControlState(guard, 'sprint', false) end end end end addEventHandler('onClientPreRender', root, followPlayer) 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 function cancelPedDamage ( attacker ) local guardsrecieved = triggerServerEvent("returnTable", attacker) if (guardsrecieved[attacker][1] == source) then cancelEvent() -- cancel any damage done to peds end end addEventHandler ( "onClientPedDamage", getRootElement(), cancelPedDamage ) SO Could you edit this one? ! ! Also there's 2 tables one in server, one in client one in server to defined peds for owners, but in the client that you made idk why, so the script will work with 2 tables? and the both gives sense or what?
-
ِAlright well so if you have an idea about "if the owner hit his guard, the guard will not die or lose hp" have any idea? please i need help + This you've edited Dosen't work when i do /weapon it even don't give weapon
-
Well i have 2 Problems in the script: 1- When i /weapon to give weapon to 2 guards only one of them take the weapon and i want the weapon be gaven to the 2 guards when i type /weapon /weapon 2 times, guards = {} function followPed (thePlayer) local x, y, z = getElementPosition(thePlayer) guard = createPed (240, x + 2, y, z + 1) triggerClientEvent(thePlayer, 'moveGuard', guard) guards[thePlayer] = guard end addCommandHandler ("guard", followPed) function giveGun (source) if not isElement(guards[source]) then outputChatBox ("You have no Guard") else giveWeapon (guards[source], 30, 200, true) end end addCommandHandler ("weapon", giveGun) function returnTable() return guards end addEvent("returnTable", true) addEventHandler("returnTable", getRootElement(), returnTable) 2- The second problem is in function returnTable, because it made to make the owner of the ped are not able to hurt his ped. Client: function cancelPedDamage ( attacker ) local guardsrecieved = triggerServerEvent("returnTable", attacker) if (guardsrecieved[attacker][1] == source) then cancelEvent() -- cancel any damage done to peds end end addEventHandler ( "onClientPedDamage", getRootElement(), cancelPedDamage ) Alright now the Error: When i hit my ped i get this Error: attempt to index local 'guardsrecieved' ( a boolean value) And THANKS A LOT ! !
-
So? Any ANswer Please :/!
-
Actually i have tried it before, but i got some problems like the peds hits their owner so i have to put the player and the guard in one team.....so everyplayer have a team?! ?! It's Impossbile it will make the server "Really bad".
-
I'm sorry but still don't understand it's like this?: I've made this for example and want to know something: function follow (thePlayer) local x, y, z = getElementPosition(thePlayer) local guard = createPed (240, x + 2, y, z + 1) triggerClientEvent(thePlayer, 'moveGuard', guard) setElementData (thePlayer,"guard", guard) end addCommandHandler ("guard", follow) function Example () if not getElementData (source, "guard", guard) then outputChatBox ("You have no Guard") else giveWeapon (guard, 30, 200) end addCommandHandler ("ArmGuard", Example so the gun will be added to all guards with the players and i need every guard with people that have own things, not all guards have the same things when player write /ArmGuard ...please can you help me with that?
-
Alright can you tell me how to defined a owner for the guard? like when i do /guard the guard be mine so i can edit things for him.
-
Aha Worked man but it's possible to make them hit zombies near them by weapons or hands? and protect you if someone just shot you? please help me with that ! ! ! and makes them jump if they're stucked and run fast if they're away from you .. I'm sorry for this long things but i'm really need help with them and , THANKS A Lot man So man ?
-
Aha Worked man but it's possible to make them hit zombies near them by weapons or hands? and protect you if someone just shot you? please help me with that ! ! ! and makes them jump if they're stucked and run fast if they're away from you .. I'm sorry for this long things but i'm really need help with them and , THANKS A Lot man
-
Error: Client: Line 5 addEventHandler 'onClientPreRender' with this function is already handled This Problem happen when i spawn more than one guard, and only one guard follows me.
-
Error: Client: Line 5 addEventHandler 'onClientPreRender' with this function is already handled
-
Actually worked Nice! You're Good! Thanks, but there's problem here, when i enter Interior or i be already in interior and do /guard the ped dissapear , could you help me with that please?