Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2015
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ------------------------------------------------- SERVER SIDE -------------------------------------------------
  2. addEvent("onAimHandler",true)
  3. function onAim()
  4. local name = getPlayerName(source)
  5. outputChatBox(name.." got 1 star for aiming at the staff ped!",root,255,0,0)
  6. outputChatBox("You got wanted for aiming at the staff ped!",source,255,0,0)
  7. local wantedLevel = getPlayerWantedLevel(source)
  8. setPlayerWantedLevel(source,wantedLevel+1 or 1)
  9. end
  10. addEventHandler("onAimHandler,resourceRoot,onAim)
  11.  
  12. ------------------------------------------------- CLIENT SIDE -------------------------------------------------
  13.  
  14. local ped = createPed(217,0,0,3)
  15. function onClientJoin()
  16. bindKey(source,"aim_weapon","down",onPlayerAim)
  17. end
  18. addEventHandler("onClientPlayerJoin",root,onClientJoin)
  19.  
  20. function onPlayerAim()
  21. local target = getPedTarget(localPlayer)
  22. if target and isElement(target) and getElementType(target) == "ped" and target == ped then
  23. triggerServerEvent("onAimHandler",localPlayer)
  24. end
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement