Exemplo n.º 1
0
        public void Tick()
        {
            EsMessage msg;

            while (_msgs.TryTake(out msg))
            {
                if (msg.Count == 0)
                {
                    continue;
                }
                try {
                    if (msg[0].ValueType == JSC.JSValueType.String)
                    {
                        var key = msg[0].Value as string;
                        var a   = new JSC.JSValue[msg.Count - 1];
                        for (int i = 1; i < msg.Count; i++)
                        {
                            a[i - 1] = msg[i];
                        }
                        RPC.Call(key, a);
                    }
                }
                catch (Exception ex) {
                    if (verbose)
                    {
                        Log.Warning("{0} - {1}", msg, ex);
                    }
                }
            }
        }
Exemplo n.º 2
0
 public static void Give_All_Weapons_Custom(int PedID)
 {
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.KNIFE, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.NIGHTSTICK, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.HAMMER, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.BAT, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.GOLFCLUB, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.CROWBAR, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.PISTOL, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.COMBATPISTOL, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.APPISTOL, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.PISTOL50, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.MICROSMG, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.SMG, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.ASSAULTSMG, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.ASSAULTRIFLE, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.CARBINERIFLE, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.ADVANCEDRIFLE, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.MG, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.COMBATMG, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.PUMPSHOTGUN, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.SAWNOFFSHOTGUN, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.ASSAULTSHOTGUN, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.BULLPUPSHOTGUN, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.STUNGUN, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.SNIPERRIFLE, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.HEAVYSNIPER, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.GRENADELAUNCHER, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.RPG, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.MINIGUN, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.GRENADE, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.STICKYBOMB, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.SMOKEGRENADE, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.BZGAS, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.MOLOTOV, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.FIREEXTINGUISHER, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.PETROLCAN, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.BALL, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.FLARE, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.BOTTLE, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.GUSENBERG, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.SPECIALCARBINE, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.HEAVYPISTOL, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.SNSPISTOL, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.BULLPUPRIFLE, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.DAGGER, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.VINTAGEPISTOL, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.FIREWORK, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.MUSKET, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.HEAVYSHOTGUN, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.MARKSMANRIFLE, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.HOMINGLAUNCHER, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.PROXMINE, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.SNOWBALL, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.FLAREGUN, 9999, 0, 1);
     RPC.Call(Addresses.Natives.give_weapon_to_ped, PedID, Addresses.Hashes.Weapons.COMBATPDW, 9999, 0, 1);
 }
Exemplo n.º 3
0
 public static float[] get_entity_coords(int Entity)
 {
     float[] numArray = new float[3];
     RPC.Call(Addresses.Natives.get_entity_coords, Addresses.Other.entityXCoord, Entity);
     numArray[0] = PS3.Extension.ReadFloat(Addresses.Other.entityXCoord);
     numArray[1] = PS3.Extension.ReadFloat(Addresses.Other.entityYCoord);
     numArray[2] = PS3.Extension.ReadFloat(Addresses.Other.entityZCoord);
     return(numArray);
 }
Exemplo n.º 4
0
 public static void set_seethrough(bool enable)
 {
     if (enable)
     {
         RPC.Call(Addresses.Natives.set_seethrough, 1);
     }
     else
     {
         RPC.Call(Addresses.Natives.set_seethrough, 0);
     }
 }
Exemplo n.º 5
0
 public static void set_nightvision(bool Vision)
 {
     if (Vision)
     {
         RPC.Call(Addresses.Natives.set_nightvision, 1);
     }
     else
     {
         RPC.Call(Addresses.Natives.set_nightvision, 0);
     }
 }
Exemplo n.º 6
0
 public static void set_entity_visible(int Entity, bool Visible)
 {
     if (Visible)
     {
         RPC.Call(Addresses.Natives.set_entity_visible, Entity, 1);
     }
     else
     {
         RPC.Call(Addresses.Natives.set_entity_visible, Entity, 0);
     }
 }
Exemplo n.º 7
0
        public static void WrapAction <T>(uint id, RPC <T> rpc, T value)
        {
            rpc.SetCallback(delegate(byte[] arr)
            {
                var mem             = new MemoryStream(arr);
                BinaryReader reader = new BinaryReader(mem);
                var rpcid           = reader.ReadInt32();

                rpc.Read(id, reader);
            });
            rpc.Call(value);
        }
Exemplo n.º 8
0
 public static int get_player_name(int PedID)
 {
     return(RPC.Call(Addresses.Natives.get_player_name, PedID));
 }
Exemplo n.º 9
0
 public static void freeze_entity_position(int entity, int status)
 {
     RPC.Call(Addresses.Natives.freeze_entity_position, entity, status);
 }
Exemplo n.º 10
0
 public static void stat_set_string(uint statHash, string value)
 {
     RPC.Call(Addresses.Natives.stat_set_string, statHash, value, 1);
 }
Exemplo n.º 11
0
 public static void create_object(uint hash, float[] coords)
 {
     RPC.Call(Addresses.Natives.create_object, hash, coords, 1, 1, 0);
 }
Exemplo n.º 12
0
 public static void create_ambient_pickup(int pickupHash, float[] coords, int Amount)
 {
     RPC.Call(Addresses.Natives.create_ambient_pickup, pickupHash, coords, 0, Amount, 1, 0, 1);
 }
Exemplo n.º 13
0
 public static void set_vehicle_strong(int VehID, int status)
 {
     RPC.Call(Addresses.Natives.set_vehicle_strong, VehID, status);
 }
Exemplo n.º 14
0
 public static void set_vehicle_reduce_grip(int VehID, int status)
 {
     RPC.Call(Addresses.Natives.set_vehicle_reduce_grip, VehID, status);
 }
Exemplo n.º 15
0
 public static void set_vehicle_number_plate_text(int VehID, string text)
 {
     RPC.Call(Addresses.Natives.set_vehicle_number_plate_text, VehID, text);
 }
Exemplo n.º 16
0
 public static int stat_get_bool(uint statHash)
 {
     return(RPC.Call(Addresses.Natives.stat_get_bool, statHash, 1, 1));
 }
Exemplo n.º 17
0
 public static int stat_get_int(uint statHash)
 {
     return(RPC.Call(Addresses.Natives.stat_get_int, 1, -1));
 }
Exemplo n.º 18
0
 public static void set_vehicle_undriveable(int VehID, int status)
 {
     RPC.Call(Addresses.Natives.set_vehicle_undriveable, VehID, status);
 }
Exemplo n.º 19
0
 public static void stat_set_int(uint statHash, int value)
 {
     RPC.Call(Addresses.Natives.stat_set_int, statHash, value, 1);
 }
Exemplo n.º 20
0
 public static void set_vehicle_wheel_type(int VehID, int type)
 {
     RPC.Call(Addresses.Natives.set_vehicle_wheel_type, VehID, type);
 }
Exemplo n.º 21
0
 public static void do_screen_fade_out(int time)
 {
     RPC.Call(Addresses.Natives.do_screen_fade_out, time);
 }
Exemplo n.º 22
0
 public static void set_vehicle_window_tint(int VehID, int value)
 {
     RPC.Call(Addresses.Natives.set_vehicle_window_tint, VehID, value);
 }
Exemplo n.º 23
0
 public static int get_closest_vehicle(float[] coords, float radius)
 {
     return(RPC.Call(Addresses.Natives.get_closest_vehicle, coords, radius, 0, 0));
 }
Exemplo n.º 24
0
 public static void set_weather_type_now(string type)
 {
     RPC.Call(Addresses.Natives.set_weather_type_now, type);
 }
Exemplo n.º 25
0
 public static int get_entity_max_health(int entity)
 {
     return(RPC.Call(Addresses.Natives.get_entity_max_health, entity));
 }
Exemplo n.º 26
0
 public static void shake_gameplay_cam(string type, float amount)
 {
     RPC.Call(Addresses.Natives.shake_gameplay_cam, type, amount);
 }
Exemplo n.º 27
0
 public static int G_LocalizedStringIndex(string Text)
 {
     return(RPC.Call(Offsets.G_LocalizedStringIndex, new object[] { Text }));
 }
Exemplo n.º 28
0
 public static void skip_radio_forward()
 {
     RPC.Call(Addresses.Natives.skip_radio_forward);
 }
Exemplo n.º 29
0
 public void Cbuf_AddText(int localClient, string command)
 {
     RPC.Call(0x395ba8, new object[] { localClient, command });
 }
Exemplo n.º 30
0
 public static void start_entity_fire(int entity)
 {
     RPC.Call(Addresses.Natives.start_entity_fire, entity);
 }