Jump to content

Chrimam

Members
  • Posts

    17
  • Joined

  • Last visited

About Chrimam

  • Birthday 04/05/1995

Details

  • Location
    Europe

Chrimam's Achievements

Square

Square (6/54)

0

Reputation

  1. Thanks I will test it asap. If some errors occur and i can't fix, i will be here waiting for your help
  2. if not isElement ( tMark ) then tMark = createBlipAttachedTo( tPlayer, 0, 2, 255, 255, 255, 255, 0, 99999.0, g_Local) These lines would be useless if i want to follow more than 1 player. Thanks for the corrections tho
  3. This is what I'm trying to do actually. Hope you understand and help -- partial name function start by TAPL function getPlayerFromNamePart(name) if name then for i, player in ipairs(getElementsByType("player")) do if string.find(getPlayerName(player):lower(), tostring(name):lower(), 1, true) then return player end end end return false end -- partial name function end by TAPL g_Local = getLocalPlayer() function followTarget(g_Local, cmd, target) tPlayer = getPlayerFromNamePart(target) if not target then outputChatBox("You have to type a player name.") end if target == g_Local then outputChatBox("You can't follow yourself.") else tMark = createBlipAttachedTo( tPlayer, 0, 2, 255, 255, 255, 255, 0, 99999.0, g_Local) -- if it's not attached already. otherwise, don't attach. end end function unfollowTarget(g_Local, cmd, target) -- unfollowing thing here by checking if the target is followed already. end addCommandHandler("follow", followTarget) addCommandHandler("unfollow", unfollowTarget)
  4. Can i use isElementAttached with createBlipAttachedTo? Let's say I want to make make a blip on a player by typing /blip player. if it already has a blip, it will destroy it. will isElementAttached work here? if not, how can i detect if a blip attached to someone?
  5. Chrimam

    ejector seat

    There is no error in debugscript. It doesn't give parachute, it doesn't take me to the pZ + 10. and i think it doesn't detach the seat either because i can't get in my car again.
  6. Chrimam

    ejector seat

    Nope it's not working.
  7. Chrimam

    ejector seat

    Hi. This is my script and what i am trying to do is, when you type /e in a vehicle, it will eject you through air and will make you land safely via a parachute. but i think i need to use setTimer thing because everything happens so fast that i can't even move through air and as soon as my seat is created, it is destroyed. hope you understand and help. function carEject(source) ocVeh = getPedOccupiedVehicle(source) if (ocVeh) then vehSeatNo = getPedOccupiedVehicleSeat(source) if vehSeatNo == 0 then removePedFromVehicle(source, ocVeh) pX, pY, pZ = getElementPosition(source) rX, rY, rZ = getElementRotation(source) ejectorSeat = createObject(1562, pX, pY, pZ, rX, rY, rZ) setElementAlpha(ejectorSeat, 0) -- make the seat invis. setElementCollisionsEnabled(ejectorSeat, false) -- make the seat untouchable so as to avoid crashes attachElements(source, ejectorSeat, 0, 0, 0, 0, 0, 0) giveWeapon(source, 46) moveObject(ejectorSeat, 5000, pX, pY, pZ + 10) -- fly through air detachElements(source, ejectorSeat) -- when we reach our destination (pZ +10) it should detachElement destroyElement(ejectorSeat) -- after detaching is done, it should destroy it end end end addCommandHandler("e", carEject)
  8. I saw it in the resources. It's command appears to be /startmusic but when i type that, it says "stream not loaded yet".
  9. Thanks Castro it worked Edit: TAPL your script's working too.
  10. That's why i put a timer there. It spawns me immediately after i die. I can't understand if died. I want to be spawned after 1 second or so.
  11. It keeps saying bad argument @ spawnPlayer I tried function getCoords(source) but it says bad argument @getElementPosition expected element at argument 1, got number '0' (Yes. I also tried spawnCoords(source, wastedX, wastedY, wastedZ, wastedSkin) function getCoords() wastedX, wastedY, wastedZ = getElementPosition(source) wastedSkin = getElementModel(source) setTimer(spawnCoords, 1000, 1) end addEventHandler ( "onPlayerWasted", getRootElement(), getCoords ) function spawnCoords(wastedX, wastedY, wastedZ, wastedSkin) spawnPlayer(source, wastedX, wastedY, wastedZ, 0, wastedSkin) end
  12. Thank you guys it worked P.S: I know it's client side. I don't want anybody to see my marker it will interrupt them. My project is a little bit different
  13. Uh it attaches marker to the weapon but i got a problem. whenever i look to an object (vehicles, peds or things added by scripts/maps), it creates a red marker on it (no it doesn't attach). and i don't want my marker to appear everytime i get desert eagle, i want it to appear when i aim. Hope you got the point (the red marker on my leg is the marker attached to the weapon)
  14. I don't get any errors but "badArgument @ destroyObject" which works fine for me. But anyways, I can't attach my marker to weapon (i mean set the marker's position everytime frame changes) function powerTeleport(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement) if weapon == 24 then playerX, playerY, playerZ = getElementPosition(getLocalPlayer()) rotX, rotY, rotZ = getElementRotation(getLocalPlayer()) teleportObject = createObject(1337, playerX, playerY, playerZ) setElementCollisionsEnabled(teleportObject, false) setElementAlpha(teleportObject, 0) attachElements(getLocalPlayer(), teleportObject, 0, 0, 0, 0, 0, 0) moveObject( teleportObject, 1000, hitX, hitY, hitZ, rotX, rotY, rotZ ) setTimer(destroyTeleportObject, 1100, 1) end end addEventHandler("onClientPlayerWeaponFire", getLocalPlayer(), powerTeleport) function destroyTeleportObject(teleportObject) detachElements(getLocalPlayer(), teleportObject) destroyElement(teleportObject) end function powerTeleportMarker(weapon, playerX, playerY, playerZ) if weapon == 24 then muzX, muzY, muzZ = getPedWeaponMuzzlePosition(getLocalPlayer()) teleportMarker = createMarker(0, 0, 10, "corona", 1, 255, 0, 0, 170) setElementPosition(teleportMarker, playerX, playerY, playerZ) addEventHandler("onClientPreRender", getRootElement(), function(teleportMarker, muzX, muzY, muzZ) setElementPosition(teleportMarker, muzX, muzY, muzZ) end) end end addEventHandler("onClientPlayerTarget", getRootElement(), powerTeleportMarker)
  15. I don't want the marker to be attached to target. I want to attach the target in front of the weapon's muzzle position. and i think it's impossible for now.
×
×
  • Create New...