Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System ' basic imports
- Imports GTA ' basic imports
- Imports System.Windows.Forms ' needed to have access to "keys" enumeration, for example
- Imports System.Drawing ' needed to handle colors referencing the color name, ex: myCar.color = System.Drawing.Color.Black
- Public Class BasicScript
- Inherits Script
- private myGroup1 as group
- private myGroup2 as group
- private myGroup3 as group
- private pL as ped() = nothing
- private vL as vehicle() = nothing
- private checkTime as int16 = 0
- Public Sub New()
- Me.interval = 10
- myGroup1 = new group(player.character)
- myGroup2 = new group(player.character)
- myGroup3 = new group(player.character)
- End Sub
- private sub msg(sMsg as string, time as int32)
- Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", sMsg, time, 1)
- end sub
- Private Sub keyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown
- if (e.key = keys.d1) orelse (e.key = keys.d2) orelse (e.key = keys.d3) then
- for each p as ped in world.getpeds(player.character.position, 10.0)
- if exists(p) andalso (p <> player.character) andalso not p.metadata.isInGroup then
- p.task.clearall
- p.metadata.isInGroup = true
- p.BecomeMissionCharacter
- p.ChangeRelationship(RelationshipGroup.Player, Relationship.respect)
- p.LeaveGroup
- p.weapons.removeall
- if (e.key = keys.d1) then
- p.RelationshipGroup = RelationshipGroup.NetworkTeam_1
- p.ChangeRelationship(RelationshipGroup.NetworkTeam_2, Relationship.like)
- p.AttachBlip.color = BlipColor.LightYellow
- p.weapons.uzi.ammo = 1000
- myGroup1.AddMember(p, true)
- elseif (e.key = keys.d2) then
- p.RelationshipGroup = RelationshipGroup.NetworkTeam_2
- p.ChangeRelationship(RelationshipGroup.NetworkTeam_1, Relationship.like)
- p.AttachBlip.color = BlipColor.red
- p.weapons.uzi.ammo = 1000
- myGroup2.AddMember(p, true)
- else
- p.RelationshipGroup = RelationshipGroup.NetworkTeam_3
- p.AttachBlip.color = BlipColor.white
- p.preventragdoll = true
- p.weapons.MP5.ammo = 1000
- p.health = 1000
- p.armor = 1000
- myGroup3.AddMember(p, true)
- end if
- end if
- next
- end if
- if e.key = keys.d0 then
- for each p as ped in myGroup1
- if exists(p) then p.ChangeRelationship(RelationshipGroup.NetworkTeam_2, Relationship.Hate)
- next
- for each p as ped in myGroup2
- if exists(p) then p.ChangeRelationship(RelationshipGroup.NetworkTeam_1, Relationship.Hate)
- next
- end if
- End Sub
- Private Sub keyUp(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyUp
- end sub
- Private Sub general_tick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick
- checkTime += me.interval
- if (checkTime mod 1000 = 0) then
- pL = world.getpeds(player.character.position, 50.0)
- vL = world.getvehicles(player.character.position, 50.0)
- end if
- for each p as ped in myGroup3
- if exists(p) andalso (p.isshooting) andalso (p.position.distanceto(player.character.position) <= 15) then
- for each p2 as ped in pL
- if exists(p2) andalso not myGroup3.ismember(p2) andalso native.function.call(of boolean)("HAS_CHAR_BEEN_DAMAGED_BY_CHAR", p2, p) then
- p2.isragdoll = true
- p2.velocity = (p2.position - p.position) * 0.5
- native.function.call("CLEAR_CHAR_LAST_DAMAGE_ENTITY", p2)
- end if
- next
- for each v as vehicle in vL
- if exists(v) andalso native.function.call(of boolean)("HAS_CAR_BEEN_DAMAGED_BY_CHAR", v, p) then
- v.applyforce((v.position - p.position) * 0.1, vector3.worldup * 3)
- native.function.call("CLEAR_CAR_LAST_DAMAGE_ENTITY", v)
- end if
- next
- end if
- next
- if checkTime > 2000 then checkTime = 0
- end sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement