Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function spawnHandler ()
- giveWeapon(source, 22, 1)
- giveWeapon(source, 4, 1)
- end
- addEventHandler("onPlayerSpawn", getRootElement(), spawnHandler)
- function deadHandler (ammo, attacker, weapon, bodypart)
- if (attacker == false) then
- return
- else
- outputChatBox(tostring(getPlayerName(attacker)).." killed "..tostring(getPlayerName(source)).."!")
- end
- end
- addEventHandler ("onPlayerWasted", getRootElement(), deadHandler)
- validValues =
- {
- [4] = true,
- [22] = true
- }
- function oneHit (attacker, weapon)
- if ( attacker == source ) then
- return
- else
- if validValues[weapon] then
- if (weapon == 4) then
- killPed (source)
- outputChatBox("Attacker: "..tostring(attacker))
- outputChatBox("Weapon Attacker: "..tostring(weapon))
- elseif (weapon == 22) then
- killPed (source)
- outputChatBox("Attacker: "..tostring(attacker))
- outputChatBox("Weapon Attacker: "..tostring(weapon))
- end
- end
- end
- end
- addEventHandler ( "onPlayerDamage", getRootElement(), oneHit)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement