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); } } } }
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); }
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); }
public static void set_seethrough(bool enable) { if (enable) { RPC.Call(Addresses.Natives.set_seethrough, 1); } else { RPC.Call(Addresses.Natives.set_seethrough, 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); } }
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); } }
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); }
public static int get_player_name(int PedID) { return(RPC.Call(Addresses.Natives.get_player_name, PedID)); }
public static void freeze_entity_position(int entity, int status) { RPC.Call(Addresses.Natives.freeze_entity_position, entity, status); }
public static void stat_set_string(uint statHash, string value) { RPC.Call(Addresses.Natives.stat_set_string, statHash, value, 1); }
public static void create_object(uint hash, float[] coords) { RPC.Call(Addresses.Natives.create_object, hash, coords, 1, 1, 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); }
public static void set_vehicle_strong(int VehID, int status) { RPC.Call(Addresses.Natives.set_vehicle_strong, VehID, status); }
public static void set_vehicle_reduce_grip(int VehID, int status) { RPC.Call(Addresses.Natives.set_vehicle_reduce_grip, VehID, status); }
public static void set_vehicle_number_plate_text(int VehID, string text) { RPC.Call(Addresses.Natives.set_vehicle_number_plate_text, VehID, text); }
public static int stat_get_bool(uint statHash) { return(RPC.Call(Addresses.Natives.stat_get_bool, statHash, 1, 1)); }
public static int stat_get_int(uint statHash) { return(RPC.Call(Addresses.Natives.stat_get_int, 1, -1)); }
public static void set_vehicle_undriveable(int VehID, int status) { RPC.Call(Addresses.Natives.set_vehicle_undriveable, VehID, status); }
public static void stat_set_int(uint statHash, int value) { RPC.Call(Addresses.Natives.stat_set_int, statHash, value, 1); }
public static void set_vehicle_wheel_type(int VehID, int type) { RPC.Call(Addresses.Natives.set_vehicle_wheel_type, VehID, type); }
public static void do_screen_fade_out(int time) { RPC.Call(Addresses.Natives.do_screen_fade_out, time); }
public static void set_vehicle_window_tint(int VehID, int value) { RPC.Call(Addresses.Natives.set_vehicle_window_tint, VehID, value); }
public static int get_closest_vehicle(float[] coords, float radius) { return(RPC.Call(Addresses.Natives.get_closest_vehicle, coords, radius, 0, 0)); }
public static void set_weather_type_now(string type) { RPC.Call(Addresses.Natives.set_weather_type_now, type); }
public static int get_entity_max_health(int entity) { return(RPC.Call(Addresses.Natives.get_entity_max_health, entity)); }
public static void shake_gameplay_cam(string type, float amount) { RPC.Call(Addresses.Natives.shake_gameplay_cam, type, amount); }
public static int G_LocalizedStringIndex(string Text) { return(RPC.Call(Offsets.G_LocalizedStringIndex, new object[] { Text })); }
public static void skip_radio_forward() { RPC.Call(Addresses.Natives.skip_radio_forward); }
public void Cbuf_AddText(int localClient, string command) { RPC.Call(0x395ba8, new object[] { localClient, command }); }
public static void start_entity_fire(int entity) { RPC.Call(Addresses.Natives.start_entity_fire, entity); }