Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using GTA;
- using GTA.Native;
- using System;
- using System.Collections.Generic;
- using System.Windows.Forms;
- public class ScriptTest : Script
- {
- public ScriptTest()
- {
- Tick += OnTick;
- KeyDown += OnKeyDown;
- KeyUp += OnKeyUp;
- }
- List<WeaponHash> Guns = new List<WeaponHash> {WeaponHash.Pistol,WeaponHash.PumpShotgun };
- void OnTick(object sender, EventArgs e)
- {
- Ped Player = Game.Player.Character;
- WeaponHash Weapon = WeaponHash.Unarmed;
- foreach (WeaponHash gun in Guns)
- {
- if (Function.Call<bool>(Hash.HAS_PED_BEEN_DAMAGED_BY_WEAPON, Player, (int)gun))
- {
- Weapon = gun;
- break;
- }
- }
- DisplayHelpTextThisFrame("Player last damaged by "+ Weapon.ToString());
- }
- void OnKeyDown(object sender, KeyEventArgs e)
- {
- }
- void OnKeyUp(object sender, KeyEventArgs e)
- {
- }
- public static void DisplayHelpTextThisFrame(string text)
- {
- Function.Call(Hash._SET_TEXT_COMPONENT_FORMAT, "STRING");
- Function.Call(Hash._ADD_TEXT_COMPONENT_STRING, text);
- Function.Call(Hash._DISPLAY_HELP_TEXT_FROM_STRING_LABEL, 0, false, true, -1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement