Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------------------------------------------- SERVER SIDE -------------------------------------------------
- addEvent("onAimHandler",true)
- function onAim()
- local name = getPlayerName(source)
- outputChatBox(name.." got 1 star for aiming at the staff ped!",root,255,0,0)
- outputChatBox("You got wanted for aiming at the staff ped!",source,255,0,0)
- local wantedLevel = getPlayerWantedLevel(source)
- setPlayerWantedLevel(source,wantedLevel+1 or 1)
- end
- addEventHandler("onAimHandler,resourceRoot,onAim)
- ------------------------------------------------- CLIENT SIDE -------------------------------------------------
- local ped = createPed(217,0,0,3)
- function onClientJoin()
- bindKey(source,"aim_weapon","down",onPlayerAim)
- end
- addEventHandler("onClientPlayerJoin",root,onClientJoin)
- function onPlayerAim()
- local target = getPedTarget(localPlayer)
- if target and isElement(target) and getElementType(target) == "ped" and target == ped then
- triggerServerEvent("onAimHandler",localPlayer)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement