mirror of
https://github.com/ChronosX88/mta-mono.git
synced 2024-12-22 08:51:48 +00:00
Submodule removed
This commit is contained in:
parent
915be1c34c
commit
5e8456f986
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,3 +0,0 @@
|
||||
[submodule "MultiTheftAuto"]
|
||||
path = MultiTheftAuto
|
||||
url = git@bitbucket.org:mtaroleplay/multitheftauto.git
|
@ -1 +0,0 @@
|
||||
Subproject commit fe32901717e73b39b133449512e9ca7230ef37c4
|
16
MultiTheftAuto/Account.cs
Normal file
16
MultiTheftAuto/Account.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace MultiTheftAuto
|
||||
{
|
||||
public class Account : Element
|
||||
{
|
||||
public Account( UInt32 userdata )
|
||||
: base( userdata )
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
16
MultiTheftAuto/Ban.cs
Normal file
16
MultiTheftAuto/Ban.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto
|
||||
{
|
||||
public class Ban : Element
|
||||
{
|
||||
public Ban( UInt32 userdata )
|
||||
: base( userdata )
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
411
MultiTheftAuto/Blowfish.cs
Normal file
411
MultiTheftAuto/Blowfish.cs
Normal file
@ -0,0 +1,411 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto
|
||||
{
|
||||
public class Blowfish
|
||||
{
|
||||
private static ulong[] P =
|
||||
{
|
||||
0x243F6A88,0x85A308D3,0x13198A2E,0x03707344,0xA4093822,0x299F31D0,0x082EFA98,0xEC4E6C89,0x452821E6,
|
||||
0x38D01377,0xBE5466CF,0x34E90C6C,0xC0AC29B7,0xC97C50DD,0x3F84D5B5,0xB5470917,0x9216D5D9,0x8979FB1B
|
||||
};
|
||||
|
||||
private static ulong[][] S =
|
||||
{
|
||||
new ulong[]
|
||||
{
|
||||
0xD1310BA6,0x98DFB5AC,0x2FFD72DB,0xD01ADFB7,0xB8E1AFED,0x6A267E96,0xBA7C9045,0xF12C7F99,0x24A19947,
|
||||
0xB3916CF7,0x0801F2E2,0x858EFC16,0x636920D8,0x71574E69,0xA458FEA3,0xF4933D7E,0x0D95748F,0x728EB658,
|
||||
0x718BCD58,0x82154AEE,0x7B54A41D,0xC25A59B5,0x9C30D539,0x2AF26013,0xC5D1B023,0x286085F0,0xCA417918,
|
||||
0xB8DB38EF,0x8E79DCB0,0x603A180E,0x6C9E0E8B,0xB01E8A3E,0xD71577C1,0xBD314B27,0x78AF2FDA,0x55605C60,
|
||||
0xE65525F3,0xAA55AB94,0x57489862,0x63E81440,0x55CA396A,0x2AAB10B6,0xB4CC5C34,0x1141E8CE,0xA15486AF,
|
||||
0x7C72E993,0xB3EE1411,0x636FBC2A,0x2BA9C55D,0x741831F6,0xCE5C3E16,0x9B87931E,0xAFD6BA33,0x6C24CF5C,
|
||||
0x7A325381,0x28958677,0x3B8F4898,0x6B4BB9AF,0xC4BFE81B,0x66282193,0x61D809CC,0xFB21A991,0x487CAC60,
|
||||
0x5DEC8032,0xEF845D5D,0xE98575B1,0xDC262302,0xEB651B88,0x23893E81,0xD396ACC5,0x0F6D6FF3,0x83F44239,
|
||||
0x2E0B4482,0xA4842004,0x69C8F04A,0x9E1F9B5E,0x21C66842,0xF6E96C9A,0x670C9C61,0xABD388F0,0x6A51A0D2,
|
||||
0xD8542F68,0x960FA728,0xAB5133A3,0x6EEF0B6C,0x137A3BE4,0xBA3BF050,0x7EFB2A98,0xA1F1651D,0x39AF0176,
|
||||
0x66CA593E,0x82430E88,0x8CEE8619,0x456F9FB4,0x7D84A5C3,0x3B8B5EBE,0xE06F75D8,0x85C12073,0x401A449F,
|
||||
0x56C16AA6,0x4ED3AA62,0x363F7706,0x1BFEDF72,0x429B023D,0x37D0D724,0xD00A1248,0xDB0FEAD3,0x49F1C09B,
|
||||
0x075372C9,0x80991B7B,0x25D479D8,0xF6E8DEF7,0xE3FE501A,0xB6794C3B,0x976CE0BD,0x04C006BA,0xC1A94FB6,
|
||||
0x409F60C4,0x5E5C9EC2,0x196A2463,0x68FB6FAF,0x3E6C53B5,0x1339B2EB,0x3B52EC6F,0x6DFC511F,0x9B30952C,
|
||||
0xCC814544,0xAF5EBD09,0xBEE3D004,0xDE334AFD,0x660F2807,0x192E4BB3,0xC0CBA857,0x45C8740F,0xD20B5F39,
|
||||
0xB9D3FBDB,0x5579C0BD,0x1A60320A,0xD6A100C6,0x402C7279,0x679F25FE,0xFB1FA3CC,0x8EA5E9F8,0xDB3222F8,
|
||||
0x3C7516DF,0xFD616B15,0x2F501EC8,0xAD0552AB,0x323DB5FA,0xFD238760,0x53317B48,0x3E00DF82,0x9E5C57BB,
|
||||
0xCA6F8CA0,0x1A87562E,0xDF1769DB,0xD542A8F6,0x287EFFC3,0xAC6732C6,0x8C4F5573,0x695B27B0,0xBBCA58C8,
|
||||
0xE1FFA35D,0xB8F011A0,0x10FA3D98,0xFD2183B8,0x4AFCB56C,0x2DD1D35B,0x9A53E479,0xB6F84565,0xD28E49BC,
|
||||
0x4BFB9790,0xE1DDF2DA,0xA4CB7E33,0x62FB1341,0xCEE4C6E8,0xEF20CADA,0x36774C01,0xD07E9EFE,0x2BF11FB4,
|
||||
0x95DBDA4D,0xAE909198,0xEAAD8E71,0x6B93D5A0,0xD08ED1D0,0xAFC725E0,0x8E3C5B2F,0x8E7594B7,0x8FF6E2FB,
|
||||
0xF2122B64,0x8888B812,0x900DF01C,0x4FAD5EA0,0x688FC31C,0xD1CFF191,0xB3A8C1AD,0x2F2F2218,0xBE0E1777,
|
||||
0xEA752DFE,0x8B021FA1,0xE5A0CC0F,0xB56F74E8,0x18ACF3D6,0xCE89E299,0xB4A84FE0,0xFD13E0B7,0x7CC43B81,
|
||||
0xD2ADA8D9,0x165FA266,0x80957705,0x93CC7314,0x211A1477,0xE6AD2065,0x77B5FA86,0xC75442F5,0xFB9D35CF,
|
||||
0xEBCDAF0C,0x7B3E89A0,0xD6411BD3,0xAE1E7E49,0x00250E2D,0x2071B35E,0x226800BB,0x57B8E0AF,0x2464369B,
|
||||
0xF009B91E,0x5563911D,0x59DFA6AA,0x78C14389,0xD95A537F,0x207D5BA2,0x02E5B9C5,0x83260376,0x6295CFA9,
|
||||
0x11C81968,0x4E734A41,0xB3472DCA,0x7B14A94A,0x1B510052,0x9A532915,0xD60F573F,0xBC9BC6E4,0x2B60A476,
|
||||
0x81E67400,0x08BA6FB5,0x571BE91F,0xF296EC6B,0x2A0DD915,0xB6636521,0xE7B9F9B6,0xFF34052E,0xC5855664,
|
||||
0x53B02D5D,0xA99F8FA1,0x08BA4799,0x6E85076A
|
||||
},
|
||||
new ulong[]
|
||||
{
|
||||
0x4B7A70E9,0xB5B32944,0xDB75092E,0xC4192623,0xAD6EA6B0,0x49A7DF7D,0x9CEE60B8,0x8FEDB266,0xECAA8C71,
|
||||
0x699A17FF,0x5664526C,0xC2B19EE1,0x193602A5,0x75094C29,0xA0591340,0xE4183A3E,0x3F54989A,0x5B429D65,
|
||||
0x6B8FE4D6,0x99F73FD6,0xA1D29C07,0xEFE830F5,0x4D2D38E6,0xF0255DC1,0x4CDD2086,0x8470EB26,0x6382E9C6,
|
||||
0x021ECC5E,0x09686B3F,0x3EBAEFC9,0x3C971814,0x6B6A70A1,0x687F3584,0x52A0E286,0xB79C5305,0xAA500737,
|
||||
0x3E07841C,0x7FDEAE5C,0x8E7D44EC,0x5716F2B8,0xB03ADA37,0xF0500C0D,0xF01C1F04,0x0200B3FF,0xAE0CF51A,
|
||||
0x3CB574B2,0x25837A58,0xDC0921BD,0xD19113F9,0x7CA92FF6,0x94324773,0x22F54701,0x3AE5E581,0x37C2DADC,
|
||||
0xC8B57634,0x9AF3DDA7,0xA9446146,0x0FD0030E,0xECC8C73E,0xA4751E41,0xE238CD99,0x3BEA0E2F,0x3280BBA1,
|
||||
0x183EB331,0x4E548B38,0x4F6DB908,0x6F420D03,0xF60A04BF,0x2CB81290,0x24977C79,0x5679B072,0xBCAF89AF,
|
||||
0xDE9A771F,0xD9930810,0xB38BAE12,0xDCCF3F2E,0x5512721F,0x2E6B7124,0x501ADDE6,0x9F84CD87,0x7A584718,
|
||||
0x7408DA17,0xBC9F9ABC,0xE94B7D8C,0xEC7AEC3A,0xDB851DFA,0x63094366,0xC464C3D2,0xEF1C1847,0x3215D908,
|
||||
0xDD433B37,0x24C2BA16,0x12A14D43,0x2A65C451,0x50940002,0x133AE4DD,0x71DFF89E,0x10314E55,0x81AC77D6,
|
||||
0x5F11199B,0x043556F1,0xD7A3C76B,0x3C11183B,0x5924A509,0xF28FE6ED,0x97F1FBFA,0x9EBABF2C,0x1E153C6E,
|
||||
0x86E34570,0xEAE96FB1,0x860E5E0A,0x5A3E2AB3,0x771FE71C,0x4E3D06FA,0x2965DCB9,0x99E71D0F,0x803E89D6,
|
||||
0x5266C825,0x2E4CC978,0x9C10B36A,0xC6150EBA,0x94E2EA78,0xA5FC3C53,0x1E0A2DF4,0xF2F74EA7,0x361D2B3D,
|
||||
0x1939260F,0x19C27960,0x5223A708,0xF71312B6,0xEBADFE6E,0xEAC31F66,0xE3BC4595,0xA67BC883,0xB17F37D1,
|
||||
0x018CFF28,0xC332DDEF,0xBE6C5AA5,0x65582185,0x68AB9802,0xEECEA50F,0xDB2F953B,0x2AEF7DAD,0x5B6E2F84,
|
||||
0x1521B628,0x29076170,0xECDD4775,0x619F1510,0x13CCA830,0xEB61BD96,0x0334FE1E,0xAA0363CF,0xB5735C90,
|
||||
0x4C70A239,0xD59E9E0B,0xCBAADE14,0xEECC86BC,0x60622CA7,0x9CAB5CAB,0xB2F3846E,0x648B1EAF,0x19BDF0CA,
|
||||
0xA02369B9,0x655ABB50,0x40685A32,0x3C2AB4B3,0x319EE9D5,0xC021B8F7,0x9B540B19,0x875FA099,0x95F7997E,
|
||||
0x623D7DA8,0xF837889A,0x97E32D77,0x11ED935F,0x16681281,0x0E358829,0xC7E61FD6,0x96DEDFA1,0x7858BA99,
|
||||
0x57F584A5,0x1B227263,0x9B83C3FF,0x1AC24696,0xCDB30AEB,0x532E3054,0x8FD948E4,0x6DBC3128,0x58EBF2EF,
|
||||
0x34C6FFEA,0xFE28ED61,0xEE7C3C73,0x5D4A14D9,0xE864B7E3,0x42105D14,0x203E13E0,0x45EEE2B6,0xA3AAABEA,
|
||||
0xDB6C4F15,0xFACB4FD0,0xC742F442,0xEF6ABBB5,0x654F3B1D,0x41CD2105,0xD81E799E,0x86854DC7,0xE44B476A,
|
||||
0x3D816250,0xCF62A1F2,0x5B8D2646,0xFC8883A0,0xC1C7B6A3,0x7F1524C3,0x69CB7492,0x47848A0B,0x5692B285,
|
||||
0x095BBF00,0xAD19489D,0x1462B174,0x23820E00,0x58428D2A,0x0C55F5EA,0x1DADF43E,0x233F7061,0x3372F092,
|
||||
0x8D937E41,0xD65FECF1,0x6C223BDB,0x7CDE3759,0xCBEE7460,0x4085F2A7,0xCE77326E,0xA6078084,0x19F8509E,
|
||||
0xE8EFD855,0x61D99735,0xA969A7AA,0xC50C06C2,0x5A04ABFC,0x800BCADC,0x9E447A2E,0xC3453484,0xFDD56705,
|
||||
0x0E1E9EC9,0xDB73DBD3,0x105588CD,0x675FDA79,0xE3674340,0xC5C43465,0x713E38D8,0x3D28F89E,0xF16DFF20,
|
||||
0x153E21E7,0x8FB03D4A,0xE6E39F2B,0xDB83ADF7
|
||||
},
|
||||
new ulong[]
|
||||
{
|
||||
0xE93D5A68,0x948140F7,0xF64C261C,0x94692934,0x411520F7,0x7602D4F7,0xBCF46B2E,0xD4A20068,0xD4082471,
|
||||
0x3320F46A,0x43B7D4B7,0x500061AF,0x1E39F62E,0x97244546,0x14214F74,0xBF8B8840,0x4D95FC1D,0x96B591AF,
|
||||
0x70F4DDD3,0x66A02F45,0xBFBC09EC,0x03BD9785,0x7FAC6DD0,0x31CB8504,0x96EB27B3,0x55FD3941,0xDA2547E6,
|
||||
0xABCA0A9A,0x28507825,0x530429F4,0x0A2C86DA,0xE9B66DFB,0x68DC1462,0xD7486900,0x680EC0A4,0x27A18DEE,
|
||||
0x4F3FFEA2,0xE887AD8C,0xB58CE006,0x7AF4D6B6,0xAACE1E7C,0xD3375FEC,0xCE78A399,0x406B2A42,0x20FE9E35,
|
||||
0xD9F385B9,0xEE39D7AB,0x3B124E8B,0x1DC9FAF7,0x4B6D1856,0x26A36631,0xEAE397B2,0x3A6EFA74,0xDD5B4332,
|
||||
0x6841E7F7,0xCA7820FB,0xFB0AF54E,0xD8FEB397,0x454056AC,0xBA489527,0x55533A3A,0x20838D87,0xFE6BA9B7,
|
||||
0xD096954B,0x55A867BC,0xA1159A58,0xCCA92963,0x99E1DB33,0xA62A4A56,0x3F3125F9,0x5EF47E1C,0x9029317C,
|
||||
0xFDF8E802,0x04272F70,0x80BB155C,0x05282CE3,0x95C11548,0xE4C66D22,0x48C1133F,0xC70F86DC,0x07F9C9EE,
|
||||
0x41041F0F,0x404779A4,0x5D886E17,0x325F51EB,0xD59BC0D1,0xF2BCC18F,0x41113564,0x257B7834,0x602A9C60,
|
||||
0xDFF8E8A3,0x1F636C1B,0x0E12B4C2,0x02E1329E,0xAF664FD1,0xCAD18115,0x6B2395E0,0x333E92E1,0x3B240B62,
|
||||
0xEEBEB922,0x85B2A20E,0xE6BA0D99,0xDE720C8C,0x2DA2F728,0xD0127845,0x95B794FD,0x647D0862,0xE7CCF5F0,
|
||||
0x5449A36F,0x877D48FA,0xC39DFD27,0xF33E8D1E,0x0A476341,0x992EFF74,0x3A6F6EAB,0xF4F8FD37,0xA812DC60,
|
||||
0xA1EBDDF8,0x991BE14C,0xDB6E6B0D,0xC67B5510,0x6D672C37,0x2765D43B,0xDCD0E804,0xF1290DC7,0xCC00FFA3,
|
||||
0xB5390F92,0x690FED0B,0x667B9FFB,0xCEDB7D9C,0xA091CF0B,0xD9155EA3,0xBB132F88,0x515BAD24,0x7B9479BF,
|
||||
0x763BD6EB,0x37392EB3,0xCC115979,0x8026E297,0xF42E312D,0x6842ADA7,0xC66A2B3B,0x12754CCC,0x782EF11C,
|
||||
0x6A124237,0xB79251E7,0x06A1BBE6,0x4BFB6350,0x1A6B1018,0x11CAEDFA,0x3D25BDD8,0xE2E1C3C9,0x44421659,
|
||||
0x0A121386,0xD90CEC6E,0xD5ABEA2A,0x64AF674E,0xDA86A85F,0xBEBFE988,0x64E4C3FE,0x9DBC8057,0xF0F7C086,
|
||||
0x60787BF8,0x6003604D,0xD1FD8346,0xF6381FB0,0x7745AE04,0xD736FCCC,0x83426B33,0xF01EAB71,0xB0804187,
|
||||
0x3C005E5F,0x77A057BE,0xBDE8AE24,0x55464299,0xBF582E61,0x4E58F48F,0xF2DDFDA2,0xF474EF38,0x8789BDC2,
|
||||
0x5366F9C3,0xC8B38E74,0xB475F255,0x46FCD9B9,0x7AEB2661,0x8B1DDF84,0x846A0E79,0x915F95E2,0x466E598E,
|
||||
0x20B45770,0x8CD55591,0xC902DE4C,0xB90BACE1,0xBB8205D0,0x11A86248,0x7574A99E,0xB77F19B6,0xE0A9DC09,
|
||||
0x662D09A1,0xC4324633,0xE85A1F02,0x09F0BE8C,0x4A99A025,0x1D6EFE10,0x1AB93D1D,0x0BA5A4DF,0xA186F20F,
|
||||
0x2868F169,0xDCB7DA83,0x573906FE,0xA1E2CE9B,0x4FCD7F52,0x50115E01,0xA70683FA,0xA002B5C4,0x0DE6D027,
|
||||
0x9AF88C27,0x773F8641,0xC3604C06,0x61A806B5,0xF0177A28,0xC0F586E0,0x006058AA,0x30DC7D62,0x11E69ED7,
|
||||
0x2338EA63,0x53C2DD94,0xC2C21634,0xBBCBEE56,0x90BCB6DE,0xEBFC7DA1,0xCE591D76,0x6F05E409,0x4B7C0188,
|
||||
0x39720A3D,0x7C927C24,0x86E3725F,0x724D9DB9,0x1AC15BB4,0xD39EB8FC,0xED545578,0x08FCA5B5,0xD83D7CD3,
|
||||
0x4DAD0FC4,0x1E50EF5E,0xB161E6F8,0xA28514D9,0x6C51133C,0x6FD5C7E7,0x56E14EC4,0x362ABFCE,0xDDC6C837,
|
||||
0xD79A3234,0x92638212,0x670EFA8E,0x406000E0
|
||||
},
|
||||
new ulong[]
|
||||
{
|
||||
0x3A39CE37,0xD3FAF5CF,0xABC27737,0x5AC52D1B,0x5CB0679E,0x4FA33742,0xD3822740,0x99BC9BBE,0xD5118E9D,
|
||||
0xBF0F7315,0xD62D1C7E,0xC700C47B,0xB78C1B6B,0x21A19045,0xB26EB1BE,0x6A366EB4,0x5748AB2F,0xBC946E79,
|
||||
0xC6A376D2,0x6549C2C8,0x530FF8EE,0x468DDE7D,0xD5730A1D,0x4CD04DC6,0x2939BBDB,0xA9BA4650,0xAC9526E8,
|
||||
0xBE5EE304,0xA1FAD5F0,0x6A2D519A,0x63EF8CE2,0x9A86EE22,0xC089C2B8,0x43242EF6,0xA51E03AA,0x9CF2D0A4,
|
||||
0x83C061BA,0x9BE96A4D,0x8FE51550,0xBA645BD6,0x2826A2F9,0xA73A3AE1,0x4BA99586,0xEF5562E9,0xC72FEFD3,
|
||||
0xF752F7DA,0x3F046F69,0x77FA0A59,0x80E4A915,0x87B08601,0x9B09E6AD,0x3B3EE593,0xE990FD5A,0x9E34D797,
|
||||
0x2CF0B7D9,0x022B8B51,0x96D5AC3A,0x017DA67D,0xD1CF3ED6,0x7C7D2D28,0x1F9F25CF,0xADF2B89B,0x5AD6B472,
|
||||
0x5A88F54C,0xE029AC71,0xE019A5E6,0x47B0ACFD,0xED93FA9B,0xE8D3C48D,0x283B57CC,0xF8D56629,0x79132E28,
|
||||
0x785F0191,0xED756055,0xF7960E44,0xE3D35E8C,0x15056DD4,0x88F46DBA,0x03A16125,0x0564F0BD,0xC3EB9E15,
|
||||
0x3C9057A2,0x97271AEC,0xA93A072A,0x1B3F6D9B,0x1E6321F5,0xF59C66FB,0x26DCF319,0x7533D928,0xB155FDF5,
|
||||
0x03563482,0x8ABA3CBB,0x28517711,0xC20AD9F8,0xABCC5167,0xCCAD925F,0x4DE81751,0x3830DC8E,0x379D5862,
|
||||
0x9320F991,0xEA7A90C2,0xFB3E7BCE,0x5121CE64,0x774FBE32,0xA8B6E37E,0xC3293D46,0x48DE5369,0x6413E680,
|
||||
0xA2AE0810,0xDD6DB224,0x69852DFD,0x09072166,0xB39A460A,0x6445C0DD,0x586CDECF,0x1C20C8AE,0x5BBEF7DD,
|
||||
0x1B588D40,0xCCD2017F,0x6BB4E3BB,0xDDA26A7E,0x3A59FF45,0x3E350A44,0xBCB4CDD5,0x72EACEA8,0xFA6484BB,
|
||||
0x8D6612AE,0xBF3C6F47,0xD29BE463,0x542F5D9E,0xAEC2771B,0xF64E6370,0x740E0D8D,0xE75B1357,0xF8721671,
|
||||
0xAF537D5D,0x4040CB08,0x4EB4E2CC,0x34D2466A,0x0115AF84,0xE1B00428,0x95983A1D,0x06B89FB4,0xCE6EA048,
|
||||
0x6F3F3B82,0x3520AB82,0x011A1D4B,0x277227F8,0x611560B1,0xE7933FDC,0xBB3A792B,0x344525BD,0xA08839E1,
|
||||
0x51CE794B,0x2F32C9B7,0xA01FBAC9,0xE01CC87E,0xBCC7D1F6,0xCF0111C3,0xA1E8AAC7,0x1A908749,0xD44FBD9A,
|
||||
0xD0DADECB,0xD50ADA38,0x0339C32A,0xC6913667,0x8DF9317C,0xE0B12B4F,0xF79E59B7,0x43F5BB3A,0xF2D519FF,
|
||||
0x27D9459C,0xBF97222C,0x15E6FC2A,0x0F91FC71,0x9B941525,0xFAE59361,0xCEB69CEB,0xC2A86459,0x12BAA8D1,
|
||||
0xB6C1075E,0xE3056A0C,0x10D25065,0xCB03A442,0xE0EC6E0E,0x1698DB3B,0x4C98A0BE,0x3278E964,0x9F1F9532,
|
||||
0xE0D392DF,0xD3A0342B,0x8971F21E,0x1B0A7441,0x4BA3348C,0xC5BE7120,0xC37632D8,0xDF359F8D,0x9B992F2E,
|
||||
0xE60B6F47,0x0FE3F11D,0xE54CDA54,0x1EDAD891,0xCE6279CF,0xCD3E7E6F,0x1618B166,0xFD2C1D05,0x848FD2C5,
|
||||
0xF6FB2299,0xF523F357,0xA6327623,0x93A83531,0x56CCCD02,0xACF08162,0x5A75EBB5,0x6E163697,0x88D273CC,
|
||||
0xDE966292,0x81B949D0,0x4C50901B,0x71C65614,0xE6C6C7BD,0x327A140A,0x45E1D006,0xC3F27B9A,0xC9AA53FD,
|
||||
0x62A80F00,0xBB25BFE2,0x35BDD2F6,0x71126905,0xB2040222,0xB6CBCF7C,0xCD769C2B,0x53113EC0,0x1640E3D3,
|
||||
0x38ABBD60,0x2547ADF0,0xBA38209C,0xF746CE76,0x77AFA1C5,0x20756060,0x85CBFE4E,0x8AE88DD8,0x7AAAF9B0,
|
||||
0x4CF9AA7E,0x1948C25C,0x02FB8A8C,0x01C36AE4,0xD6EBE1F9,0x90D4F869,0xA65CDEA0,0x3F09252D,0xC208E69F,
|
||||
0xB74E6132,0xCE77E25B,0x578FDFE3,0x3AC372E6
|
||||
}
|
||||
};
|
||||
|
||||
private ulong[] m_P;
|
||||
private ulong[,] m_S;
|
||||
private ulong xl_par;
|
||||
private ulong xr_par;
|
||||
|
||||
private uint Wordbyte0( ulong w )
|
||||
{
|
||||
return (uint)( w / 256 / 256 / 256 % 256 );
|
||||
}
|
||||
|
||||
private uint Wordbyte1( ulong w )
|
||||
{
|
||||
return (uint)( w / 256 / 256 % 256 );
|
||||
}
|
||||
|
||||
private uint Wordbyte2( ulong w )
|
||||
{
|
||||
return (uint)( w / 256 % 256 );
|
||||
}
|
||||
|
||||
private uint Wordbyte3( ulong w )
|
||||
{
|
||||
return (uint)( w % 256 );
|
||||
}
|
||||
|
||||
private ulong Round( ulong a, ulong b, ulong n )
|
||||
{
|
||||
return a ^ ( ( ( ( m_S[ 0, Wordbyte0( b ) ] + m_S[ 1, Wordbyte1( b ) ] ) ^ m_S[ 2, Wordbyte2( b ) ] ) + m_S[ 3, Wordbyte3( b ) ] ) ^ m_P[ n ] );
|
||||
}
|
||||
|
||||
private void Encipher()
|
||||
{
|
||||
ulong Xl = xl_par;
|
||||
ulong Xr = xr_par;
|
||||
|
||||
Xl ^= m_P[ 0 ];
|
||||
|
||||
for( ulong i = 0; i < 16; i += 2 )
|
||||
{
|
||||
Xr = Round( Xr, Xl, i + 1 );
|
||||
Xl = Round( Xl, Xr, i + 2 );
|
||||
}
|
||||
|
||||
Xr ^= m_P[ 17 ];
|
||||
|
||||
xl_par = Xr;
|
||||
xr_par = Xl;
|
||||
}
|
||||
|
||||
private void Decipher()
|
||||
{
|
||||
ulong Xl = xl_par;
|
||||
ulong Xr = xr_par;
|
||||
|
||||
Xl ^= m_P[ 17 ];
|
||||
|
||||
for( ulong i = 16; i > 0; i -= 2 )
|
||||
{
|
||||
Xr = Round( Xr, Xl, i );
|
||||
Xl = Round( Xl, Xr, i - 1 );
|
||||
}
|
||||
|
||||
Xr ^= m_P[ 0 ];
|
||||
|
||||
xl_par = Xr;
|
||||
xr_par = Xl;
|
||||
}
|
||||
|
||||
private string WordEscape( ulong w )
|
||||
{
|
||||
string result = "";
|
||||
|
||||
uint[] m = new uint[ 4 ];
|
||||
|
||||
m[ 0 ] = Wordbyte0( w );
|
||||
m[ 1 ] = Wordbyte1( w );
|
||||
m[ 2 ] = Wordbyte2( w );
|
||||
m[ 3 ] = Wordbyte3( w );
|
||||
|
||||
for( int i = 3; i >= 0; i-- )
|
||||
{
|
||||
uint c1 = m[ i ] / 16;
|
||||
uint c2 = m[ i ] % 16;
|
||||
|
||||
c1 += c1 < 10U ? 48U : 55U;
|
||||
c2 += c2 < 10U ? 48U : 55U;
|
||||
|
||||
result += Convert.ToChar( c1 ).ToString();
|
||||
result += Convert.ToChar( c2 ).ToString();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private int WordUnescape( string szWords )
|
||||
{
|
||||
int iResult = 0;
|
||||
|
||||
for( int i = 6; i >= 0; i-= 2 )
|
||||
{
|
||||
int iChar1 = (int)szWords[ i ];
|
||||
int iChar2 = (int)szWords[ i + 1 ];
|
||||
|
||||
iChar1 -= iChar1 < 58 ? 48 : 55;
|
||||
iChar2 -= iChar2 < 58 ? 48 : 55;
|
||||
|
||||
iResult = iResult * 256 + ( iChar1 * 16 + iChar2 );
|
||||
}
|
||||
|
||||
return iResult;
|
||||
}
|
||||
|
||||
private string Escape( string sKey )
|
||||
{
|
||||
string sResult = "";
|
||||
|
||||
for( int i = 0; i < sKey.Length; i++ )
|
||||
{
|
||||
int c1 = (int)( sKey[ i ] / 16 );
|
||||
int c2 = (int)( sKey[ i ] % 16 );
|
||||
|
||||
c1 += c1 < 10 ? 48 : 55;
|
||||
c2 += c2 < 10 ? 48 : 55;
|
||||
|
||||
sResult += Convert.ToChar( c1 ).ToString();
|
||||
sResult += Convert.ToChar( c2 ).ToString();
|
||||
}
|
||||
|
||||
return sResult;
|
||||
}
|
||||
|
||||
private string Unescape( string sKey )
|
||||
{
|
||||
string sResult = "";
|
||||
|
||||
for( int i = 0; i < sKey.Length; i++ )
|
||||
{
|
||||
uint iChar1 = sKey[ i++ ];
|
||||
uint iChar2 = sKey[ i ];
|
||||
|
||||
if( iChar1 < 58 )
|
||||
iChar1 -= 48;
|
||||
else
|
||||
if( iChar1 > 96 )
|
||||
iChar1 -= 87;
|
||||
else
|
||||
iChar1 -= 55;
|
||||
|
||||
if( iChar2 < 58 )
|
||||
iChar2 -= 48;
|
||||
else
|
||||
if( iChar2 > 96 )
|
||||
iChar2 -= 87;
|
||||
else
|
||||
iChar2 -= 55;
|
||||
|
||||
sResult += ( (char)( iChar1 * 16U + iChar2 ) ).ToString();
|
||||
}
|
||||
|
||||
return sResult;
|
||||
}
|
||||
|
||||
public Blowfish( string szKey )
|
||||
{
|
||||
int iLen = szKey.Length;
|
||||
|
||||
this.m_P = new ulong[ 18 ];
|
||||
this.m_S = new ulong[ 4, 256 ];
|
||||
|
||||
ulong lD;
|
||||
|
||||
int j = 0;
|
||||
|
||||
for( int i = 0; i < 18; i++ )
|
||||
{
|
||||
lD = 0x00000000;
|
||||
|
||||
for( int k = 0; k < 4; k++ )
|
||||
lD = ( lD << 8 ) | szKey[ j++ % iLen ];
|
||||
|
||||
m_P[ i ] = P[ i ] ^ lD;
|
||||
}
|
||||
|
||||
for( int i = 0; i < 4; i++ )
|
||||
for( int c = 0; c < 256; c++ )
|
||||
m_S[ i, c ] = S[ i ][ c ];
|
||||
|
||||
xl_par = 0x00000000;
|
||||
xr_par = 0x00000000;
|
||||
|
||||
for( int i = 0; i < 18; i += 2 )
|
||||
{
|
||||
Encipher();
|
||||
|
||||
m_P[ i ] = xl_par;
|
||||
m_P[ i + 1 ] = xr_par;
|
||||
}
|
||||
|
||||
for( int c = 0; c < 4; c++ )
|
||||
{
|
||||
for( int i = 0; i < 256; i += 2 )
|
||||
{
|
||||
Encipher();
|
||||
|
||||
m_S[ c, i ] = xl_par;
|
||||
m_S[ c, i + 1 ] = xr_par;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
~Blowfish()
|
||||
{
|
||||
//delete m_P;
|
||||
//delete [] m_S;
|
||||
}
|
||||
|
||||
public string Encrypt( string key )
|
||||
{
|
||||
string str = Escape( key );
|
||||
|
||||
for( int i = 0; i < str.Length % 16; i++ )
|
||||
{
|
||||
str += "0";
|
||||
}
|
||||
|
||||
string result = "";
|
||||
|
||||
for( int i = 0; i < str.Length; i += 16 )
|
||||
{
|
||||
xr_par = (ulong)WordUnescape( str.Substring( i, 8 ) );
|
||||
xl_par = (ulong)WordUnescape( str.Substring( i + 8, 8 ) );
|
||||
|
||||
Encipher();
|
||||
|
||||
result += WordEscape( xr_par ) + WordEscape( xl_par );
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public string Decrypt( string sString )
|
||||
{
|
||||
sString = sString.ToUpper();
|
||||
|
||||
for( int i = 0; i < sString.Length % 16; i++)
|
||||
sString += "0";
|
||||
|
||||
string sResult = "";
|
||||
|
||||
for( int i = 0; i < sString.Length; i += 16 )
|
||||
{
|
||||
xr_par = (ulong)WordUnescape( sString.Substring( i, 8 ) );
|
||||
xl_par = (ulong)WordUnescape( sString.Substring( i + 8, 8 ) );
|
||||
|
||||
Decipher();
|
||||
|
||||
sResult += WordEscape( xr_par ) + WordEscape( xl_par );
|
||||
}
|
||||
|
||||
return Unescape( sResult );
|
||||
}
|
||||
};
|
||||
}
|
45
MultiTheftAuto/CameraMatrix.cs
Normal file
45
MultiTheftAuto/CameraMatrix.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto
|
||||
{
|
||||
public class CameraMatrix
|
||||
{
|
||||
public Vector3 Position;
|
||||
public Vector3 LookAt;
|
||||
public float Roll;
|
||||
public float FOV;
|
||||
|
||||
public CameraMatrix( Vector3 position )
|
||||
: this( position, Vector3.Zero, 0f, 0f )
|
||||
{
|
||||
}
|
||||
|
||||
public CameraMatrix( Vector3 position, Vector3 lookAt )
|
||||
: this( position, lookAt, 0f, 0f )
|
||||
{
|
||||
}
|
||||
|
||||
public CameraMatrix( Vector3 position, Vector3 lookAt, float roll, float fov )
|
||||
: this( position.X, position.Y, position.Z, lookAt.X, lookAt.Y, lookAt.Z, roll, fov )
|
||||
{
|
||||
}
|
||||
|
||||
public CameraMatrix( float x, float y, float z, float lookAtX, float lookAtY, float lookAtZ, float roll, float fov )
|
||||
{
|
||||
this.Position.X = x;
|
||||
this.Position.Y = y;
|
||||
this.Position.Z = z;
|
||||
|
||||
this.LookAt.X = lookAtX;
|
||||
this.LookAt.Y = lookAtY;
|
||||
this.LookAt.Z = lookAtZ;
|
||||
|
||||
this.Roll = roll;
|
||||
this.FOV = fov;
|
||||
}
|
||||
}
|
||||
}
|
21
MultiTheftAuto/ColShape.cs
Normal file
21
MultiTheftAuto/ColShape.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto
|
||||
{
|
||||
public class ColShape : Element
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
public ColShape( UInt32 userdata )
|
||||
: base( userdata )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
93
MultiTheftAuto/Color.cs
Normal file
93
MultiTheftAuto/Color.cs
Normal file
@ -0,0 +1,93 @@
|
||||
using System;
|
||||
|
||||
namespace MultiTheftAuto
|
||||
{
|
||||
public class Color
|
||||
{
|
||||
public uint R = 255;
|
||||
public uint G = 255;
|
||||
public uint B = 255;
|
||||
public uint A = 255;
|
||||
|
||||
public uint Red
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.R;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.R = value;
|
||||
}
|
||||
}
|
||||
|
||||
public uint Green
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.G;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.G = value;
|
||||
}
|
||||
}
|
||||
|
||||
public uint Blue
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.B;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.B = value;
|
||||
}
|
||||
}
|
||||
|
||||
public uint Alpha
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.A;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.A = value;
|
||||
}
|
||||
}
|
||||
|
||||
public Color( uint red, uint green, uint blue, uint alpha )
|
||||
{
|
||||
this.R = red % 256;
|
||||
this.G = green % 256;
|
||||
this.B = blue % 256;
|
||||
this.A = alpha % 256;
|
||||
}
|
||||
|
||||
public Color( uint red, uint green, uint blue )
|
||||
{
|
||||
this.R = red % 256;
|
||||
this.G = green % 256;
|
||||
this.B = blue % 256;
|
||||
}
|
||||
|
||||
public Color( uint color )
|
||||
{
|
||||
this.A = color >> 24 & 255;
|
||||
this.R = color >> 16 & 255;
|
||||
this.G = color >> 8 & 255;
|
||||
this.B = color & 255;
|
||||
}
|
||||
|
||||
public uint ToARGB()
|
||||
{
|
||||
return ( this.A << 24 ) | ( this.R << 16 ) | ( this.G << 8 ) | this.B;
|
||||
}
|
||||
|
||||
public uint ToRGBA()
|
||||
{
|
||||
return ( this.R << 24 ) | ( this.G << 16 ) | ( this.B << 8 ) | this.A;
|
||||
}
|
||||
}
|
||||
}
|
14
MultiTheftAuto/Config.cs
Normal file
14
MultiTheftAuto/Config.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace MultiTheftAuto
|
||||
{
|
||||
public static class Config
|
||||
{
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern string Get( string key );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool Set( string key, string value );
|
||||
}
|
||||
}
|
64
MultiTheftAuto/Debug.cs
Normal file
64
MultiTheftAuto/Debug.cs
Normal file
@ -0,0 +1,64 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using System.IO;
|
||||
|
||||
namespace MultiTheftAuto
|
||||
{
|
||||
public static class Debug
|
||||
{
|
||||
private static string assemblyName = Resource.GetCurrent().GetName();
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
private static extern void Log( string message );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
private static extern void Info( string message );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
private static extern void Error( string message );
|
||||
|
||||
public static void Log( string message, params string[] args )
|
||||
{
|
||||
Log( String.Format( message, args ) );
|
||||
}
|
||||
|
||||
public static string FormatPath( string path )
|
||||
{
|
||||
string filepath = "";
|
||||
|
||||
bool start = false;
|
||||
|
||||
foreach( string s in path.Split( '\\' ) )
|
||||
{
|
||||
if( start )
|
||||
{
|
||||
if( filepath.Length > 0 )
|
||||
{
|
||||
filepath += "\\";
|
||||
}
|
||||
|
||||
filepath += s;
|
||||
}
|
||||
|
||||
if( s == assemblyName )
|
||||
{
|
||||
start = true;
|
||||
}
|
||||
}
|
||||
|
||||
return filepath;
|
||||
}
|
||||
|
||||
public static void Info( string message, [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0 )
|
||||
{
|
||||
Info( String.Format( "{0}:{1}: {2}", FormatPath( filePath ), lineNumber, message ) );
|
||||
}
|
||||
|
||||
public static void Error( string message, [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0 )
|
||||
{
|
||||
Error( String.Format( "{0}:{1}: {2}", FormatPath( filePath ), lineNumber, message ) );
|
||||
}
|
||||
}
|
||||
}
|
1319
MultiTheftAuto/Element.cs
Normal file
1319
MultiTheftAuto/Element.cs
Normal file
File diff suppressed because it is too large
Load Diff
118
MultiTheftAuto/Event.cs
Normal file
118
MultiTheftAuto/Event.cs
Normal file
@ -0,0 +1,118 @@
|
||||
using MultiTheftAuto.EventArgs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto
|
||||
{
|
||||
public class Event
|
||||
{
|
||||
public string Name;
|
||||
public Element AttachedTo;
|
||||
public bool Propagated;
|
||||
public string Priority;
|
||||
|
||||
public Event( string name )
|
||||
: this( name, null )
|
||||
{
|
||||
}
|
||||
|
||||
public Event( string name, Element attachedTo, bool propagated = true, string priority = "normal" )
|
||||
{
|
||||
this.Name = name;
|
||||
this.AttachedTo = attachedTo;
|
||||
this.Propagated = propagated;
|
||||
this.Priority = priority;
|
||||
}
|
||||
|
||||
public bool Add()
|
||||
{
|
||||
return Event.AddHandler( this.Name, this.AttachedTo, this._OnTrigger, this.Propagated, this.Priority );
|
||||
}
|
||||
|
||||
public bool Remove()
|
||||
{
|
||||
return Event.RemoveHandler( this.Name, this.AttachedTo, this._OnTrigger );
|
||||
}
|
||||
|
||||
public bool Call( params object[] arguments )
|
||||
{
|
||||
return Native.Event.Trigger( this.Name, this.AttachedTo.GetUserData(), arguments );
|
||||
}
|
||||
|
||||
public bool CallClient( Element baseElement = null, params object[] arguments )
|
||||
{
|
||||
return Native.Event.TriggerClient( baseElement != null ? baseElement.GetUserData() : Element.Root.GetUserData(), this.Name, this.AttachedTo.GetUserData(), arguments );
|
||||
}
|
||||
|
||||
public delegate void CustomEventHandler( Element sender, ElementEventArgs e, params object[] args );
|
||||
|
||||
private CustomEventHandler _OnTrigger;
|
||||
|
||||
public event CustomEventHandler OnTrigger
|
||||
{
|
||||
add
|
||||
{
|
||||
lock( this )
|
||||
{
|
||||
bool isNull = this._OnTrigger == null;
|
||||
|
||||
this._OnTrigger += value;
|
||||
|
||||
if( isNull )
|
||||
{
|
||||
this.Add();
|
||||
}
|
||||
}
|
||||
}
|
||||
remove
|
||||
{
|
||||
lock( this )
|
||||
{
|
||||
this._OnTrigger -= value;
|
||||
|
||||
if( this._OnTrigger == null )
|
||||
{
|
||||
this.Remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region Static methods
|
||||
|
||||
public static bool Add( string name, bool allowRemoteTrigger )
|
||||
{
|
||||
return Native.Event.Add( name, allowRemoteTrigger );
|
||||
}
|
||||
|
||||
public static bool AddHandler( string eventName, Element attachedTo, Delegate handlerFunction, bool getPropagated = true, string priority = "normal" )
|
||||
{
|
||||
return Native.Event.AddHandler( eventName, attachedTo.GetUserData(), handlerFunction, getPropagated, priority );
|
||||
}
|
||||
|
||||
public static bool RemoveHandler( string eventName, Element attachedTo, Delegate handlerFunction )
|
||||
{
|
||||
return Native.Event.RemoveHandler( eventName, attachedTo.GetUserData(), handlerFunction );
|
||||
}
|
||||
|
||||
public static bool Trigger( string eventName, Element baseElement, params object[] arguments )
|
||||
{
|
||||
return Native.Event.Trigger( eventName, baseElement.GetUserData(), arguments );
|
||||
}
|
||||
|
||||
public static bool TriggerClient( Element sendTo, string name, Element sourceElement, params object[] arguments )
|
||||
{
|
||||
return Native.Event.TriggerClient( sendTo.GetUserData(), name, sourceElement.GetUserData(), arguments );
|
||||
}
|
||||
|
||||
public static bool Cancel( bool cancel = true, string reason = "" )
|
||||
{
|
||||
return Native.Event.Cancel( cancel, reason );
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
23
MultiTheftAuto/EventArgs/AccountDataChangeEventArgs.cs
Normal file
23
MultiTheftAuto/EventArgs/AccountDataChangeEventArgs.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class AccountDataChangeEventArgs : ElementEventArgs
|
||||
{
|
||||
public AccountDataChangeEventArgs( Element _this, Account account, string key, dynamic value )
|
||||
: base( _this )
|
||||
{
|
||||
this.Account = account;
|
||||
this.Key = key;
|
||||
this.Value = value;
|
||||
}
|
||||
|
||||
public Account Account;
|
||||
public string Key;
|
||||
public dynamic Value;
|
||||
}
|
||||
}
|
19
MultiTheftAuto/EventArgs/BanEventArgs.cs
Normal file
19
MultiTheftAuto/EventArgs/BanEventArgs.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class BanEventArgs : ElementEventArgs
|
||||
{
|
||||
public BanEventArgs( Element _this, Ban ban )
|
||||
: base( _this )
|
||||
{
|
||||
this.Ban = ban;
|
||||
}
|
||||
|
||||
public Ban Ban;
|
||||
}
|
||||
}
|
22
MultiTheftAuto/EventArgs/CancelEventArgs.cs
Normal file
22
MultiTheftAuto/EventArgs/CancelEventArgs.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class CancelEventArgs : ElementEventArgs
|
||||
{
|
||||
public CancelEventArgs( Element _this )
|
||||
: base( _this )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Cancel( bool cancel = true, string reason = "" )
|
||||
{
|
||||
Event.Cancel( cancel, reason );
|
||||
}
|
||||
}
|
||||
}
|
28
MultiTheftAuto/EventArgs/ChatMessageEventArgs.cs
Normal file
28
MultiTheftAuto/EventArgs/ChatMessageEventArgs.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class ChatMessageEventArgs : ElementEventArgs
|
||||
{
|
||||
public ChatMessageEventArgs( Element _this, string message, Resource element )
|
||||
: base( _this )
|
||||
{
|
||||
this.Message = message;
|
||||
this.Element = element;
|
||||
}
|
||||
|
||||
public ChatMessageEventArgs( Element _this, string message, Element element )
|
||||
: base( _this )
|
||||
{
|
||||
this.Message = message;
|
||||
this.Element = element;
|
||||
}
|
||||
|
||||
public string Message;
|
||||
public object Element;
|
||||
}
|
||||
}
|
28
MultiTheftAuto/EventArgs/ColShapeEventArgs.cs
Normal file
28
MultiTheftAuto/EventArgs/ColShapeEventArgs.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class ColShapeEventArgs : ElementEventArgs
|
||||
{
|
||||
public ColShapeEventArgs( Element _this, Element hitElement, bool matchingDimension )
|
||||
: base( _this )
|
||||
{
|
||||
this.HitElement = hitElement;
|
||||
this.MatchingDimension = matchingDimension;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// the element that entered or leaved the colshape.
|
||||
/// </summary>
|
||||
public Element HitElement;
|
||||
|
||||
/// <summary>
|
||||
/// a boolean referring to whether the hit collision shape was in the same dimension as the element.
|
||||
/// </summary>
|
||||
public bool MatchingDimension;
|
||||
}
|
||||
}
|
19
MultiTheftAuto/EventArgs/ConsoleEventArgs.cs
Normal file
19
MultiTheftAuto/EventArgs/ConsoleEventArgs.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class ConsoleEventArgs : ElementEventArgs
|
||||
{
|
||||
public ConsoleEventArgs( Element _this, string message )
|
||||
: base( _this )
|
||||
{
|
||||
this.Message = message;
|
||||
}
|
||||
|
||||
public string Message;
|
||||
}
|
||||
}
|
25
MultiTheftAuto/EventArgs/DebugMessageEventArgs.cs
Normal file
25
MultiTheftAuto/EventArgs/DebugMessageEventArgs.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class DebugMessageEventArgs : ElementEventArgs
|
||||
{
|
||||
public DebugMessageEventArgs( Element _this, string message, int level, string file, int line )
|
||||
: base( _this )
|
||||
{
|
||||
this.Message = message;
|
||||
this.Level = level;
|
||||
this.File = file;
|
||||
this.Line = line;
|
||||
}
|
||||
|
||||
public string Message;
|
||||
public int Level;
|
||||
public string File;
|
||||
public int Line;
|
||||
}
|
||||
}
|
25
MultiTheftAuto/EventArgs/ElementClickedEventArgs.cs
Normal file
25
MultiTheftAuto/EventArgs/ElementClickedEventArgs.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class ElementClickedEventArgs : ElementEventArgs
|
||||
{
|
||||
public ElementClickedEventArgs( Element _this, string mouseButton, string buttonState, Player whoClicked, float clickPosX, float clickPosY, float clickPosZ )
|
||||
: base( _this )
|
||||
{
|
||||
this.MouseButton = mouseButton;
|
||||
this.ButtonState = buttonState;
|
||||
this.WhoClicked = whoClicked;
|
||||
this.ClickPosition = new Vector3( clickPosX, clickPosY, clickPosZ );
|
||||
}
|
||||
|
||||
public string MouseButton;
|
||||
public string ButtonState;
|
||||
public Player WhoClicked;
|
||||
public Vector3 ClickPosition;
|
||||
}
|
||||
}
|
21
MultiTheftAuto/EventArgs/ElementColShapeEventArgs.cs
Normal file
21
MultiTheftAuto/EventArgs/ElementColShapeEventArgs.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class ElementColShapeEventArgs : ElementEventArgs
|
||||
{
|
||||
public ElementColShapeEventArgs( Element _this, ColShape colShape, bool matchingDimension )
|
||||
: base( _this )
|
||||
{
|
||||
this.ColShape = colShape;
|
||||
this.MatchingDimension = matchingDimension;
|
||||
}
|
||||
|
||||
public ColShape ColShape;
|
||||
public bool MatchingDimension;
|
||||
}
|
||||
}
|
23
MultiTheftAuto/EventArgs/ElementDataChangeEventArgs.cs
Normal file
23
MultiTheftAuto/EventArgs/ElementDataChangeEventArgs.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class ElementDataChangeEventArgs : ElementEventArgs
|
||||
{
|
||||
public ElementDataChangeEventArgs( Element _this, Player client, string name, dynamic oldValue )
|
||||
: base( _this )
|
||||
{
|
||||
this.Client = client;
|
||||
this.Name = name;
|
||||
this.OldValue = oldValue;
|
||||
}
|
||||
|
||||
public Player Client;
|
||||
public string Name;
|
||||
public dynamic OldValue;
|
||||
}
|
||||
}
|
18
MultiTheftAuto/EventArgs/ElementEventArgs.cs
Normal file
18
MultiTheftAuto/EventArgs/ElementEventArgs.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class ElementEventArgs : System.EventArgs
|
||||
{
|
||||
public ElementEventArgs( Element _this )
|
||||
{
|
||||
this.This = _this;
|
||||
}
|
||||
|
||||
public Element This;
|
||||
}
|
||||
}
|
21
MultiTheftAuto/EventArgs/ElementModelChangeEventArgs.cs
Normal file
21
MultiTheftAuto/EventArgs/ElementModelChangeEventArgs.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class ElementModelChangeEventArgs : ElementEventArgs
|
||||
{
|
||||
public ElementModelChangeEventArgs( Element _this, int oldModel, int newModel )
|
||||
: base( _this )
|
||||
{
|
||||
this.OldModel = oldModel;
|
||||
this.NewModel = newModel;
|
||||
}
|
||||
|
||||
public int OldModel;
|
||||
public int NewModel;
|
||||
}
|
||||
}
|
21
MultiTheftAuto/EventArgs/MarkerEventArgs.cs
Normal file
21
MultiTheftAuto/EventArgs/MarkerEventArgs.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class MarkerEventArgs : ElementEventArgs
|
||||
{
|
||||
public MarkerEventArgs( Element _this, Element element, bool matchingDimension )
|
||||
: base( _this )
|
||||
{
|
||||
this.Element = element;
|
||||
this.MatchingDimension = matchingDimension;
|
||||
}
|
||||
|
||||
public Element Element;
|
||||
public bool MatchingDimension;
|
||||
}
|
||||
}
|
19
MultiTheftAuto/EventArgs/PedCancelEventArgs.cs
Normal file
19
MultiTheftAuto/EventArgs/PedCancelEventArgs.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class PedCancelEventArgs : CancelEventArgs
|
||||
{
|
||||
public PedCancelEventArgs( Element _this, Ped ped )
|
||||
: base( _this )
|
||||
{
|
||||
this.Ped = ped;
|
||||
}
|
||||
|
||||
public Ped Ped;
|
||||
}
|
||||
}
|
19
MultiTheftAuto/EventArgs/PedEventArgs.cs
Normal file
19
MultiTheftAuto/EventArgs/PedEventArgs.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class PedEventArgs : ElementEventArgs
|
||||
{
|
||||
public PedEventArgs( Element _this, Ped ped )
|
||||
: base( _this )
|
||||
{
|
||||
this.Ped = ped;
|
||||
}
|
||||
|
||||
public Ped Ped;
|
||||
}
|
||||
}
|
27
MultiTheftAuto/EventArgs/PedWastedEventArgs.cs
Normal file
27
MultiTheftAuto/EventArgs/PedWastedEventArgs.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class PedWastedEventArgs : ElementEventArgs
|
||||
{
|
||||
public PedWastedEventArgs( Element _this, int totalAmmo, Element killer, int killerWeapon, int bodypart, bool stealth )
|
||||
: base( _this )
|
||||
{
|
||||
this.TotalAmmo = totalAmmo;
|
||||
this.Killer = killer;
|
||||
this.KillerWeapon = killerWeapon;
|
||||
this.Bodypart = bodypart;
|
||||
this.Stealth = stealth;
|
||||
}
|
||||
|
||||
public int TotalAmmo;
|
||||
public Element Killer;
|
||||
public int KillerWeapon;
|
||||
public int Bodypart;
|
||||
public bool Stealth;
|
||||
}
|
||||
}
|
21
MultiTheftAuto/EventArgs/PedWeaponSwitchEventArgs.cs
Normal file
21
MultiTheftAuto/EventArgs/PedWeaponSwitchEventArgs.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class PedWeaponSwitchEventArgs : ElementEventArgs
|
||||
{
|
||||
public PedWeaponSwitchEventArgs( Element _this, int previousWeaponID, int currentWeaponID )
|
||||
: base( _this )
|
||||
{
|
||||
this.PreviousWeaponID = previousWeaponID;
|
||||
this.CurrentWeaponID = currentWeaponID;
|
||||
}
|
||||
|
||||
public int PreviousWeaponID;
|
||||
public int CurrentWeaponID;
|
||||
}
|
||||
}
|
21
MultiTheftAuto/EventArgs/PlayerBanEventArgs.cs
Normal file
21
MultiTheftAuto/EventArgs/PlayerBanEventArgs.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class PlayerBanEventArgs : ElementEventArgs
|
||||
{
|
||||
public PlayerBanEventArgs( Element _this, Ban banPointer, Player responsibleElement )
|
||||
: base( _this )
|
||||
{
|
||||
this.Ban = banPointer;
|
||||
this.Responsible = responsibleElement;
|
||||
}
|
||||
|
||||
public Ban Ban;
|
||||
public Player Responsible;
|
||||
}
|
||||
}
|
19
MultiTheftAuto/EventArgs/PlayerCancelEventArgs.cs
Normal file
19
MultiTheftAuto/EventArgs/PlayerCancelEventArgs.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class PlayerCancelEventArgs : CancelEventArgs
|
||||
{
|
||||
public PlayerCancelEventArgs( Element _this, Player player )
|
||||
: base( _this )
|
||||
{
|
||||
this.Player = player;
|
||||
}
|
||||
|
||||
public Player Player;
|
||||
}
|
||||
}
|
30
MultiTheftAuto/EventArgs/PlayerChangeNickEventArgs.cs
Normal file
30
MultiTheftAuto/EventArgs/PlayerChangeNickEventArgs.cs
Normal file
@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class PlayerChangeNickEventArgs : CancelEventArgs
|
||||
{
|
||||
public PlayerChangeNickEventArgs( Element _this, string oldNick, string newNick )
|
||||
: base( _this )
|
||||
{
|
||||
this.Old = oldNick;
|
||||
this.New = newNick;
|
||||
}
|
||||
|
||||
public string Old
|
||||
{
|
||||
private set;
|
||||
get;
|
||||
}
|
||||
|
||||
public string New
|
||||
{
|
||||
private set;
|
||||
get;
|
||||
}
|
||||
}
|
||||
}
|
21
MultiTheftAuto/EventArgs/PlayerChatEventArgs.cs
Normal file
21
MultiTheftAuto/EventArgs/PlayerChatEventArgs.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class PlayerChatEventArgs : ElementEventArgs
|
||||
{
|
||||
public PlayerChatEventArgs( Element _this, string message, int messageType )
|
||||
: base( _this )
|
||||
{
|
||||
this.Message = message;
|
||||
this.Type = messageType;
|
||||
}
|
||||
|
||||
public string Message;
|
||||
public int Type;
|
||||
}
|
||||
}
|
27
MultiTheftAuto/EventArgs/PlayerClickEventArgs.cs
Normal file
27
MultiTheftAuto/EventArgs/PlayerClickEventArgs.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class PlayerClickEventArgs : ElementEventArgs
|
||||
{
|
||||
public PlayerClickEventArgs( Element _this, string mouseButton, string buttonState, Element clickedElement, float worldX, float worldY, float worldZ, float screenX, float screenY )
|
||||
: base( _this )
|
||||
{
|
||||
this.MouseButton = mouseButton;
|
||||
this.ButtonState = buttonState;
|
||||
this.ClickedElement = clickedElement;
|
||||
this.WorldPosition = new Vector3( worldX, worldY, worldZ );
|
||||
this.ScreenPosition = new Vector2( screenX, screenY );
|
||||
}
|
||||
|
||||
public string MouseButton;
|
||||
public string ButtonState;
|
||||
public Element ClickedElement;
|
||||
public Vector3 WorldPosition;
|
||||
public Vector2 ScreenPosition;
|
||||
}
|
||||
}
|
19
MultiTheftAuto/EventArgs/PlayerCommandEventArgs.cs
Normal file
19
MultiTheftAuto/EventArgs/PlayerCommandEventArgs.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class PlayerCommandEventArgs : CancelEventArgs
|
||||
{
|
||||
public PlayerCommandEventArgs( Element _this, string command )
|
||||
: base( _this )
|
||||
{
|
||||
this.Command = command;
|
||||
}
|
||||
|
||||
public string Command;
|
||||
}
|
||||
}
|
29
MultiTheftAuto/EventArgs/PlayerConnectEventArgs.cs
Normal file
29
MultiTheftAuto/EventArgs/PlayerConnectEventArgs.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class PlayerConnectEventArgs : CancelEventArgs
|
||||
{
|
||||
public PlayerConnectEventArgs( Element _this, string nick, string ip, string username, string serial, int versionNumber, string versionString )
|
||||
: base( _this )
|
||||
{
|
||||
this.Nick = nick;
|
||||
this.IP = ip;
|
||||
this.Username = username;
|
||||
this.Serial = serial;
|
||||
this.VersionNumber = versionNumber;
|
||||
this.VersionString = versionString;
|
||||
}
|
||||
|
||||
public string Nick;
|
||||
public string IP;
|
||||
public string Username;
|
||||
public string Serial;
|
||||
public int VersionNumber;
|
||||
public string VersionString;
|
||||
}
|
||||
}
|
21
MultiTheftAuto/EventArgs/PlayerContactEventArgs.cs
Normal file
21
MultiTheftAuto/EventArgs/PlayerContactEventArgs.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class PlayerContactEventArgs : ElementEventArgs
|
||||
{
|
||||
public PlayerContactEventArgs( Element _this, Element previous, Element current )
|
||||
: base( _this )
|
||||
{
|
||||
this.Previous = previous;
|
||||
this.Current = current;
|
||||
}
|
||||
|
||||
public Element Previous;
|
||||
public Element Current;
|
||||
}
|
||||
}
|
25
MultiTheftAuto/EventArgs/PlayerDamageEvetArgs.cs
Normal file
25
MultiTheftAuto/EventArgs/PlayerDamageEvetArgs.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class PlayerDamageEvetArgs : ElementEventArgs
|
||||
{
|
||||
public PlayerDamageEvetArgs( Element _this, Player attacker, int attackerweapon, int bodypart, float loss )
|
||||
: base( _this )
|
||||
{
|
||||
this.Attacker = attacker;
|
||||
this.AttackerWeapon = attackerweapon;
|
||||
this.Bodypart = bodypart;
|
||||
this.Loss = loss;
|
||||
}
|
||||
|
||||
public Player Attacker;
|
||||
public int AttackerWeapon;
|
||||
public int Bodypart;
|
||||
public float Loss;
|
||||
}
|
||||
}
|
19
MultiTheftAuto/EventArgs/PlayerEventArgs.cs
Normal file
19
MultiTheftAuto/EventArgs/PlayerEventArgs.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class PlayerEventArgs : ElementEventArgs
|
||||
{
|
||||
public PlayerEventArgs( Element _this, Player player )
|
||||
: base( _this )
|
||||
{
|
||||
this.Player = player;
|
||||
}
|
||||
|
||||
public Player Player;
|
||||
}
|
||||
}
|
23
MultiTheftAuto/EventArgs/PlayerLoginEventArgs.cs
Normal file
23
MultiTheftAuto/EventArgs/PlayerLoginEventArgs.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class PlayerLoginEventArgs : ElementEventArgs
|
||||
{
|
||||
public PlayerLoginEventArgs( Element _this, Account previousAccount, Account currentAccount, bool autoLogin )
|
||||
: base( _this )
|
||||
{
|
||||
this.PreviousAccount = previousAccount;
|
||||
this.CurrentAccount = currentAccount;
|
||||
this.AutoLogin = autoLogin;
|
||||
}
|
||||
|
||||
public Account PreviousAccount;
|
||||
public Account CurrentAccount;
|
||||
public bool AutoLogin;
|
||||
}
|
||||
}
|
21
MultiTheftAuto/EventArgs/PlayerLogoutEventArgs.cs
Normal file
21
MultiTheftAuto/EventArgs/PlayerLogoutEventArgs.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class PlayerLogoutEventArgs : ElementEventArgs
|
||||
{
|
||||
public PlayerLogoutEventArgs( Element _this, Account previousAccount, Account currentAccount )
|
||||
: base( _this )
|
||||
{
|
||||
this.PreviousAccount = previousAccount;
|
||||
this.CurrentAccount = currentAccount;
|
||||
}
|
||||
|
||||
public Account PreviousAccount;
|
||||
public Account CurrentAccount;
|
||||
}
|
||||
}
|
21
MultiTheftAuto/EventArgs/PlayerMarkerEventArgs.cs
Normal file
21
MultiTheftAuto/EventArgs/PlayerMarkerEventArgs.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class PlayerMarkerEventArgs : ElementEventArgs
|
||||
{
|
||||
public PlayerMarkerEventArgs( Element _this, Marker marker, bool matchingDimension )
|
||||
: base( _this )
|
||||
{
|
||||
this.Marker = marker;
|
||||
this.MatchingDimension = matchingDimension;
|
||||
}
|
||||
|
||||
public Marker Marker;
|
||||
public bool MatchingDimension;
|
||||
}
|
||||
}
|
26
MultiTheftAuto/EventArgs/PlayerModInfoEventArgs.cs
Normal file
26
MultiTheftAuto/EventArgs/PlayerModInfoEventArgs.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class PlayerModInfoEventArgs : ElementEventArgs
|
||||
{
|
||||
public PlayerModInfoEventArgs( Element _this, string filename, PlayerModInfo [] list )
|
||||
: base( _this )
|
||||
{
|
||||
this.FileName = filename;
|
||||
this.List = list;
|
||||
}
|
||||
|
||||
public PlayerModInfo [] List;
|
||||
|
||||
public string FileName
|
||||
{
|
||||
private set;
|
||||
get;
|
||||
}
|
||||
}
|
||||
}
|
21
MultiTheftAuto/EventArgs/PlayerPickupHitEventArgs.cs
Normal file
21
MultiTheftAuto/EventArgs/PlayerPickupHitEventArgs.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class PlayerPickupHitEventArgs : CancelEventArgs
|
||||
{
|
||||
public PlayerPickupHitEventArgs( Element _this, Pickup pickup, bool matchingDimension )
|
||||
: base( _this )
|
||||
{
|
||||
this.Pickup = pickup;
|
||||
this.MatchingDimension = matchingDimension;
|
||||
}
|
||||
|
||||
public Pickup Pickup;
|
||||
public bool MatchingDimension;
|
||||
}
|
||||
}
|
19
MultiTheftAuto/EventArgs/PlayerPickupUseEventArgs.cs
Normal file
19
MultiTheftAuto/EventArgs/PlayerPickupUseEventArgs.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class PlayerPickupUseEventArgs : CancelEventArgs
|
||||
{
|
||||
public PlayerPickupUseEventArgs( Element _this, Pickup pickup )
|
||||
: base( _this )
|
||||
{
|
||||
this.Pickup = pickup;
|
||||
}
|
||||
|
||||
public Pickup Pickup;
|
||||
}
|
||||
}
|
19
MultiTheftAuto/EventArgs/PlayerPrivateMessageEventArgs.cs
Normal file
19
MultiTheftAuto/EventArgs/PlayerPrivateMessageEventArgs.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class PlayerPrivateMessageEventArgs : PlayerCancelEventArgs
|
||||
{
|
||||
public PlayerPrivateMessageEventArgs( Element _this, string message, Player recipient )
|
||||
: base( _this, recipient )
|
||||
{
|
||||
this.Message = message;
|
||||
}
|
||||
|
||||
public string Message;
|
||||
}
|
||||
}
|
37
MultiTheftAuto/EventArgs/PlayerQuitEventArgs.cs
Normal file
37
MultiTheftAuto/EventArgs/PlayerQuitEventArgs.cs
Normal file
@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class PlayerQuitEventArgs : ElementEventArgs
|
||||
{
|
||||
public PlayerQuitEventArgs( Element _this, string type, string reason, Player responsePlayer )
|
||||
: base( _this )
|
||||
{
|
||||
this.Type = type;
|
||||
this.Reason = reason;
|
||||
this.ResponsePlayer = responsePlayer;
|
||||
}
|
||||
|
||||
public string Type
|
||||
{
|
||||
private set;
|
||||
get;
|
||||
}
|
||||
|
||||
public string Reason
|
||||
{
|
||||
private set;
|
||||
get;
|
||||
}
|
||||
|
||||
public Player ResponsePlayer
|
||||
{
|
||||
private set;
|
||||
get;
|
||||
}
|
||||
}
|
||||
}
|
27
MultiTheftAuto/EventArgs/PlayerScreenShotEventArgs.cs
Normal file
27
MultiTheftAuto/EventArgs/PlayerScreenShotEventArgs.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class PlayerScreenShotEventArgs : ElementEventArgs
|
||||
{
|
||||
public PlayerScreenShotEventArgs( Element _this, Resource resource, string status, string imageData, int timestamp, string tag )
|
||||
: base( _this )
|
||||
{
|
||||
this.Resource = resource;
|
||||
this.Status = status;
|
||||
this.ImageData = imageData;
|
||||
this.Timestamp = timestamp;
|
||||
this.Tag = tag;
|
||||
}
|
||||
|
||||
public Resource Resource;
|
||||
public string Status;
|
||||
public string ImageData;
|
||||
public int Timestamp;
|
||||
public string Tag;
|
||||
}
|
||||
}
|
29
MultiTheftAuto/EventArgs/PlayerSpawnEventArgs.cs
Normal file
29
MultiTheftAuto/EventArgs/PlayerSpawnEventArgs.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class PlayerSpawnEventArgs : ElementEventArgs
|
||||
{
|
||||
public PlayerSpawnEventArgs( Element _this, float x, float y, float z, float rotation, Team team, int skin, int interior, int dimension )
|
||||
: base( _this )
|
||||
{
|
||||
this.Position = new Vector3( x, y, z );
|
||||
this.Rotation = rotation;
|
||||
this.Team = team;
|
||||
this.SkinID = skin;
|
||||
this.Interior = interior;
|
||||
this.Dimension = dimension;
|
||||
}
|
||||
|
||||
public Vector3 Position;
|
||||
public float Rotation;
|
||||
public Team Team;
|
||||
public int SkinID;
|
||||
public int Interior;
|
||||
public int Dimension;
|
||||
}
|
||||
}
|
19
MultiTheftAuto/EventArgs/PlayerTargetEventArgs.cs
Normal file
19
MultiTheftAuto/EventArgs/PlayerTargetEventArgs.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class PlayerTargetEventArgs : ElementEventArgs
|
||||
{
|
||||
public PlayerTargetEventArgs( Element _this, Element targettedElement )
|
||||
: base( _this )
|
||||
{
|
||||
this.Target = targettedElement;
|
||||
}
|
||||
|
||||
public Element Target;
|
||||
}
|
||||
}
|
23
MultiTheftAuto/EventArgs/PlayerVehicleEnterEventArgs.cs
Normal file
23
MultiTheftAuto/EventArgs/PlayerVehicleEnterEventArgs.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class PlayerVehicleEnterEventArgs : ElementEventArgs
|
||||
{
|
||||
public PlayerVehicleEnterEventArgs( Element _this, Vehicle vehicle, int seat, Player jacker )
|
||||
: base( _this )
|
||||
{
|
||||
this.Vehicle = vehicle;
|
||||
this.Seat = seat;
|
||||
this.Jacker = jacker;
|
||||
}
|
||||
|
||||
public Vehicle Vehicle;
|
||||
public int Seat;
|
||||
public Player Jacker;
|
||||
}
|
||||
}
|
19
MultiTheftAuto/EventArgs/ResourceEventArgs.cs
Normal file
19
MultiTheftAuto/EventArgs/ResourceEventArgs.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class ResourceEventArgs : CancelEventArgs
|
||||
{
|
||||
public ResourceEventArgs( Element _this, Resource resource )
|
||||
: base( _this )
|
||||
{
|
||||
this.Resource = resource;
|
||||
}
|
||||
|
||||
public Resource Resource;
|
||||
}
|
||||
}
|
23
MultiTheftAuto/EventArgs/SettingChangeEventArgs.cs
Normal file
23
MultiTheftAuto/EventArgs/SettingChangeEventArgs.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class SettingChangeEventArgs : ElementEventArgs
|
||||
{
|
||||
public SettingChangeEventArgs( Element _this, string setting, string oldValue, string newValue )
|
||||
: base( _this )
|
||||
{
|
||||
this.Setting = setting;
|
||||
this.OldValue = oldValue;
|
||||
this.NewValue = newValue;
|
||||
}
|
||||
|
||||
public string Setting;
|
||||
public string OldValue;
|
||||
public string NewValue;
|
||||
}
|
||||
}
|
21
MultiTheftAuto/EventArgs/UnbanEventArgs.cs
Normal file
21
MultiTheftAuto/EventArgs/UnbanEventArgs.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class UnbanEventArgs : CancelEventArgs
|
||||
{
|
||||
public UnbanEventArgs( Element _this, Ban ban, Player responsibleElement )
|
||||
: base( _this )
|
||||
{
|
||||
this.Ban = ban;
|
||||
this.ResponsibleElement = responsibleElement;
|
||||
}
|
||||
|
||||
public Ban Ban;
|
||||
public Player ResponsibleElement;
|
||||
}
|
||||
}
|
19
MultiTheftAuto/EventArgs/VehicleDamageEventArgs.cs
Normal file
19
MultiTheftAuto/EventArgs/VehicleDamageEventArgs.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class VehicleDamageEventArgs : ElementEventArgs
|
||||
{
|
||||
public VehicleDamageEventArgs( Element _this, float loss )
|
||||
: base( _this )
|
||||
{
|
||||
this.Loss = loss;
|
||||
}
|
||||
|
||||
public float Loss;
|
||||
}
|
||||
}
|
23
MultiTheftAuto/EventArgs/VehicleEnterEventArgs.cs
Normal file
23
MultiTheftAuto/EventArgs/VehicleEnterEventArgs.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class VehicleEnterEventArgs : ElementEventArgs
|
||||
{
|
||||
public VehicleEnterEventArgs( Element _this, Player player, int seat, Player jacked )
|
||||
: base( _this )
|
||||
{
|
||||
this.Player = player;
|
||||
this.Seat = seat;
|
||||
this.Jacked = jacked;
|
||||
}
|
||||
|
||||
public Player Player;
|
||||
public int Seat;
|
||||
public Player Jacked;
|
||||
}
|
||||
}
|
19
MultiTheftAuto/EventArgs/VehicleEventArgs.cs
Normal file
19
MultiTheftAuto/EventArgs/VehicleEventArgs.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class VehicleEventArgs : ElementEventArgs
|
||||
{
|
||||
public VehicleEventArgs( Element _this, Vehicle vehicle )
|
||||
: base( _this )
|
||||
{
|
||||
this.Vehicle = vehicle;
|
||||
}
|
||||
|
||||
public Vehicle Vehicle;
|
||||
}
|
||||
}
|
19
MultiTheftAuto/EventArgs/VehicleRespawnEventArgs.cs
Normal file
19
MultiTheftAuto/EventArgs/VehicleRespawnEventArgs.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class VehicleRespawnEventArgs : ElementEventArgs
|
||||
{
|
||||
public VehicleRespawnEventArgs( Element _this, bool exploded )
|
||||
: base( _this )
|
||||
{
|
||||
this.Exploded = exploded;
|
||||
}
|
||||
|
||||
public bool Exploded;
|
||||
}
|
||||
}
|
25
MultiTheftAuto/EventArgs/VehicleStartEnterEventArgs.cs
Normal file
25
MultiTheftAuto/EventArgs/VehicleStartEnterEventArgs.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.EventArgs
|
||||
{
|
||||
public class VehicleStartEnterEventArgs : ElementEventArgs
|
||||
{
|
||||
public VehicleStartEnterEventArgs( Element _this, Player player, int seat, Player jacked, int door )
|
||||
: base( _this )
|
||||
{
|
||||
this.Player = player;
|
||||
this.Seat = seat;
|
||||
this.Jacked = jacked;
|
||||
this.Door = door;
|
||||
}
|
||||
|
||||
public Player Player;
|
||||
public int Seat;
|
||||
public Player Jacked;
|
||||
public int Door;
|
||||
}
|
||||
}
|
155
MultiTheftAuto/HeatHazeSettings.cs
Normal file
155
MultiTheftAuto/HeatHazeSettings.cs
Normal file
@ -0,0 +1,155 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto
|
||||
{
|
||||
public class HeatHazeSettings
|
||||
{
|
||||
private byte ucIntensity; // 0 to 255
|
||||
private byte ucRandomShift; // 0 to 255
|
||||
private ushort usSpeedMin; // 0 to 1000
|
||||
private ushort usSpeedMax; // 0 to 1000
|
||||
private short sScanSizeX; // -1000 to 1000
|
||||
private short sScanSizeY; // -1000 to 1000
|
||||
private ushort usRenderSizeX; // 0 to 1000
|
||||
private ushort usRenderSizeY; // 0 to 1000
|
||||
private bool bInsideBuilding;
|
||||
|
||||
public byte Intensity
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.ucIntensity;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.ucIntensity = value;
|
||||
}
|
||||
}
|
||||
|
||||
public byte RandomShift
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.ucRandomShift;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.ucRandomShift = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ushort SpeedMin
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.usSpeedMin;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.usSpeedMin = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ushort SpeedMax
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.usSpeedMax;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.usSpeedMax = value;
|
||||
}
|
||||
}
|
||||
|
||||
public short ScanSizeX
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.sScanSizeX;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.sScanSizeX = value;
|
||||
}
|
||||
}
|
||||
|
||||
public short ScanSizeY
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.sScanSizeY;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.sScanSizeY = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ushort RenderSizeX
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.usRenderSizeX;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.usRenderSizeX = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ushort RenderSizeY
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.usRenderSizeY;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.usRenderSizeY = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool InsideBuilding
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.bInsideBuilding;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.bInsideBuilding = value;
|
||||
}
|
||||
}
|
||||
|
||||
public HeatHazeSettings()
|
||||
{
|
||||
this.ucIntensity = 0;
|
||||
this.ucRandomShift = 0;
|
||||
this.usSpeedMin = 1;
|
||||
this.usSpeedMax = 1;
|
||||
this.sScanSizeX = 1;
|
||||
this.sScanSizeY = 1;
|
||||
this.usRenderSizeX = 1;
|
||||
this.usRenderSizeY = 1;
|
||||
this.bInsideBuilding = false;
|
||||
}
|
||||
|
||||
public HeatHazeSettings( HeatHazeSettings heatHazeSettings )
|
||||
{
|
||||
this.ucIntensity = heatHazeSettings.ucIntensity;
|
||||
this.ucRandomShift = heatHazeSettings.ucRandomShift;
|
||||
this.usSpeedMin = heatHazeSettings.usSpeedMin;
|
||||
this.usSpeedMax = heatHazeSettings.usSpeedMax;
|
||||
this.sScanSizeX = heatHazeSettings.sScanSizeX;
|
||||
this.sScanSizeY = heatHazeSettings.sScanSizeY;
|
||||
this.usRenderSizeX = heatHazeSettings.usRenderSizeX;
|
||||
this.usRenderSizeY = heatHazeSettings.usRenderSizeY;
|
||||
this.bInsideBuilding = heatHazeSettings.bInsideBuilding;
|
||||
}
|
||||
}
|
||||
}
|
20
MultiTheftAuto/Marker.cs
Normal file
20
MultiTheftAuto/Marker.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace MultiTheftAuto
|
||||
{
|
||||
public class Marker : Element
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
public Marker( UInt32 userdata )
|
||||
: base( userdata )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
21
MultiTheftAuto/MultiTheftAuto.cs
Normal file
21
MultiTheftAuto/MultiTheftAuto.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto
|
||||
{
|
||||
public class MultiTheftAuto
|
||||
{
|
||||
#region Constructor
|
||||
|
||||
public MultiTheftAuto()
|
||||
{
|
||||
Resource.Register<Resource>();
|
||||
Element.Register<Element>();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
157
MultiTheftAuto/MultiTheftAuto.csproj
Normal file
157
MultiTheftAuto/MultiTheftAuto.csproj
Normal file
@ -0,0 +1,157 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{2E5D4B1E-405E-453F-BEED-25735E25ACD8}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>MultiTheftAuto</RootNamespace>
|
||||
<AssemblyName>MultiTheftAuto</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\builds\server\mods\deathmatch\mono\lib\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\builds\server\mods\deathmatch\mono\lib\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Account.cs" />
|
||||
<Compile Include="Ban.cs" />
|
||||
<Compile Include="Blowfish.cs" />
|
||||
<Compile Include="CameraMatrix.cs" />
|
||||
<Compile Include="Color.cs" />
|
||||
<Compile Include="ColShape.cs" />
|
||||
<Compile Include="Element.cs" />
|
||||
<Compile Include="Event.cs" />
|
||||
<Compile Include="EventArgs\BanEventArgs.cs" />
|
||||
<Compile Include="EventArgs\CancelEventArgs.cs" />
|
||||
<Compile Include="EventArgs\ChatMessageEventArgs.cs" />
|
||||
<Compile Include="EventArgs\ColShapeEventArgs.cs" />
|
||||
<Compile Include="EventArgs\ConsoleEventArgs.cs" />
|
||||
<Compile Include="EventArgs\DebugMessageEventArgs.cs" />
|
||||
<Compile Include="EventArgs\ElementClickedEventArgs.cs" />
|
||||
<Compile Include="EventArgs\ElementColShapeEventArgs.cs" />
|
||||
<Compile Include="EventArgs\ElementDataChangeEventArgs.cs" />
|
||||
<Compile Include="EventArgs\ElementEventArgs.cs" />
|
||||
<Compile Include="EventArgs\ElementModelChangeEventArgs.cs" />
|
||||
<Compile Include="EventArgs\MarkerEventArgs.cs" />
|
||||
<Compile Include="EventArgs\AccountDataChangeEventArgs.cs" />
|
||||
<Compile Include="EventArgs\PedCancelEventArgs.cs" />
|
||||
<Compile Include="EventArgs\PedEventArgs.cs" />
|
||||
<Compile Include="EventArgs\PlayerBanEventArgs.cs" />
|
||||
<Compile Include="EventArgs\PlayerCancelEventArgs.cs" />
|
||||
<Compile Include="EventArgs\PlayerChangeNickEventArgs.cs" />
|
||||
<Compile Include="EventArgs\PlayerChatEventArgs.cs" />
|
||||
<Compile Include="EventArgs\PlayerClickEventArgs.cs" />
|
||||
<Compile Include="EventArgs\PlayerCommandEventArgs.cs" />
|
||||
<Compile Include="EventArgs\PlayerConnectEventArgs.cs" />
|
||||
<Compile Include="EventArgs\PlayerContactEventArgs.cs" />
|
||||
<Compile Include="EventArgs\PlayerDamageEvetArgs.cs" />
|
||||
<Compile Include="EventArgs\PlayerEventArgs.cs" />
|
||||
<Compile Include="EventArgs\PlayerLoginEventArgs.cs" />
|
||||
<Compile Include="EventArgs\PlayerLogoutEventArgs.cs" />
|
||||
<Compile Include="EventArgs\PlayerMarkerEventArgs.cs" />
|
||||
<Compile Include="EventArgs\PlayerModInfoEventArgs.cs" />
|
||||
<Compile Include="EventArgs\PlayerPickupHitEventArgs.cs" />
|
||||
<Compile Include="EventArgs\PlayerPickupUseEventArgs.cs" />
|
||||
<Compile Include="EventArgs\PlayerPrivateMessageEventArgs.cs" />
|
||||
<Compile Include="EventArgs\PlayerQuitEventArgs.cs" />
|
||||
<Compile Include="EventArgs\PlayerScreenShotEventArgs.cs" />
|
||||
<Compile Include="EventArgs\PlayerSpawnEventArgs.cs" />
|
||||
<Compile Include="EventArgs\PlayerTargetEventArgs.cs" />
|
||||
<Compile Include="EventArgs\PlayerVehicleEnterEventArgs.cs" />
|
||||
<Compile Include="EventArgs\PedWastedEventArgs.cs" />
|
||||
<Compile Include="EventArgs\PedWeaponSwitchEventArgs.cs" />
|
||||
<Compile Include="EventArgs\ResourceEventArgs.cs" />
|
||||
<Compile Include="EventArgs\SettingChangeEventArgs.cs" />
|
||||
<Compile Include="EventArgs\UnbanEventArgs.cs" />
|
||||
<Compile Include="EventArgs\VehicleDamageEventArgs.cs" />
|
||||
<Compile Include="EventArgs\VehicleEnterEventArgs.cs" />
|
||||
<Compile Include="EventArgs\VehicleEventArgs.cs" />
|
||||
<Compile Include="EventArgs\VehicleRespawnEventArgs.cs" />
|
||||
<Compile Include="EventArgs\VehicleStartEnterEventArgs.cs" />
|
||||
<Compile Include="HeatHazeSettings.cs" />
|
||||
<Compile Include="Marker.cs" />
|
||||
<Compile Include="MultiTheftAuto.cs" />
|
||||
<Compile Include="Native\Account.cs" />
|
||||
<Compile Include="Native\Blip.cs" />
|
||||
<Compile Include="Native\ColShape.cs" />
|
||||
<Compile Include="Config.cs" />
|
||||
<Compile Include="Debug.cs" />
|
||||
<Compile Include="Native\Element.cs" />
|
||||
<Compile Include="Native\Event.cs" />
|
||||
<Compile Include="Native\Explosion.cs" />
|
||||
<Compile Include="Native\Fire.cs" />
|
||||
<Compile Include="Native\Game.cs" />
|
||||
<Compile Include="Native\Marker.cs" />
|
||||
<Compile Include="Native\Object.cs" />
|
||||
<Compile Include="Native\Ped.cs" />
|
||||
<Compile Include="Native\Player.cs" />
|
||||
<Compile Include="Native\RadarArea.cs" />
|
||||
<Compile Include="Native\Resource.cs" />
|
||||
<Compile Include="Native\Server.cs" />
|
||||
<Compile Include="Native\Team.cs" />
|
||||
<Compile Include="Native\Vehicle.cs" />
|
||||
<Compile Include="Native\Water.cs" />
|
||||
<Compile Include="Ped.cs" />
|
||||
<Compile Include="Pickup.cs" />
|
||||
<Compile Include="Player.cs" />
|
||||
<Compile Include="PlayerACInfo.cs" />
|
||||
<Compile Include="PlayerModInfo.cs" />
|
||||
<Compile Include="Pools\IdentifiedPool.cs" />
|
||||
<Compile Include="Pools\Pool.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Resource.cs" />
|
||||
<Compile Include="Server.cs" />
|
||||
<Compile Include="ServerVersion.cs" />
|
||||
<Compile Include="Team.cs" />
|
||||
<Compile Include="Utils\Disposable.cs" />
|
||||
<Compile Include="Utils\IIdentifyable.cs" />
|
||||
<Compile Include="Vector2.cs" />
|
||||
<Compile Include="Vector3.cs" />
|
||||
<Compile Include="Vehicle.cs" />
|
||||
<Compile Include="VehicleColor.cs" />
|
||||
<Compile Include="VehicleWheelsState.cs" />
|
||||
<Compile Include="Weapon.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>pdb2mdb $(TargetPath)</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
8
MultiTheftAuto/Native/Account.cs
Normal file
8
MultiTheftAuto/Native/Account.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using System;
|
||||
|
||||
namespace MultiTheftAuto.Native
|
||||
{
|
||||
public class Account
|
||||
{
|
||||
}
|
||||
}
|
47
MultiTheftAuto/Native/Blip.cs
Normal file
47
MultiTheftAuto/Native/Blip.cs
Normal file
@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace MultiTheftAuto.Native
|
||||
{
|
||||
public class Blip
|
||||
{
|
||||
// Blip create/destroy functions
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 Create( Vector3 position, int icon = 0, int size = 2, Color color = null, int ordering = 0, float visibleDistance = 99999.0f, UInt32 visibleTo = 0 );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 CreateAttachedTo( UInt32 element, int icon = 0, int size = 2, Color color = null, int ordering = 0, float visibleDistance = 99999.0f, UInt32 visibleTo = 0 );
|
||||
|
||||
// Blip get functions
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetIcon( UInt32 blip );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetSize( UInt32 blip );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern Color GetColor( UInt32 blip );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetOrdering( UInt32 blip );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern float GetVisibleDistance( UInt32 blip );
|
||||
|
||||
// Blip set functions
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetIcon( UInt32 blip, int icon );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetSize( UInt32 blip, int size );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetColor( UInt32 blip, Color color );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetOrdering( UInt32 blip, int ordering );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetVisibleDistance( UInt32 blip, float distance );
|
||||
}
|
||||
}
|
26
MultiTheftAuto/Native/ColShape.cs
Normal file
26
MultiTheftAuto/Native/ColShape.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace MultiTheftAuto.Native
|
||||
{
|
||||
public class ColShape
|
||||
{
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 CreateCircle( float fX, float fY, float radius );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 CreateCuboid( float fX, float fY, float fZ, float fWidth, float fDepth, float fHeight );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 CreateSphere( float fX, float fY, float fZ, float fRadius );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 CreateRectangle( float fX, float fY, float fWidth, float fHeight );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 CreatePolygon( float fX, float fY, float fX1, float fY1, float fX2, float fY2, float fX3, float fY3, float[] args );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 CreateTube( float fX, float fY, float fZ, float fRadius, float fHeight );
|
||||
}
|
||||
}
|
188
MultiTheftAuto/Native/Element.cs
Normal file
188
MultiTheftAuto/Native/Element.cs
Normal file
@ -0,0 +1,188 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace MultiTheftAuto.Native
|
||||
{
|
||||
public static class Element
|
||||
{
|
||||
// Element create/destroy
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 Create( string type, string ID );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool Destroy( UInt32 userdata );
|
||||
|
||||
// Element get funcs
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 GetRootElement();
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool IsElement( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern string GetType( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern string GetID( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 Clone( UInt32 userdata, Vector3 position = null, bool cloneChildren = false );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32[] GetByType( string elementType, UInt32 startElement = 0 );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 GetByID( string elementID, int index = 0 );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 GetByIndex( string type, int index );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 GetChild( UInt32 parent, int index );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetChildrenCount( UInt32 parent );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern string GetData( UInt32 userdata, string key, bool inherit = true );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern Array GetAllData( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 GetParent( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern Vector3 GetPosition( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern Vector3 GetRotation( UInt32 userdata, string order = "default" );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern Vector3 GetVelocity( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetInterior( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool IsWithinColShape( UInt32 userdata, UInt32 colshape );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool IsWithinMarker( UInt32 userdata, UInt32 marker );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetDimension( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern string GetZoneName( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool IsAttached( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 GetAttachedTo( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 GetColShape( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetAlpha( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool IsDoubleSided( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern float GetHealth( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetModel( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool IsInWater( UInt32 userdata );
|
||||
|
||||
// [MethodImpl( MethodImplOptions.InternalCall )]
|
||||
// public static extern bool GetElementAttachedOffsets( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 GetSyncer( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool GetCollisionsEnabled( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool IsFrozen( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 GetLowLODElement( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool IsElementLowLOD( UInt32 userdata );
|
||||
|
||||
// Element set funcs
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool ClearElementVisibleTo( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetID( UInt32 userdata, string ID );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetData( UInt32 userdata, string key, string value, bool sync = true );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool RemoveData( UInt32 userdata, string key );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetParent( UInt32 userdata, UInt32 parent );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetPosition( UInt32 userdata, Vector3 position, bool warp = true );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetRotation( UInt32 userdata, Vector3 rotation, string order = "default", bool pedRotation = false );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetVelocity( UInt32 userdata, Vector3 velocity );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetVisibleTo( UInt32 userdata, UInt32 target, bool visible );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetInterior( UInt32 userdata, int interior, Vector3 position = null );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetDimension( UInt32 userdata, int dimension );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool Attach( UInt32 userdata, UInt32 target, Vector3 offsetPosition = null, Vector3 offsetRotation = null );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool Detach( UInt32 userdata, UInt32 target = 0 );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetAlpha( UInt32 userdata, int alpha );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetDoubleSided( UInt32 userdata, bool doubleSided );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetHealth( UInt32 userdata, float health );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetModel( UInt32 userdata, int model );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetAttachedOffsets( UInt32 userdata, Vector3 offsetPosition = null, Vector3 offsetRotation = null );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetSyncer( UInt32 userdata, UInt32 player );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetCollisionsEnabled( UInt32 userdata, bool enabled );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetFrozen( UInt32 userdata, bool frozen );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetLowLODElement( UInt32 userdata, UInt32 lowLod );
|
||||
}
|
||||
}
|
44
MultiTheftAuto/Native/Event.cs
Normal file
44
MultiTheftAuto/Native/Event.cs
Normal file
@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace MultiTheftAuto.Native
|
||||
{
|
||||
internal static class Event
|
||||
{
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool Add( string name, bool allowRemoteTrigger );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool AddHandler( string eventName, UInt32 attachedTo, Delegate handlerFunction, bool getPropagated = true, string priority = "normal" );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool RemoveHandler( string eventName, UInt32 attachedTo, Delegate handlerFunction );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool Trigger( string eventName, UInt32 baseElement, params object[] arguments );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool TriggerClient( UInt32 sendTo, string name, UInt32 sourceElement, params object[] arguments );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool Cancel( bool cancel = true, string reason = "" );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern string GetCancelReason();
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool WasCancelled();
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int TriggerLatentClient( UInt32 sendTo, string name, int bandwidth, bool persist, UInt32 theElement, params object[] arguments );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetLatentHandles( UInt32 player );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetLatentStatus( UInt32 player, int handle );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int CancelLatent( UInt32 player, int handle );
|
||||
}
|
||||
}
|
11
MultiTheftAuto/Native/Explosion.cs
Normal file
11
MultiTheftAuto/Native/Explosion.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace MultiTheftAuto.Native
|
||||
{
|
||||
public class Explosion
|
||||
{
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool Create( Vector3 position, int theType, UInt32 creator = 0 );
|
||||
}
|
||||
}
|
11
MultiTheftAuto/Native/Fire.cs
Normal file
11
MultiTheftAuto/Native/Fire.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace MultiTheftAuto.Native
|
||||
{
|
||||
public class Fire
|
||||
{
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool Create( Vector3 position, float size = 1.8f );
|
||||
}
|
||||
}
|
29
MultiTheftAuto/Native/Game.cs
Normal file
29
MultiTheftAuto/Native/Game.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace MultiTheftAuto.Native
|
||||
{
|
||||
public static class Game
|
||||
{
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static new extern string GetType();
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern string GetMapName();
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern string GetRuleValue( string sKey );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool RemoveRuleValue( string sKey );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetType( string sType );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetMapName( string sName );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetRuleValue( string sKey, string sValue );
|
||||
}
|
||||
}
|
47
MultiTheftAuto/Native/Marker.cs
Normal file
47
MultiTheftAuto/Native/Marker.cs
Normal file
@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace MultiTheftAuto.Native
|
||||
{
|
||||
public class Marker
|
||||
{
|
||||
// Marker create/destroy functions
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 Create( Vector3 position, string type = "checkpoint", float size = 4.0f, Color color = null, UInt32 visibleTo = 0 );
|
||||
|
||||
// Marker get functions
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetCount();
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern string GetType( UInt32 marker );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern float GetSize( UInt32 marker );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern Color GetColor( UInt32 marker );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern Vector3 GetTarget( UInt32 marker );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern string GetIcon( UInt32 marker );
|
||||
|
||||
// Marker set functions
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetType( UInt32 marker, string type );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetSize( UInt32 marker, float size );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetColor( UInt32 marker, Color color );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetTarget( UInt32 marker, Vector3 position );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetIcon( UInt32 marker, string icon );
|
||||
}
|
||||
}
|
26
MultiTheftAuto/Native/Object.cs
Normal file
26
MultiTheftAuto/Native/Object.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace MultiTheftAuto.Native
|
||||
{
|
||||
public class Object
|
||||
{
|
||||
// Object create/destroy functions
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 Create( int modelid, Vector3 position, Vector3 rotation, bool isLowLOD = false );
|
||||
|
||||
// Object get functions
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern float GetScale( UInt32 Object );
|
||||
|
||||
// Object set functions
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetScale( UInt32 Object, float scale );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool Move( UInt32 Object, int time, Vector3 target, Vector3 rotation, string easingType, float easingPeriod, float easingAmplitude, float easingOvershoot );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool Stop( UInt32 Object );
|
||||
}
|
||||
}
|
148
MultiTheftAuto/Native/Ped.cs
Normal file
148
MultiTheftAuto/Native/Ped.cs
Normal file
@ -0,0 +1,148 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace MultiTheftAuto.Native
|
||||
{
|
||||
public class Ped
|
||||
{
|
||||
// Ped get functions
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 Create( int modelid, Vector3 position, float rot = 0.0f, bool synced = true );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern float GetArmor( UInt32 ped );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool IsChoking( UInt32 ped );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool IsDead( UInt32 ped );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool IsDucked( UInt32 ped );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern float GetStat( UInt32 ped, int stat );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 GetTarget( UInt32 ped );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetWeapon( UInt32 ped, int slot = 0 );
|
||||
|
||||
// [MethodImpl( MethodImplOptions.InternalCall )]
|
||||
// public static extern string string GetPedClothes( UInt32 ped, int clothesType );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool DoesHaveJetPack( UInt32 ped );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool IsOnGround( UInt32 ped );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetFightingStyle( UInt32 ped );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetPedMoveAnim( UInt32 ped );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern float GetGravity( UInt32 ped );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 GetContactElement( UInt32 ped );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetWeaponSlot( UInt32 ped );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool IsDoingGangDriveby( UInt32 ped );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool IsOnFire( UInt32 ped );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool IsHeadless( UInt32 ped );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 GetOccupiedVehicle( UInt32 ped );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetOccupiedVehicleSeat( UInt32 ped );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool IsInVehicle( UInt32 ped );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetWeaponProperty( int weaponID, string weaponSkill, string property );
|
||||
// public static extern int GetWeaponProperty( string weaponName, string weaponSkill, string property );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetOriginalWeaponProperty( int weaponID, string weaponSkill, string property );
|
||||
// public static extern int GetOriginalWeaponProperty( string weaponName, string weaponSkill, string property );
|
||||
|
||||
// Player set functions
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetArmor( UInt32 ped, int armor );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool Kill( UInt32 ped, UInt32 theKiller = 0, int weapon = 255, int bodyPart = 255, bool stealth = false );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetStat( UInt32 ped, int stat, float value );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool AddClothes( UInt32 ped, string clothesTexture, string clothesModel, int clothesType );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool RemoveClothes( UInt32 ped, int clothesType, string clothesTexture, string clothesModel );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool GiveJetPack( UInt32 ped );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool RemoveJetPack( UInt32 ped );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetFightingStyle( UInt32 ped, int style );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetPedMoveAnim( UInt32 ped, int anim );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetGravity( UInt32 ped, float gravity );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetChoking( UInt32 ped, bool choking );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool WarpIntoVehicle( UInt32 ped, UInt32 vehicle, int seat = 0 );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool RemoveFromVehicle( UInt32 ped );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetDoingGangDriveby( UInt32 ped, bool state );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetAnimation( UInt32 ped, string block = null, string anim = null, int time = -1, bool loop = true, bool updatePosition = true, bool interruptable = true, bool freezeLastFrame = true );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetAnimationProgress( UInt32 ped, string anim, float progress );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetWeaponSlot( UInt32 ped, int weaponSlot );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetOnFire( UInt32 ped, bool isOnFire );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetHeadless( UInt32 ped, bool headState );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool ReloadWeapon( UInt32 ped );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetWeaponProperty( int weaponID, string weaponSkill, string property, float theValue );
|
||||
// public static extern bool SetWeaponProperty( string weaponName, string weaponSkill, string property, float theValue );
|
||||
}
|
||||
}
|
166
MultiTheftAuto/Native/Player.cs
Normal file
166
MultiTheftAuto/Native/Player.cs
Normal file
@ -0,0 +1,166 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace MultiTheftAuto.Native
|
||||
{
|
||||
internal class Player : Ped
|
||||
{
|
||||
// Player get functions
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetCount();
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern Array GetAlivePlayers();
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern Array GetDeadPlayers();
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetAmmoInClip( UInt32 ped, int weaponSlot = 0 );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetTotalAmmo( UInt32 ped, int weaponSlot = 0 );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetWeaponAmmo( UInt32 player, int weapon, int totalAmmo, int ammoInClip = 0 );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 GetFromName( string name );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetMoney( UInt32 player );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetPing( UInt32 player );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 GetRandom();
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool IsMuted( UInt32 player );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 GetTeam( UInt32 player );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetWantedLevel( UInt32 player );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetIdleTime( UInt32 player );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool IsMapForced( UInt32 player );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern string GetNametagText( UInt32 player );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern Color GetNametagColor( UInt32 player );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool IsNametagShowing( UInt32 player );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern string GetSerial( UInt32 player );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern string GetUserName( UInt32 player );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetBlurLevel( UInt32 player );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern string GetName( UInt32 player );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern string GetIP( UInt32 player );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 GetAccount( UInt32 player );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern string GetVersion( UInt32 player );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern Object GetACInfo( UInt32 player );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern string SetPlayerAnnounceValue( UInt32 element, string key, string value );
|
||||
|
||||
// Player set functions
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetMoney( UInt32 player, int money );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool GiveMoney( UInt32 player, int money );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool TakeMoney( UInt32 player, int money );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool Spawn( UInt32 player, Vector3 position, int rotation = 0, int skinID = 0, int interior = 0, int dimension = 0, UInt32 theTeam = 0 );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool ShowHudComponent( UInt32 player, string component, bool show );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetWantedLevel( UInt32 player, int level );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool ForceMap( UInt32 player, bool forcedOn );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetNametagText( UInt32 player, string text );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetNametagColor( UInt32 player, Color color );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetNametagShowing( UInt32 player, bool showed );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetMuted( UInt32 player, bool muted );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetBlurLevel( UInt32 player, int level );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool Redirect( UInt32 player, string serverIP, int serverPort, string serverPassword = null );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetName( UInt32 player, string name );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool DetonateSatchels( UInt32 player );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool TakeScreenShot( UInt32 player, int width, int height, string tag = "", int quality = 30, int maxBandwith = 5000 );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetTeam( UInt32 player, UInt32 team );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern string GetPlayerAnnounceValue( UInt32 element, string key );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern CameraMatrix GetCameraMatrix( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 GetCameraTarget( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt16 GetCameraInterior( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetCameraMatrix( UInt32 userdata, CameraMatrix pCameraMatrix );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetCameraTarget( UInt32 userdata, UInt32 pTarget );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetCameraInterior( UInt32 userdata, UInt16 ucInterior );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool FadeCamera( UInt32 userdata, bool bFadeIn, float fFadeTime, Color pColor );
|
||||
}
|
||||
}
|
35
MultiTheftAuto/Native/RadarArea.cs
Normal file
35
MultiTheftAuto/Native/RadarArea.cs
Normal file
@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace MultiTheftAuto.Native
|
||||
{
|
||||
public class RadarArea
|
||||
{
|
||||
// Radar area create/destroy funcs
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 Create( float leftX, float bottomY, float sizeX, float sizeY, Color color = null, UInt32 visibleTo = 0 );
|
||||
|
||||
// Radar area get funcs
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern Vector3 GetSize( UInt32 radarArea );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern Color GetColor( UInt32 radarArea );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool IsFlashing( UInt32 radarArea );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool IsInside( UInt32 radarArea, float leftX, float bottomY );
|
||||
|
||||
// Radar area set funcs
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetSize( UInt32 radarArea, float sizeX, float sizeY );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetColor( UInt32 radarArea, Color color );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetFlashing( UInt32 radarArea, bool enabled );
|
||||
}
|
||||
}
|
83
MultiTheftAuto/Native/Resource.cs
Normal file
83
MultiTheftAuto/Native/Resource.cs
Normal file
@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace MultiTheftAuto.Native
|
||||
{
|
||||
public class Resource
|
||||
{
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 Create( string resourceName, string organizationalDir );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 Copy( UInt32 resource, string newResourceName, string organizationalDir );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 GetRootElement( UInt32 resource = 0 );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 GetMapRootElement( UInt32 resource, string map );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 GetDynamicElementRoot( UInt32 resource );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool RemoveFile( UInt32 resource, string filename );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 GetFromName( string resourceName );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern string GetInfo( UInt32 resource, string attribute );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern uint GetLastStartTime( UInt32 resource );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern string GetLoadFailureReason( UInt32 resource );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern uint GetLoadTime( UInt32 resource );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern string GetName( UInt32 resource );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32[] GetResources();
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern string GetState( UInt32 resource );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 GetCurrent();
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool Refresh( bool refreshAll = false );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool RemoveDefaultSetting( UInt32 resource, string settingName );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool Start( UInt32 resource, bool persistent = false, bool startIncludedResources = true, bool loadServerConfigs = true, bool loadMaps = true, bool loadServerScripts = true, bool loadHTML = true, bool loadClientConfigs = true, bool loadClientScripts = true, bool loadFiles = true );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool Restart( UInt32 resource );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool Stop( UInt32 resource );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetDefaultSetting( UInt32 resource, string settingName, string settingValue );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetInfo( UInt32 resource, string attribute, string value );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool Rename( string resourceName, string newResourceName, string organizationalPath );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool Delete( string resourceName );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool UpdateACLRequest( UInt32 resource, string rightName, bool bAccess, string byWho );
|
||||
}
|
||||
}
|
30
MultiTheftAuto/Native/Server.cs
Normal file
30
MultiTheftAuto/Native/Server.cs
Normal file
@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.Native
|
||||
{
|
||||
internal class Server
|
||||
{
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern uint GetMaxPlayers();
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetMaxPlayers( uint maxPlayers );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool OutputChatBox( string text, UInt32 element, Color color, bool colorCoded );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool OutputConsole( string text, UInt32 element );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetPassword( string password, bool bSave );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern ServerVersion GetVersion();
|
||||
}
|
||||
}
|
40
MultiTheftAuto/Native/Team.cs
Normal file
40
MultiTheftAuto/Native/Team.cs
Normal file
@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace MultiTheftAuto.Native
|
||||
{
|
||||
public class Team
|
||||
{
|
||||
// Team get funcs
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 Create( string name, Color color = null );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 GetFromName( string name );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern string GetName( UInt32 team );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern Color GetColor( UInt32 team );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool GetFriendlyFire( UInt32 team );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32[] GetPlayers( UInt32 team );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int CountPlayers( UInt32 team );
|
||||
|
||||
// Team set funcs
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetName( UInt32 team, string name );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetColor( UInt32 team, Color color );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetFriendlyFire( UInt32 team, bool enabled );
|
||||
}
|
||||
}
|
274
MultiTheftAuto/Native/Vehicle.cs
Normal file
274
MultiTheftAuto/Native/Vehicle.cs
Normal file
@ -0,0 +1,274 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace MultiTheftAuto.Native
|
||||
{
|
||||
internal class Vehicle
|
||||
{
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 Create( int model, Vector3 position, Vector3 rotation, string numberplate = null, bool direction = false, int variant1 = 255, int variant2 = 255 );
|
||||
|
||||
#region Vehicle get functions
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern string GetType( UInt32 vehicle );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern Array GetVariant( UInt32 vehicle );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern Color GetColor( UInt32 vehicle, int colorIndex );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetModelFromName( string name );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool GetLandingGearDown( UInt32 vehicle );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetMaxPassengers( UInt32 vehicle );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern string GetName( UInt32 vehicle );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern string GetNameFromModel( int modelID );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern Player GetOccupant( UInt32 vehicle, int seat = 0 );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern Array GetOccupants( UInt32 vehicle );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern Player GetController( UInt32 vehicle );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool GetSirensOn( UInt32 vehicle );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern Vector3 GetTurnVelocity( UInt32 vehicle );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern Vector3 GetTurretPosition( UInt32 vehicle );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool IsLocked( UInt32 vehicle );
|
||||
|
||||
// [MethodImpl( MethodImplOptions.InternalCall )]
|
||||
// public static int GetVehiclesOfType( lua_State* luaVM );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetUpgradeOnSlot( UInt32 vehicle, int slot );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern Array GetUpgrades( UInt32 vehicle );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern string GetUpgradeSlotName( int upgradeOrSlot );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern Array GetCompatibleUpgrades( UInt32 vehicle, int slot = 0 );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetDoorState( UInt32 vehicle, int door );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern Array GetWheelStates( UInt32 vehicle );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetLightState( UInt32 vehicle, int light );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetPanelState( UInt32 vehicle, int panel );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetOverrideLights( UInt32 vehicle );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 GetTowedByVehicle( UInt32 vehicle );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 GetTowingVehicle( UInt32 vehicle );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern int GetPaintjob( UInt32 vehicle );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern string GetPlateText( UInt32 vehicle );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool IsDamageProof( UInt32 vehicle );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool IsFuelTankExplodable( UInt32 vehicle );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool IsOnGround( UInt32 vehicle );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool GetEngineState( UInt32 vehicle );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool IsTrainDerailed( UInt32 vehicle );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool IsTrainDerailable( UInt32 vehicle );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool GetTrainDirection( UInt32 vehicle );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern float GetTrainSpeed( UInt32 vehicle );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool IsBlown( UInt32 vehicle );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern Color GetHeadLightColor( UInt32 vehicle );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern float GetVehicleDoorOpenRatio( UInt32 vehicle, int door );
|
||||
#endregion
|
||||
|
||||
#region Vehicle set functions
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool Fix( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool Blow( UInt32 userdata, bool explode );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetTurnVelocity( UInt32 userdata, Vector3 velocity );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetColor( UInt32 userdata, Color color1, Color color2, Color color3, Color color4 );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetLandingGearDown( UInt32 userdata, bool state );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetLocked( UInt32 userdata, bool state );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetModel( UInt32 userdata, int model );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetDoorsUndamageable( UInt32 userdata, bool state );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetSirensOn( UInt32 userdata, bool state );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetTaxiLightOn( UInt32 userdata, bool state );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool IsTaxiLightOn( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool AddUpgrade( UInt32 userdata, int upgrade );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool RemoveUpgrade( UInt32 userdata, int upgrade );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetDoorState( UInt32 userdata, int door, int state );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetWheelStates( UInt32 userdata, int frontLeft, int rearLeft = -1, int frontRight = -1, int rearRight = -1 );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetLightState( UInt32 userdata, int light, int state );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetPanelState( UInt32 userdata, int panelID, int state );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetIdleRespawnDelay( UInt32 userdata, int timeDelay );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetRespawnDelay( UInt32 userdata, int timeDelay );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetRespawnPosition( UInt32 userdata, Vector3 position, Vector3 rotation );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool ToggleRespawn( UInt32 userdata, bool respawn );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool ResetExplosionTime( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool ResetIdleTime( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool Spawn( UInt32 userdata, Vector3 position, Vector3 rotation );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool Respawn( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetOverrideLights( UInt32 userdata, int state );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool AttachTrailerToVehicle( UInt32 userdata, UInt32 trailer );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool DetachTrailerFromVehicle( UInt32 userdata, UInt32 trailer = 0 );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetEngineState( UInt32 userdata, bool state );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetDamageProof( UInt32 userdata, bool state );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetPaintjob( UInt32 userdata, int value );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetFuelTankExplodable( UInt32 userdata, bool state );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetTrainDerailed( UInt32 userdata, bool state );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetTrainDerailable( UInt32 userdata, bool state );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetTrainDirection( UInt32 userdata, bool state );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetTrainSpeed( UInt32 userdata, float speed );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetHeadLightColor( UInt32 userdata, Color color );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetTurretPosition( UInt32 userdata, float x, float y );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetDoorOpenRatio( UInt32 userdata, int door, float ratio, int time = 0 );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetVariant( UInt32 userdata, int variant1 = 255, int variant2 = 255 );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool AddSirens( UInt32 userdata, int sirenCount, int sirenType, bool flag360 = false, bool checkLos = true, bool useRandomiser = true, bool silent = false );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool RemoveSirens( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetSirens( UInt32 userdata, int sirenPoint, Vector3 position, Color color = null, float minAlpha = 0.0f );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern Array GetSirens( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern Object GetSirenParams( UInt32 userdata );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetPlateText( UInt32 userdata, string numberplate );
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
35
MultiTheftAuto/Native/Water.cs
Normal file
35
MultiTheftAuto/Native/Water.cs
Normal file
@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace MultiTheftAuto.Native
|
||||
{
|
||||
public class Water
|
||||
{
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern UInt32 Create( Vector3 position1, Vector3 position2, Vector3 position3, Vector3 position4 = null, bool bShallow = false );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetLevel( float level, bool includeWaterFeatures = true, bool includeWaterElements = true );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetLevel( UInt32 water, float level );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool ResetLevel();
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern Vector3 GetVertexPosition( UInt32 water, int vertex );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetVertexPosition( UInt32 water, Vector3 position );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern Color GetColor( UInt32 water );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool SetColor( UInt32 water, Color color );
|
||||
|
||||
[MethodImpl( MethodImplOptions.InternalCall )]
|
||||
public static extern bool ResetColor();
|
||||
}
|
||||
}
|
258
MultiTheftAuto/Ped.cs
Normal file
258
MultiTheftAuto/Ped.cs
Normal file
@ -0,0 +1,258 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace MultiTheftAuto
|
||||
{
|
||||
public class Ped : Element
|
||||
{
|
||||
#region Properties
|
||||
|
||||
public Vehicle Vehicle
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetVehicle();
|
||||
}
|
||||
set
|
||||
{
|
||||
this.WarpIntoVehicle( value, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public Ped( UInt32 userdata )
|
||||
: base( userdata )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Ped( int modelid, Vector3 position, float rot = 0.0f, bool synced = true )
|
||||
: base( Native.Ped.Create( modelid, position, rot, synced ) )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
#region Set
|
||||
|
||||
public bool SetArmor( int armor )
|
||||
{
|
||||
return Native.Ped.SetArmor( this.GetUserData(), armor );
|
||||
}
|
||||
|
||||
public bool Kill( Ped killer = null, int weapon = 255, int bodyPart = 255, bool stealth = false )
|
||||
{
|
||||
return Native.Ped.Kill( this.GetUserData(), killer != null ? killer.GetUserData() : 0, weapon, bodyPart, stealth );
|
||||
}
|
||||
|
||||
public bool SetStat( int stat, float value )
|
||||
{
|
||||
return Native.Ped.SetStat( this.GetUserData(), stat, value );
|
||||
}
|
||||
|
||||
public bool AddClothes( string clothesTexture, string clothesModel, int clothesType )
|
||||
{
|
||||
return Native.Ped.AddClothes( this.GetUserData(), clothesTexture, clothesModel, clothesType );
|
||||
}
|
||||
|
||||
public bool RemoveClothes( int clothesType, string clothesTexture, string clothesModel )
|
||||
{
|
||||
return Native.Ped.RemoveClothes( this.GetUserData(), clothesType, clothesTexture, clothesModel );
|
||||
}
|
||||
|
||||
public bool GiveJetPack()
|
||||
{
|
||||
return Native.Ped.GiveJetPack( this.GetUserData() );
|
||||
}
|
||||
|
||||
public bool RemoveJetPack()
|
||||
{
|
||||
return Native.Ped.RemoveJetPack( this.GetUserData() );
|
||||
}
|
||||
|
||||
public bool SetFightingStyle( int style )
|
||||
{
|
||||
return Native.Ped.SetFightingStyle( this.GetUserData(), style );
|
||||
}
|
||||
|
||||
public bool SetPedMoveAnim( int style )
|
||||
{
|
||||
return Native.Ped.SetPedMoveAnim( this.GetUserData(), style );
|
||||
}
|
||||
|
||||
public bool SetGravity( float gravity )
|
||||
{
|
||||
return Native.Ped.SetGravity( this.GetUserData(), gravity );
|
||||
}
|
||||
|
||||
public bool SetChoking( bool choking )
|
||||
{
|
||||
return Native.Ped.SetChoking( this.GetUserData(), choking );
|
||||
}
|
||||
|
||||
public bool WarpIntoVehicle( Vehicle vehicle, int seat = 0 )
|
||||
{
|
||||
return Native.Ped.WarpIntoVehicle( this.GetUserData(), vehicle.GetUserData(), seat );
|
||||
}
|
||||
|
||||
public bool RemoveFromVehicle()
|
||||
{
|
||||
return Native.Ped.RemoveFromVehicle( this.GetUserData() );
|
||||
}
|
||||
|
||||
public bool SetDoingGangDriveby( bool state )
|
||||
{
|
||||
return Native.Ped.SetDoingGangDriveby( this.GetUserData(), state );
|
||||
}
|
||||
|
||||
public bool SetAnimation( string block = null, string anim = null, int time = -1, bool loop = true, bool updatePosition = true, bool interruptable = true, bool freezeLastFrame = true )
|
||||
{
|
||||
return Native.Ped.SetAnimation( this.GetUserData(), block, anim, time, loop, updatePosition, interruptable, freezeLastFrame );
|
||||
}
|
||||
|
||||
public bool SetAnimationProgress( string anim, float progress )
|
||||
{
|
||||
return Native.Ped.SetAnimationProgress( this.GetUserData(), anim, progress );
|
||||
}
|
||||
|
||||
public bool SetWeaponSlot( int weaponSlot )
|
||||
{
|
||||
return Native.Ped.SetWeaponSlot( this.GetUserData(), weaponSlot );
|
||||
}
|
||||
|
||||
public bool SetOnFire( bool isOnFire )
|
||||
{
|
||||
return Native.Ped.SetOnFire( this.GetUserData(), isOnFire );
|
||||
}
|
||||
|
||||
public bool SetHeadless( bool headless )
|
||||
{
|
||||
return Native.Ped.SetHeadless( this.GetUserData(), headless );
|
||||
}
|
||||
|
||||
public bool ReloadWeapon()
|
||||
{
|
||||
return Native.Ped.ReloadWeapon( this.GetUserData() );
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Get
|
||||
|
||||
public float GetArmor()
|
||||
{
|
||||
return Native.Ped.GetArmor( this.GetUserData() );
|
||||
}
|
||||
|
||||
public float GetStat( int stat )
|
||||
{
|
||||
return Native.Ped.GetStat( this.GetUserData(), stat );
|
||||
}
|
||||
|
||||
public Object GetTarget()
|
||||
{
|
||||
return Element.FindOrCreate( Native.Ped.GetTarget( this.GetUserData() ) );
|
||||
}
|
||||
|
||||
public int GetWeapon( int slot = 0 )
|
||||
{
|
||||
return Native.Ped.GetWeapon( this.GetUserData(), slot );
|
||||
}
|
||||
|
||||
public int GetFightingStyle()
|
||||
{
|
||||
return Native.Ped.GetFightingStyle( this.GetUserData() );
|
||||
}
|
||||
|
||||
public int GetPedMoveAnim()
|
||||
{
|
||||
return Native.Ped.GetPedMoveAnim( this.GetUserData() );
|
||||
}
|
||||
|
||||
public float GetGravity()
|
||||
{
|
||||
return Native.Ped.GetGravity( this.GetUserData() );
|
||||
}
|
||||
|
||||
public Object GetContactElement()
|
||||
{
|
||||
return Element.FindOrCreate( Native.Ped.GetContactElement( this.GetUserData() ) );
|
||||
}
|
||||
|
||||
public int GetWeaponSlot()
|
||||
{
|
||||
return Native.Ped.GetWeaponSlot( this.GetUserData() );
|
||||
}
|
||||
|
||||
public Vehicle GetVehicle()
|
||||
{
|
||||
return Element.FindOrCreate( Native.Ped.GetOccupiedVehicle( this.GetUserData() ) ) as Vehicle;
|
||||
}
|
||||
|
||||
public int GetVehicleSeat()
|
||||
{
|
||||
return Native.Ped.GetOccupiedVehicleSeat( this.GetUserData() );
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Is
|
||||
|
||||
public bool IsChoking()
|
||||
{
|
||||
return Native.Ped.IsChoking( this.GetUserData() );
|
||||
}
|
||||
|
||||
public bool IsDead()
|
||||
{
|
||||
return Native.Ped.IsDead( this.GetUserData() );
|
||||
}
|
||||
|
||||
public bool IsDucked()
|
||||
{
|
||||
return Native.Ped.IsDucked( this.GetUserData() );
|
||||
}
|
||||
|
||||
public bool IsHaveJetPack()
|
||||
{
|
||||
return Native.Ped.DoesHaveJetPack( this.GetUserData() );
|
||||
}
|
||||
|
||||
public bool IsOnGround()
|
||||
{
|
||||
return Native.Ped.IsOnGround( this.GetUserData() );
|
||||
}
|
||||
|
||||
public bool IsDoingGangDriveby()
|
||||
{
|
||||
return Native.Ped.IsDoingGangDriveby( this.GetUserData() );
|
||||
}
|
||||
|
||||
public bool IsOnFire()
|
||||
{
|
||||
return Native.Ped.IsOnFire( this.GetUserData() );
|
||||
}
|
||||
|
||||
public bool IsHeadless()
|
||||
{
|
||||
return Native.Ped.IsHeadless( this.GetUserData() );
|
||||
}
|
||||
|
||||
public bool IsInVehicle()
|
||||
{
|
||||
return Native.Ped.IsInVehicle( this.GetUserData() );
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
16
MultiTheftAuto/Pickup.cs
Normal file
16
MultiTheftAuto/Pickup.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto
|
||||
{
|
||||
public class Pickup : Element
|
||||
{
|
||||
public Pickup( UInt32 userdata )
|
||||
: base( userdata )
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
290
MultiTheftAuto/Player.cs
Normal file
290
MultiTheftAuto/Player.cs
Normal file
@ -0,0 +1,290 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace MultiTheftAuto
|
||||
{
|
||||
public class Player : Ped
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
public Player( UInt32 userdata )
|
||||
: base( userdata )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
#region Set
|
||||
|
||||
public bool SetMoney( int money )
|
||||
{
|
||||
return Native.Player.SetMoney( this.GetUserData(), money );
|
||||
}
|
||||
|
||||
public bool GiveMoney( int money )
|
||||
{
|
||||
return Native.Player.GiveMoney( this.GetUserData(), money );
|
||||
}
|
||||
|
||||
public bool TakeMoney( int money )
|
||||
{
|
||||
return Native.Player.TakeMoney( this.GetUserData(), money );
|
||||
}
|
||||
|
||||
public bool Spawn( Vector3 position, int rotation = 0, int skinID = 0, int interior = 0, int dimension = 0, Team team = null )
|
||||
{
|
||||
return Native.Player.Spawn( this.GetUserData(), position, rotation, skinID, interior, dimension, team != null ? team.GetUserData() : 0 );
|
||||
}
|
||||
|
||||
public bool ShowHudComponent( string component, bool show )
|
||||
{
|
||||
return Native.Player.ShowHudComponent( this.GetUserData(), component, show );
|
||||
}
|
||||
|
||||
public bool SetWantedLevel( int level )
|
||||
{
|
||||
return Native.Player.SetWantedLevel( this.GetUserData(), level );
|
||||
}
|
||||
|
||||
public bool ForceMap( bool forcedOn )
|
||||
{
|
||||
return Native.Player.ForceMap( this.GetUserData(), forcedOn );
|
||||
}
|
||||
|
||||
public bool SetNametagText( string text )
|
||||
{
|
||||
return Native.Player.SetNametagText( this.GetUserData(), text );
|
||||
}
|
||||
|
||||
public bool SetNametagColor( Color color )
|
||||
{
|
||||
return Native.Player.SetNametagColor( this.GetUserData(), color );
|
||||
}
|
||||
|
||||
public bool SetNametagShowing( bool showed )
|
||||
{
|
||||
return Native.Player.SetNametagShowing( this.GetUserData(), showed );
|
||||
}
|
||||
|
||||
public bool SetMuted( bool muted )
|
||||
{
|
||||
return Native.Player.SetMuted( this.GetUserData(), muted );
|
||||
}
|
||||
|
||||
public bool SetBlurLevel( int level )
|
||||
{
|
||||
return Native.Player.SetBlurLevel( this.GetUserData(), level );
|
||||
}
|
||||
|
||||
public bool Redirect( string serverIP, int serverPort, string serverPassword = null )
|
||||
{
|
||||
return Native.Player.Redirect( this.GetUserData(), serverIP, serverPort, serverPassword );
|
||||
}
|
||||
|
||||
public bool SetName( string name )
|
||||
{
|
||||
return Native.Player.SetName( this.GetUserData(), name );
|
||||
}
|
||||
|
||||
public bool DetonateSatchels()
|
||||
{
|
||||
return Native.Player.DetonateSatchels( this.GetUserData() );
|
||||
}
|
||||
|
||||
public bool TakeScreenShot( int width, int height, string tag = "", int quality = 30, int maxBandwith = 5000 )
|
||||
{
|
||||
return Native.Player.TakeScreenShot( this.GetUserData(), width, height, tag, quality, maxBandwith );
|
||||
}
|
||||
|
||||
public bool SetTeam( Team team )
|
||||
{
|
||||
return Native.Player.SetTeam( this.GetUserData(), team.GetUserData() );
|
||||
}
|
||||
|
||||
public bool SetCameraMatrix( CameraMatrix pCameraMatrix )
|
||||
{
|
||||
return Native.Player.SetCameraMatrix( this.userdata, pCameraMatrix );
|
||||
}
|
||||
|
||||
public bool SetCameraTarget( Element pTarget )
|
||||
{
|
||||
return Native.Player.SetCameraTarget( this.userdata, pTarget.userdata );
|
||||
}
|
||||
|
||||
public bool SetCameraInterior( UInt16 ucInterior )
|
||||
{
|
||||
return Native.Player.SetCameraInterior( this.userdata, ucInterior );
|
||||
}
|
||||
|
||||
public bool FadeCamera( bool bFadeIn, float fFadeTime, Color pColor )
|
||||
{
|
||||
return Native.Player.FadeCamera( this.userdata, bFadeIn, fFadeTime, pColor );
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Get
|
||||
|
||||
public int GetAmmoInClip( int weaponSlot = 0 )
|
||||
{
|
||||
return Native.Player.GetAmmoInClip( this.GetUserData(), weaponSlot );
|
||||
}
|
||||
|
||||
public int GetTotalAmmo( int weaponSlot = 0 )
|
||||
{
|
||||
return Native.Player.GetTotalAmmo( this.GetUserData(), weaponSlot );
|
||||
}
|
||||
|
||||
public bool SetWeaponAmmo( int weapon, int totalAmmo, int ammoInClip )
|
||||
{
|
||||
return Native.Player.SetWeaponAmmo( this.GetUserData(), weapon, totalAmmo, ammoInClip );
|
||||
}
|
||||
|
||||
public Player GetFromName( string name )
|
||||
{
|
||||
return Element.FindOrCreate( Native.Player.GetFromName( name ) ) as Player;
|
||||
}
|
||||
|
||||
public int GetMoney()
|
||||
{
|
||||
return Native.Player.GetMoney( this.GetUserData() );
|
||||
}
|
||||
|
||||
public int GetPing()
|
||||
{
|
||||
return Native.Player.GetPing( this.GetUserData() );
|
||||
}
|
||||
|
||||
public Player GetRandom()
|
||||
{
|
||||
return Element.FindOrCreate( Native.Player.GetRandom() ) as Player;
|
||||
}
|
||||
|
||||
public Team GetTeam()
|
||||
{
|
||||
return Element.FindOrCreate( Native.Player.GetTeam( this.GetUserData() ) ) as Team;
|
||||
}
|
||||
|
||||
public int GetWantedLevel()
|
||||
{
|
||||
return Native.Player.GetWantedLevel( this.GetUserData() );
|
||||
}
|
||||
|
||||
public int GetIdleTime()
|
||||
{
|
||||
return Native.Player.GetIdleTime( this.GetUserData() );
|
||||
}
|
||||
|
||||
public string GetNametagText()
|
||||
{
|
||||
return Native.Player.GetNametagText( this.GetUserData() );
|
||||
}
|
||||
|
||||
public Color GetNametagColor()
|
||||
{
|
||||
return Native.Player.GetNametagColor( this.GetUserData() );
|
||||
}
|
||||
|
||||
public string GetSerial()
|
||||
{
|
||||
return Native.Player.GetSerial( this.GetUserData() );
|
||||
}
|
||||
|
||||
public string GetUserName()
|
||||
{
|
||||
return Native.Player.GetUserName( this.GetUserData() );
|
||||
}
|
||||
|
||||
public int GetBlurLevel()
|
||||
{
|
||||
return Native.Player.GetBlurLevel( this.GetUserData() );
|
||||
}
|
||||
|
||||
public string GetName()
|
||||
{
|
||||
return Native.Player.GetName( this.GetUserData() );
|
||||
}
|
||||
|
||||
public string GetIP()
|
||||
{
|
||||
return Native.Player.GetIP( this.GetUserData() );
|
||||
}
|
||||
|
||||
public Account GetAccount()
|
||||
{
|
||||
return Element.FindOrCreate( Native.Player.GetAccount( this.GetUserData() ) ) as Account;
|
||||
}
|
||||
|
||||
public string GetVersion()
|
||||
{
|
||||
return Native.Player.GetVersion( this.GetUserData() );
|
||||
}
|
||||
|
||||
public Object GetACInfo()
|
||||
{
|
||||
return Native.Player.GetACInfo( this.GetUserData() );
|
||||
}
|
||||
|
||||
public CameraMatrix GetCameraMatrix()
|
||||
{
|
||||
return Native.Player.GetCameraMatrix( this.userdata );
|
||||
}
|
||||
|
||||
public UInt32 GetCameraTarget()
|
||||
{
|
||||
return Native.Player.GetCameraTarget( this.userdata );
|
||||
}
|
||||
|
||||
public UInt16 GetCameraInterior()
|
||||
{
|
||||
return Native.Player.GetCameraInterior( this.userdata );
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Is
|
||||
|
||||
public bool IsMuted()
|
||||
{
|
||||
return Native.Player.IsMuted( this.GetUserData() );
|
||||
}
|
||||
|
||||
public bool IsMapForced()
|
||||
{
|
||||
return Native.Player.IsMapForced( this.GetUserData() );
|
||||
}
|
||||
|
||||
public bool IsNametagShowing()
|
||||
{
|
||||
return Native.Player.IsNametagShowing( this.GetUserData() );
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region Static
|
||||
|
||||
public static Array GetAlivePlayers()
|
||||
{
|
||||
return Native.Player.GetAlivePlayers();
|
||||
}
|
||||
|
||||
public static Array GetDeadPlayers()
|
||||
{
|
||||
return Native.Player.GetDeadPlayers();
|
||||
}
|
||||
|
||||
public static int GetCount()
|
||||
{
|
||||
return Native.Player.GetCount();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
24
MultiTheftAuto/PlayerACInfo.cs
Normal file
24
MultiTheftAuto/PlayerACInfo.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto
|
||||
{
|
||||
public class PlayerACInfo
|
||||
{
|
||||
public string DetectedAC;
|
||||
public string d3d9MD5;
|
||||
public string d3d9SHA256;
|
||||
public uint d3d9Size;
|
||||
|
||||
public PlayerACInfo( string detectedAC, uint D3D9Size, string D3D9MD5, string D3D9SHA256 )
|
||||
{
|
||||
this.DetectedAC = detectedAC;
|
||||
this.d3d9MD5 = D3D9MD5;
|
||||
this.d3d9SHA256 = D3D9SHA256;
|
||||
this.d3d9Size = D3D9Size;
|
||||
}
|
||||
}
|
||||
}
|
75
MultiTheftAuto/PlayerModInfo.cs
Normal file
75
MultiTheftAuto/PlayerModInfo.cs
Normal file
@ -0,0 +1,75 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto
|
||||
{
|
||||
public class PlayerModInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// GTA model or texture id
|
||||
/// </summary>
|
||||
public int ID;
|
||||
|
||||
/// <summary>
|
||||
/// GTA name
|
||||
/// </summary>
|
||||
public string Name;
|
||||
|
||||
/// <summary>
|
||||
/// The modified model size (If the item is a DFF)
|
||||
/// </summary>
|
||||
public Vector3 Size;
|
||||
|
||||
/// <summary>
|
||||
/// The unmodified model size (If the item is a DFF)
|
||||
/// </summary>
|
||||
public Vector3 OriginalSize;
|
||||
|
||||
/// <summary>
|
||||
/// Length in bytes of the item
|
||||
/// </summary>
|
||||
public uint Length;
|
||||
|
||||
/// <summary>
|
||||
/// md5 of the item bytes
|
||||
/// </summary>
|
||||
public string MD5;
|
||||
|
||||
/// <summary>
|
||||
/// sha256 of the item bytes
|
||||
/// </summary>
|
||||
public string SHA256;
|
||||
|
||||
/// <summary>
|
||||
/// Length in bytes of the item padded to 2048 byte boundary
|
||||
/// </summary>
|
||||
public string PaddedLength;
|
||||
|
||||
/// <summary>
|
||||
/// md5 of the item bytes padded to 2048 byte boundary
|
||||
/// </summary>
|
||||
public string PaddedMD5;
|
||||
|
||||
/// <summary>
|
||||
/// sha256 of the item bytes padded to 2048 byte boundary
|
||||
/// </summary>
|
||||
public string PaddedSHA256;
|
||||
|
||||
public PlayerModInfo( int id, string name, Vector3 size, Vector3 originalSize, uint length, string md5, string sha256, string paddedLength, string paddedMd5, string paddedSha256 )
|
||||
{
|
||||
this.ID = id;
|
||||
this.Name = name;
|
||||
this.Size = size;
|
||||
this.OriginalSize = originalSize;
|
||||
this.Length = length;
|
||||
this.MD5 = md5;
|
||||
this.SHA256 = sha256;
|
||||
this.PaddedLength = paddedLength;
|
||||
this.PaddedMD5 = paddedMd5;
|
||||
this.PaddedSHA256 = paddedSha256;
|
||||
}
|
||||
}
|
||||
}
|
34
MultiTheftAuto/Pools/IdentifiedPool.cs
Normal file
34
MultiTheftAuto/Pools/IdentifiedPool.cs
Normal file
@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using MultiTheftAuto.Utils;
|
||||
|
||||
namespace MultiTheftAuto.Pools
|
||||
{
|
||||
public abstract class IdentifiedPool<T> : Pool<T> where T : class, IIdentifyable
|
||||
{
|
||||
protected static Type InstanceType;
|
||||
|
||||
public static void Register<T2>() where T2 : T
|
||||
{
|
||||
InstanceType = typeof( T2 );
|
||||
}
|
||||
|
||||
public static T Find( UInt32 userdata )
|
||||
{
|
||||
return All.FirstOrDefault( i => i.userdata == userdata );
|
||||
}
|
||||
|
||||
public static T Create( UInt32 userdata )
|
||||
{
|
||||
return (T)Activator.CreateInstance( InstanceType, userdata );
|
||||
}
|
||||
|
||||
public static T FindOrCreate( UInt32 userdata )
|
||||
{
|
||||
return Find( userdata ) ?? Create( userdata );
|
||||
}
|
||||
}
|
||||
}
|
59
MultiTheftAuto/Pools/Pool.cs
Normal file
59
MultiTheftAuto/Pools/Pool.cs
Normal file
@ -0,0 +1,59 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using MultiTheftAuto.Utils;
|
||||
|
||||
namespace MultiTheftAuto.Pools
|
||||
{
|
||||
public abstract class Pool<T> : Disposable
|
||||
{
|
||||
protected static readonly List<object> Instances = new List<object>();
|
||||
protected static ReadOnlyCollection<T> ReadOnly = new ReadOnlyCollection<T>( new List<T>() );
|
||||
protected static object Lock = new object();
|
||||
|
||||
protected Pool()
|
||||
{
|
||||
lock( Lock )
|
||||
{
|
||||
Instances.Add( this );
|
||||
ReadOnly = Instances.OfType<T>().ToList().AsReadOnly();
|
||||
}
|
||||
}
|
||||
|
||||
public static ReadOnlyCollection<T> All
|
||||
{
|
||||
get
|
||||
{
|
||||
lock( Lock )
|
||||
{
|
||||
return ReadOnly;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Dispose( bool disposing )
|
||||
{
|
||||
lock( Lock )
|
||||
{
|
||||
Instances.Remove( this );
|
||||
ReadOnly = Instances.OfType<T>().ToList().AsReadOnly();
|
||||
}
|
||||
}
|
||||
|
||||
public static bool Contains( T item )
|
||||
{
|
||||
lock( Lock )
|
||||
{
|
||||
return Instances.Contains( item );
|
||||
}
|
||||
}
|
||||
|
||||
public static ReadOnlyCollection<T2> GetAll<T2>()
|
||||
{
|
||||
lock( Lock )
|
||||
{
|
||||
return Instances.OfType<T2>().ToList().AsReadOnly();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
36
MultiTheftAuto/Properties/AssemblyInfo.cs
Normal file
36
MultiTheftAuto/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Управление общими сведениями о сборке осуществляется с помощью
|
||||
// набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения,
|
||||
// связанные со сборкой.
|
||||
[assembly: AssemblyTitle("MultiTheftAuto")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("MultiTheftAuto")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2014")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Параметр ComVisible со значением FALSE делает типы в сборке невидимыми
|
||||
// для COM-компонентов. Если требуется обратиться к типу в этой сборке через
|
||||
// COM, задайте атрибуту ComVisible значение TRUE для этого типа.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
|
||||
[assembly: Guid("b458cd1d-7f6d-4131-83f4-02afbc28282b")]
|
||||
|
||||
// Сведения о версии сборки состоят из следующих четырех значений:
|
||||
//
|
||||
// Основной номер версии
|
||||
// Дополнительный номер версии
|
||||
// Номер построения
|
||||
// Редакция
|
||||
//
|
||||
// Можно задать все значения или принять номер построения и номер редакции по умолчанию,
|
||||
// используя "*", как показано ниже:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
208
MultiTheftAuto/Resource.cs
Normal file
208
MultiTheftAuto/Resource.cs
Normal file
@ -0,0 +1,208 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using MultiTheftAuto.Pools;
|
||||
using MultiTheftAuto.Utils;
|
||||
|
||||
namespace MultiTheftAuto
|
||||
{
|
||||
public class Resource : IdentifiedPool<Resource>, IIdentifyable
|
||||
{
|
||||
#region Properties
|
||||
|
||||
public UInt32 userdata
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Static properties
|
||||
|
||||
public static Element Root
|
||||
{
|
||||
get
|
||||
{
|
||||
return Element.FindOrCreate( Native.Resource.GetRootElement() );
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constuctors
|
||||
|
||||
public Resource( string resourceName, string organizationalDir )
|
||||
: this( Native.Resource.Create( resourceName, organizationalDir ) )
|
||||
{
|
||||
}
|
||||
|
||||
public Resource( UInt32 userdata )
|
||||
{
|
||||
this.userdata = userdata;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
public Resource Copy( string newResourceName, string organizationalDir )
|
||||
{
|
||||
return new Resource( Native.Resource.Copy( this.userdata, newResourceName, organizationalDir ) );
|
||||
}
|
||||
|
||||
public Element GetRoot()
|
||||
{
|
||||
return Element.FindOrCreate( Native.Resource.GetRootElement( this.userdata ) );
|
||||
}
|
||||
|
||||
public Element GetMapRootElement( UInt32 resource, string map )
|
||||
{
|
||||
return Element.FindOrCreate( Native.Resource.GetMapRootElement( this.userdata, map ) );
|
||||
}
|
||||
|
||||
public Element GetDynamicElementRoot()
|
||||
{
|
||||
return Element.FindOrCreate( Native.Resource.GetDynamicElementRoot( this.userdata ) );
|
||||
}
|
||||
|
||||
public bool RemoveFile( string filename )
|
||||
{
|
||||
return Native.Resource.RemoveFile( this.userdata, filename );
|
||||
}
|
||||
|
||||
public string GetInfo( string attribute )
|
||||
{
|
||||
return Native.Resource.GetInfo( this.userdata, attribute );
|
||||
}
|
||||
|
||||
public uint GetLastStartTime()
|
||||
{
|
||||
return Native.Resource.GetLastStartTime( this.userdata );
|
||||
}
|
||||
|
||||
public string GetLoadFailureReason()
|
||||
{
|
||||
return Native.Resource.GetLoadFailureReason( this.userdata );
|
||||
}
|
||||
|
||||
public uint GetLoadTime()
|
||||
{
|
||||
return Native.Resource.GetLoadTime( this.userdata );
|
||||
}
|
||||
|
||||
public string GetName()
|
||||
{
|
||||
return Native.Resource.GetName( this.userdata );
|
||||
}
|
||||
|
||||
public string GetState()
|
||||
{
|
||||
return Native.Resource.GetState( this.userdata );
|
||||
}
|
||||
|
||||
public bool SetDefaultSetting( string settingName, string settingValue )
|
||||
{
|
||||
return Native.Resource.SetDefaultSetting( this.userdata, settingName, settingValue );
|
||||
}
|
||||
|
||||
public bool RemoveDefaultSetting( string settingName )
|
||||
{
|
||||
return Native.Resource.RemoveDefaultSetting( this.userdata, settingName );
|
||||
}
|
||||
|
||||
public bool Start( bool persistent = false, bool startIncludedResources = true, bool loadServerConfigs = true, bool loadMaps = true, bool loadServerScripts = true, bool loadHTML = true, bool loadClientConfigs = true, bool loadClientScripts = true, bool loadFiles = true )
|
||||
{
|
||||
return Native.Resource.Start( this.userdata, persistent, startIncludedResources, loadServerConfigs, loadMaps, loadServerScripts, loadHTML, loadClientConfigs, loadClientScripts, loadFiles );
|
||||
}
|
||||
|
||||
public bool Restart()
|
||||
{
|
||||
return Native.Resource.Restart( this.userdata );
|
||||
}
|
||||
|
||||
public bool Stop()
|
||||
{
|
||||
return Native.Resource.Stop( this.userdata );
|
||||
}
|
||||
|
||||
public bool SetInfo( string attribute, string value )
|
||||
{
|
||||
return Native.Resource.SetInfo( this.userdata, attribute, value );
|
||||
}
|
||||
|
||||
public bool Rename( string newResourceName, string organizationalPath )
|
||||
{
|
||||
return Native.Resource.Rename( this.GetName(), newResourceName, organizationalPath );
|
||||
}
|
||||
|
||||
public bool Delete()
|
||||
{
|
||||
return Native.Resource.Delete( this.GetName() );
|
||||
}
|
||||
|
||||
public bool UpdateACLRequest( string rightName, bool bAccess, string byWho )
|
||||
{
|
||||
return Native.Resource.UpdateACLRequest( this.userdata, rightName, bAccess, byWho );
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Static methods
|
||||
|
||||
public static bool Rename( string resourceName, string newResourceName, string organizationalPath )
|
||||
{
|
||||
return Native.Resource.Rename( resourceName, newResourceName, organizationalPath );
|
||||
}
|
||||
|
||||
public static bool Delete( string resourceName )
|
||||
{
|
||||
return Native.Resource.Delete( resourceName );
|
||||
}
|
||||
|
||||
public static bool Refresh( bool refreshAll = false )
|
||||
{
|
||||
return Native.Resource.Refresh( refreshAll );
|
||||
}
|
||||
|
||||
public static Resource GetCurrent()
|
||||
{
|
||||
return Resource.FindOrCreate( Native.Resource.GetCurrent() );
|
||||
}
|
||||
|
||||
public static Resource[] GetAll()
|
||||
{
|
||||
UInt32[] userdataArray = Native.Resource.GetResources();
|
||||
|
||||
Resource[] resources = new Resource[ userdataArray.Length ];
|
||||
|
||||
for( uint i = 0; i < userdataArray.Length; i++ )
|
||||
{
|
||||
resources.SetValue( Resource.FindOrCreate( userdataArray[ i ] ), i );
|
||||
}
|
||||
|
||||
return resources;
|
||||
}
|
||||
|
||||
public static Element GetRootElement( Element resource = null )
|
||||
{
|
||||
return Element.FindOrCreate( Native.Resource.GetRootElement( resource.userdata ) );
|
||||
}
|
||||
|
||||
public static Resource GetFromName( string resourceName )
|
||||
{
|
||||
UInt32 userdata = Native.Resource.GetFromName( resourceName );
|
||||
|
||||
if( userdata != 0 )
|
||||
{
|
||||
return Resource.FindOrCreate( userdata );
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
17
MultiTheftAuto/Server.cs
Normal file
17
MultiTheftAuto/Server.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace MultiTheftAuto
|
||||
{
|
||||
public class Server
|
||||
{
|
||||
public static bool OutputChatBox( string text, Element element, Color color, bool colorCoded )
|
||||
{
|
||||
return Native.Server.OutputChatBox( text, element.userdata, color, colorCoded );
|
||||
}
|
||||
public static bool OutputConsole( string text, Element element )
|
||||
{
|
||||
return Native.Server.OutputConsole( text, element.userdata );
|
||||
}
|
||||
}
|
||||
}
|
32
MultiTheftAuto/ServerVersion.cs
Normal file
32
MultiTheftAuto/ServerVersion.cs
Normal file
@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto
|
||||
{
|
||||
public class ServerVersion
|
||||
{
|
||||
public ulong Number { get; set; }
|
||||
public string String { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string BuildType { get; set; }
|
||||
public ulong Netcode { get; set; }
|
||||
public string OperatingSystem { get; set; }
|
||||
public string BuildTag { get; set; }
|
||||
public string Sortable { get; set; }
|
||||
|
||||
public ServerVersion( ulong number, string version, string name, string buildType, ulong netcode, string os, string tag, string sortable )
|
||||
{
|
||||
this.Number = number;
|
||||
this.String = version;
|
||||
this.Name = name;
|
||||
this.BuildType = buildType;
|
||||
this.Netcode = netcode;
|
||||
this.OperatingSystem = os;
|
||||
this.BuildTag = tag;
|
||||
this.Sortable = sortable;
|
||||
}
|
||||
}
|
||||
}
|
88
MultiTheftAuto/Team.cs
Normal file
88
MultiTheftAuto/Team.cs
Normal file
@ -0,0 +1,88 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace MultiTheftAuto
|
||||
{
|
||||
public class Team : Element
|
||||
{
|
||||
#region Construcotrs
|
||||
|
||||
public Team( string name, Color color = null )
|
||||
: base( Native.Team.Create( name, color ) )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Team( UInt32 userdata )
|
||||
: base( userdata )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
public string GetName()
|
||||
{
|
||||
return Native.Team.GetName( this.userdata );
|
||||
}
|
||||
|
||||
public Color GetColor()
|
||||
{
|
||||
return Native.Team.GetColor( this.userdata );
|
||||
}
|
||||
|
||||
public bool GetFriendlyFire()
|
||||
{
|
||||
return Native.Team.GetFriendlyFire( this.userdata );
|
||||
}
|
||||
|
||||
public Player[] GetPlayers()
|
||||
{
|
||||
UInt32[] userdataArray = Native.Team.GetPlayers( this.userdata );
|
||||
|
||||
Player[] players = new Player[ userdataArray.Length ];
|
||||
|
||||
for( uint i = 0; i < userdataArray.Length; i++ )
|
||||
{
|
||||
players.SetValue( Element.FindOrCreate( userdataArray[ i ] ) as Player, i );
|
||||
}
|
||||
|
||||
return players;
|
||||
}
|
||||
|
||||
public int CountPlayers()
|
||||
{
|
||||
return Native.Team.CountPlayers( this.userdata );
|
||||
}
|
||||
|
||||
public bool SetName( string name )
|
||||
{
|
||||
return Native.Team.SetName( this.userdata, name );
|
||||
}
|
||||
|
||||
public bool SetColor( Color color )
|
||||
{
|
||||
return Native.Team.SetColor( this.userdata, color );
|
||||
}
|
||||
|
||||
public bool SetFriendlyFire( bool enabled )
|
||||
{
|
||||
return Native.Team.SetFriendlyFire( this.userdata, enabled );
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Static methods
|
||||
|
||||
public static Team GetFromName( string name )
|
||||
{
|
||||
return Element.FindOrCreate( Native.Team.GetFromName( name ) ) as Team;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
70
MultiTheftAuto/Utils/Disposable.cs
Normal file
70
MultiTheftAuto/Utils/Disposable.cs
Normal file
@ -0,0 +1,70 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.Utils
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines methods to release allocated resources and to check whether this resource has been disposed.
|
||||
/// </summary>
|
||||
public abstract class Disposable : IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets whether this resource has been disposed.
|
||||
/// </summary>
|
||||
public bool Disposed
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs tasks associated with freeing, releasing, or resetting unmanaged resources.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
if( Disposed )
|
||||
{
|
||||
//We've been desposed already. Abort further disposure.
|
||||
return;
|
||||
}
|
||||
//Dispose all native and managed resources.
|
||||
Dispose( true );
|
||||
|
||||
//Remember we've been disposed.
|
||||
Disposed = true;
|
||||
|
||||
//Suppress finalisation; We already disposed our resources.
|
||||
GC.SuppressFinalize( this );
|
||||
}
|
||||
|
||||
~Disposable()
|
||||
{
|
||||
if( Disposed )
|
||||
{
|
||||
//We've been desposed already. Abort further disposure.
|
||||
return;
|
||||
}
|
||||
|
||||
Dispose( false );
|
||||
|
||||
//We don't care to set Disposed value; Resource is being collected by GC anyways.
|
||||
}
|
||||
|
||||
protected void CheckDisposure()
|
||||
{
|
||||
if( Disposed )
|
||||
{
|
||||
throw new ObjectDisposedException( "Cannot access disposed resource." );
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs tasks associated with freeing, releasing, or resetting unmanaged resources.
|
||||
/// </summary>
|
||||
/// <param name="disposing">Whether managed resources should be disposed.</param>
|
||||
protected abstract void Dispose( bool disposing );
|
||||
}
|
||||
}
|
22
MultiTheftAuto/Utils/IIdentifyable.cs
Normal file
22
MultiTheftAuto/Utils/IIdentifyable.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto.Utils
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains an Identity property.
|
||||
/// </summary>
|
||||
public interface IIdentifyable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the Identity of this instance.
|
||||
/// </summary>
|
||||
UInt32 userdata
|
||||
{
|
||||
get;
|
||||
}
|
||||
}
|
||||
}
|
52
MultiTheftAuto/Vector2.cs
Normal file
52
MultiTheftAuto/Vector2.cs
Normal file
@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto
|
||||
{
|
||||
public class Vector2
|
||||
{
|
||||
public float X;
|
||||
public float Y;
|
||||
|
||||
public Vector2()
|
||||
{
|
||||
this.X = 0;
|
||||
this.Y = 0;
|
||||
}
|
||||
|
||||
public Vector2( float _fX, float _fY )
|
||||
{
|
||||
this.X = _fX;
|
||||
this.Y = _fY;
|
||||
}
|
||||
|
||||
public float DotProduct( Vector2 other )
|
||||
{
|
||||
return this.X * other.X + this.Y * other.Y;
|
||||
}
|
||||
|
||||
public float Length()
|
||||
{
|
||||
return (float)Math.Sqrt( this.X * this.X + this.Y * this.Y );
|
||||
}
|
||||
|
||||
public float LengthSquared()
|
||||
{
|
||||
return ( this.X * this.X ) + ( this.Y * this.Y );
|
||||
}
|
||||
|
||||
public void Normalize()
|
||||
{
|
||||
float fLength = this.Length();
|
||||
|
||||
if( fLength > 0.0f )
|
||||
{
|
||||
this.X /= fLength;
|
||||
this.Y /= fLength;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
373
MultiTheftAuto/Vector3.cs
Normal file
373
MultiTheftAuto/Vector3.cs
Normal file
@ -0,0 +1,373 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace MultiTheftAuto
|
||||
{
|
||||
public class Vector3
|
||||
{
|
||||
public static double FLOAT_EPSILON = 0.0001;
|
||||
|
||||
public float X { get; set; }
|
||||
public float Y { get; set; }
|
||||
public float Z { get; set; }
|
||||
|
||||
public static Vector3 Back
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Vector3( 0.0f, -1.0f, 0.0f );
|
||||
}
|
||||
}
|
||||
|
||||
public static Vector3 Down
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Vector3( 0.0f, 0.0f, -1.0f );
|
||||
}
|
||||
}
|
||||
|
||||
public static Vector3 Forward
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Vector3( 0.0f, 1.0f, 0.0f );
|
||||
}
|
||||
}
|
||||
|
||||
public static Vector3 Left
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Vector3( -1.0f, 0.0f, 0.0f );
|
||||
}
|
||||
}
|
||||
|
||||
public static Vector3 One
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Vector3( 1.0f, 1.0f, 1.0f );
|
||||
}
|
||||
}
|
||||
|
||||
public static Vector3 Right
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Vector3( 1.0f, 0.0f, 0.0f );
|
||||
}
|
||||
}
|
||||
|
||||
public static Vector3 Up
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Vector3( 0.0f, 0.0f, 1.0f );
|
||||
}
|
||||
}
|
||||
|
||||
public static Vector3 Zero
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Vector3( 0.0f, 0.0f, 0.0f );
|
||||
}
|
||||
}
|
||||
|
||||
public float Magnitude
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.LengthSquared();
|
||||
}
|
||||
}
|
||||
|
||||
public float SqrMagnitude
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.Length();
|
||||
}
|
||||
}
|
||||
|
||||
public float Normalized
|
||||
{
|
||||
get
|
||||
{
|
||||
float length = this.Length();
|
||||
|
||||
if( length > Vector3.FLOAT_EPSILON )
|
||||
{
|
||||
return length;
|
||||
}
|
||||
|
||||
return 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
public Vector3( float fX, float fY, float fZ )
|
||||
{
|
||||
this.Set( fX, fY, fZ );
|
||||
}
|
||||
|
||||
public void Set( float fX, float fY, float fZ )
|
||||
{
|
||||
this.X = fX;
|
||||
this.Y = fY;
|
||||
this.Z = fZ;
|
||||
}
|
||||
|
||||
public float Normalize()
|
||||
{
|
||||
float fLength = this.Length();
|
||||
|
||||
if( fLength > Vector3.FLOAT_EPSILON )
|
||||
{
|
||||
this.X = this.X / fLength;
|
||||
this.Y = this.Y / fLength;
|
||||
this.Z = this.Z / fLength;
|
||||
|
||||
return fLength;
|
||||
}
|
||||
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
public Vector3 GetNormalized()
|
||||
{
|
||||
if( this.Magnitude == 0.0f )
|
||||
{
|
||||
throw new DivideByZeroException();
|
||||
}
|
||||
else
|
||||
{
|
||||
float inverse = 1.0f / this.Magnitude;
|
||||
|
||||
return new Vector3( this.X * inverse, this.Y * inverse, this.Z * inverse );
|
||||
}
|
||||
}
|
||||
|
||||
public float Length()
|
||||
{
|
||||
return (float)Math.Sqrt( (float)this.LengthSquared() );
|
||||
}
|
||||
|
||||
public float LengthSquared()
|
||||
{
|
||||
return this.X * this.X + this.Y * this.Y + this.Z * this.Z;
|
||||
}
|
||||
|
||||
public float DotProduct( Vector3 vector )
|
||||
{
|
||||
return this.X * vector.X + this.Y * vector.Y + this.Z * vector.Z;
|
||||
}
|
||||
|
||||
public Vector3 Cross( Vector3 vector )
|
||||
{
|
||||
return new Vector3( this.Y * vector.Z - this.Z * vector.Y, this.Z * vector.X - this.X * vector.Z, this.X * vector.Y - this.Y * vector.X );
|
||||
}
|
||||
|
||||
public void CrossProduct( Vector3 vector )
|
||||
{
|
||||
float
|
||||
fX = this.X,
|
||||
fY = this.Y,
|
||||
fZ = this.Z;
|
||||
|
||||
this.X = fY * vector.Z - vector.Y * fZ;
|
||||
this.Y = fZ * vector.X - vector.Z * fX;
|
||||
this.Z = fX * vector.Y - vector.X * fY;
|
||||
}
|
||||
|
||||
public Vector3 GetTriangleNormal( Vector3 vector1, Vector3 vector2 )
|
||||
{
|
||||
return ( vector1 - this ).Cross( vector2 - this );
|
||||
}
|
||||
|
||||
public Vector3 GetRotation( Vector3 vector )
|
||||
{
|
||||
float fX = 0.0f;
|
||||
float fY = 0.0f;
|
||||
float fZ = ( 360.0f - ( (float)Math.Atan2( vector.X - this.X, vector.Y - this.Y ) * 180.0f / (float)Math.PI ) ) % 360.0f;
|
||||
|
||||
return new Vector3( fX, fY, fZ );
|
||||
}
|
||||
|
||||
public Vector3 Rotate( float angle )
|
||||
{
|
||||
angle = (float)Math.PI * angle / 180.0f;
|
||||
|
||||
return new Vector3(
|
||||
this.X * (float)Math.Cos( angle ) - this.Y * (float)Math.Sin( angle ),
|
||||
this.X * (float)Math.Sin( angle ) + this.Y * (float)Math.Cos( angle ),
|
||||
this.Z
|
||||
);
|
||||
}
|
||||
|
||||
public float Distance( Vector3 vector )
|
||||
{
|
||||
return ( vector - this ).Length();
|
||||
}
|
||||
|
||||
public float Dot( Vector3 vector )
|
||||
{
|
||||
return this.X * vector.X + this.Y * vector.Y + this.Z * vector.Z;
|
||||
}
|
||||
|
||||
public Vector3 Offset( float distance, float angle )
|
||||
{
|
||||
angle = (float)Math.PI * angle / 180.0f;
|
||||
|
||||
return new Vector3(
|
||||
this.X + ( ( (float)Math.Cos( angle ) ) * distance ),
|
||||
this.Y + ( ( (float)Math.Sin( angle ) ) * distance ),
|
||||
this.Z
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the angle in degrees between from and to.
|
||||
/// </summary>
|
||||
/// <param name="from"></param>
|
||||
/// <param name="to"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
public float Angle( Vector3 to )
|
||||
{
|
||||
return ( 360.0f - ( (float)Math.Atan2( to.X - this.X, to.Y - this.Y ) * 180.0f / (float)Math.PI ) ) % 360.0f;
|
||||
}
|
||||
|
||||
public static float Angle( Vector3 vector1, Vector3 vector2 )
|
||||
{
|
||||
return (float)Math.Acos( vector1.GetNormalized().DotProduct( vector2.GetNormalized() ) );
|
||||
}
|
||||
|
||||
public Vector3 Pitch( float degree )
|
||||
{
|
||||
float x = this.X;
|
||||
float y = ( this.Y * (float)Math.Cos( degree ) ) - ( this.Z * (float)Math.Sin( degree ) );
|
||||
float z = ( this.Y * (float)Math.Sin( degree ) ) + ( this.Z * (float)Math.Cos( degree ) );
|
||||
|
||||
return new Vector3( x, y, z );
|
||||
}
|
||||
|
||||
public Vector3 Yaw( float degree )
|
||||
{
|
||||
float x = ( this.Z * (float)Math.Sin( degree ) ) + ( this.X * (float)Math.Cos( degree ) );
|
||||
float y = this.Y;
|
||||
float z = ( this.Z * (float)Math.Cos( degree ) ) - ( this.X * (float)Math.Sin( degree ) );
|
||||
|
||||
return new Vector3( x, y, z );
|
||||
}
|
||||
|
||||
public Vector3 Roll( float degree )
|
||||
{
|
||||
float x = ( this.X * (float)Math.Cos( degree ) ) - ( this.Y * (float)Math.Sin( degree ) );
|
||||
float y = ( this.X * (float)Math.Sin( degree ) ) + ( this.Y * (float)Math.Cos( degree ) );
|
||||
float z = this.Z;
|
||||
|
||||
return new Vector3( x, y, z );
|
||||
}
|
||||
|
||||
public bool IsBackFace( Vector3 lineOfSight )
|
||||
{
|
||||
return this.DotProduct( lineOfSight ) < 0.0f;
|
||||
}
|
||||
public bool IsPerpendicular( Vector3 vector )
|
||||
{
|
||||
return this.DotProduct( vector ) == 0.0f;
|
||||
}
|
||||
|
||||
public float MixedProduct( Vector3 v2, Vector3 v3 )
|
||||
{
|
||||
this.CrossProduct( v2 );
|
||||
|
||||
return this.DotProduct( v3 );
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return String.Format( "({0},{1},{2})", this.X, this.Y, this.Z );
|
||||
}
|
||||
|
||||
public bool Equals( Vector3 vector )
|
||||
{
|
||||
return this.X == vector.X && this.Y == vector.Y && this.Z == vector.Z;
|
||||
}
|
||||
|
||||
public override bool Equals( object o )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#region Operators
|
||||
|
||||
public static Vector3 operator +( Vector3 vector1, Vector3 vector2 )
|
||||
{
|
||||
return new Vector3( vector1.X + vector2.X, vector1.Y + vector2.Y, vector1.Z + vector2.Z );
|
||||
}
|
||||
|
||||
public static Vector3 operator +( Vector3 vector, float value )
|
||||
{
|
||||
return new Vector3( vector.X + value, vector.Y + value, vector.Z + value );
|
||||
}
|
||||
|
||||
public static Vector3 operator -( Vector3 vector1, Vector3 vector2 )
|
||||
{
|
||||
return new Vector3( vector1.X - vector2.X, vector1.Y - vector2.Y, vector1.Z - vector2.Z );
|
||||
}
|
||||
|
||||
public static Vector3 operator -( Vector3 vector, float value )
|
||||
{
|
||||
return new Vector3( vector.X - value, vector.Y - value, vector.Z - value );
|
||||
}
|
||||
|
||||
public static Vector3 operator *( Vector3 vector1, Vector3 vector2 )
|
||||
{
|
||||
return new Vector3( vector1.X * vector2.X, vector1.Y * vector2.Y, vector1.Z * vector2.Z );
|
||||
}
|
||||
|
||||
public static Vector3 operator *( Vector3 vector, float value )
|
||||
{
|
||||
return new Vector3( vector.X * value, vector.Y * value, vector.Z * value );
|
||||
}
|
||||
|
||||
public static Vector3 operator /( Vector3 vector1, Vector3 vector2 )
|
||||
{
|
||||
return new Vector3( vector1.X / vector2.X, vector1.Y / vector2.Y, vector1.Z / vector2.Z );
|
||||
}
|
||||
|
||||
public static Vector3 operator /( Vector3 vector, float value )
|
||||
{
|
||||
return new Vector3( vector.X / value, vector.Y / value, vector.Z / value );
|
||||
}
|
||||
|
||||
public static Vector3 operator %( Vector3 vector1, Vector3 vector2 )
|
||||
{
|
||||
return new Vector3( vector1.X % vector2.X, vector1.Y % vector2.Y, vector1.Z % vector2.Z );
|
||||
}
|
||||
|
||||
public static Vector3 operator %( Vector3 vector, float value )
|
||||
{
|
||||
return new Vector3( vector.X % value, vector.Y % value, vector.Z % value );
|
||||
}
|
||||
|
||||
public static bool operator ==( Vector3 vector1, Vector3 vector2 )
|
||||
{
|
||||
return vector1.Equals( vector2 );
|
||||
}
|
||||
|
||||
public static bool operator !=( Vector3 vector1, Vector3 vector2 )
|
||||
{
|
||||
return !vector1.Equals( vector2 );
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
502
MultiTheftAuto/Vehicle.cs
Normal file
502
MultiTheftAuto/Vehicle.cs
Normal file
@ -0,0 +1,502 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto
|
||||
{
|
||||
public enum VehicleModel
|
||||
{
|
||||
ADMIRAL = 445,
|
||||
ALPHA = 602,
|
||||
AMBULAN = 416,
|
||||
ANDROM = 592,
|
||||
ARTICT1 = 435,
|
||||
ARTICT2 = 450,
|
||||
ARTICT3 = 591,
|
||||
AT400 = 577,
|
||||
BAGBOXA = 606,
|
||||
BAGBOXB = 607,
|
||||
BAGGAGE = 485,
|
||||
BANDITO = 568,
|
||||
BANSHEE = 429,
|
||||
BARRACKS = 433,
|
||||
BEAGLE = 511,
|
||||
BENSON = 499,
|
||||
BF400 = 581,
|
||||
BFINJECT = 424,
|
||||
BIKE = 509,
|
||||
BLADE = 536,
|
||||
BLISTAC = 496,
|
||||
BLOODRA = 504,
|
||||
BMX = 481,
|
||||
BOBCAT = 422,
|
||||
BOXBURG = 609,
|
||||
BOXVILLE = 498,
|
||||
BRAVURA = 401,
|
||||
BROADWAY = 575,
|
||||
BUCCANEE = 518,
|
||||
BUFFALO = 402,
|
||||
BULLET = 541,
|
||||
BURRITO = 482,
|
||||
BUS = 431,
|
||||
CABBIE = 438,
|
||||
CADDY = 457,
|
||||
CADRONA = 527,
|
||||
CAMPER = 483,
|
||||
CARGOBOB = 548,
|
||||
CEMENT = 524,
|
||||
CHEETAH = 415,
|
||||
CLOVER = 542,
|
||||
CLUB = 589,
|
||||
COACH = 437,
|
||||
COASTG = 472,
|
||||
COMBINE = 532,
|
||||
COMET = 480,
|
||||
COPBIKE = 523,
|
||||
COPCARLA = 596,
|
||||
COPCARRU = 599,
|
||||
COPCARSF = 597,
|
||||
COPCARVG = 598,
|
||||
CROPDUST = 512,
|
||||
DFT30 = 578,
|
||||
DINGHY = 473,
|
||||
DODO = 593,
|
||||
DOZER = 486,
|
||||
DUMPER = 406,
|
||||
DUNERIDE = 573,
|
||||
ELEGANT = 507,
|
||||
ELEGY = 562,
|
||||
EMPEROR = 585,
|
||||
ENFORCER = 427,
|
||||
ESPERANT = 419,
|
||||
EUROS = 587,
|
||||
FAGGIO = 462,
|
||||
FARMTR1 = 610,
|
||||
FBIRANCH = 490,
|
||||
FBITRUCK = 528,
|
||||
FCR900 = 521,
|
||||
FELTZER = 533,
|
||||
FIRELA = 544,
|
||||
FIRETRUK = 407,
|
||||
FLASH = 565,
|
||||
FLATBED = 455,
|
||||
FORKLIFT = 530,
|
||||
FORTUNE = 526,
|
||||
FREEWAY = 463,
|
||||
FREIBOX = 590,
|
||||
FREIFLAT = 569,
|
||||
FREIGHT = 537,
|
||||
GLENDALE = 466,
|
||||
GLENSHIT = 604,
|
||||
GREENWOO = 492,
|
||||
HERMES = 474,
|
||||
HOTDOG = 588,
|
||||
HOTKNIFE = 434,
|
||||
HOTRINA = 502,
|
||||
HOTRINB = 503,
|
||||
HOTRING = 494,
|
||||
HUNTER = 425,
|
||||
HUNTLEY = 579,
|
||||
HUSTLER = 545,
|
||||
HYDRA = 520,
|
||||
INFERNUS = 411,
|
||||
INTRUDER = 546,
|
||||
JESTER = 559,
|
||||
JETMAX = 493,
|
||||
JOURNEY = 508,
|
||||
KART = 571,
|
||||
LANDSTAL = 400,
|
||||
LAUNCH = 595,
|
||||
LEVIATHN = 417,
|
||||
LINERUN = 403,
|
||||
MAJESTIC = 517,
|
||||
MANANA = 410,
|
||||
MARQUIS = 484,
|
||||
MAVERICK = 487,
|
||||
MERIT = 551,
|
||||
MESA = 500,
|
||||
MONSTER = 444,
|
||||
MONSTERA = 556,
|
||||
MONSTERB = 557,
|
||||
MOONBEAM = 418,
|
||||
MOWER = 572,
|
||||
MRWHOOP = 423,
|
||||
MTBIKE = 510,
|
||||
MULE = 414,
|
||||
NEBULA = 516,
|
||||
NEVADA = 553,
|
||||
NEWSVAN = 582,
|
||||
NRG500 = 522,
|
||||
OCEANIC = 467,
|
||||
PACKER = 443,
|
||||
PATRIOT = 470,
|
||||
PCJ600 = 461,
|
||||
PEREN = 404,
|
||||
PETRO = 514,
|
||||
PETROTR = 584,
|
||||
PHOENIX = 603,
|
||||
PICADOR = 600,
|
||||
PIZZABOY = 448,
|
||||
POLMAV = 497,
|
||||
PONY = 413,
|
||||
PREDATOR = 430,
|
||||
PREMIER = 426,
|
||||
PREVION = 436,
|
||||
PRIMO = 547,
|
||||
QUAD = 471,
|
||||
RAINDANC = 563,
|
||||
RANCHER = 489,
|
||||
RCBANDIT = 441,
|
||||
RCBARON = 464,
|
||||
RCCAM = 594,
|
||||
RCGOBLIN = 501,
|
||||
RCRAIDER = 465,
|
||||
RCTIGER = 564,
|
||||
RDTRAIN = 515,
|
||||
REEFER = 453,
|
||||
REGINA = 479,
|
||||
REMINGTN = 534,
|
||||
RHINO = 432,
|
||||
RNCHLURE = 505,
|
||||
ROMERO = 442,
|
||||
RUMPO = 440,
|
||||
RUSTLER = 476,
|
||||
SABRE = 475,
|
||||
SADLER = 543,
|
||||
SADLSHIT = 605,
|
||||
SANCHEZ = 468,
|
||||
SANDKING = 495,
|
||||
SAVANNA = 567,
|
||||
SEASPAR = 447,
|
||||
SECURICA = 428,
|
||||
SENTINEL = 405,
|
||||
SHAMAL = 519,
|
||||
SKIMMER = 460,
|
||||
SLAMVAN = 535,
|
||||
SOLAIR = 458,
|
||||
SPARROW = 469,
|
||||
SPEEDER = 452,
|
||||
SQUALO = 446,
|
||||
STAFFORD = 580,
|
||||
STALLION = 439,
|
||||
STRATUM = 561,
|
||||
STREAK = 538,
|
||||
STREAKC = 570,
|
||||
STRETCH = 409,
|
||||
STUNT = 513,
|
||||
SULTAN = 560,
|
||||
SUNRISE = 550,
|
||||
SUPERGT = 506,
|
||||
SWATVAN = 601,
|
||||
SWEEPER = 574,
|
||||
TAHOMA = 566,
|
||||
TAMPA = 549,
|
||||
TAXI = 420,
|
||||
TOPFUN = 459,
|
||||
TORNADO = 576,
|
||||
TOWTRUCK = 525,
|
||||
TRACTOR = 531,
|
||||
TRAM = 449,
|
||||
TRASH = 408,
|
||||
TROPIC = 454,
|
||||
TUG = 583,
|
||||
TUGSTAIR = 608,
|
||||
TURISMO = 451,
|
||||
URANUS = 558,
|
||||
UTILITY = 552,
|
||||
UTILTR1 = 611,
|
||||
VCNMAV = 488,
|
||||
VINCENT = 540,
|
||||
VIRGO = 491,
|
||||
VOODOO = 412,
|
||||
VORTEX = 539,
|
||||
WALTON = 478,
|
||||
WASHING = 421,
|
||||
WAYFARER = 586,
|
||||
WILLARD = 529,
|
||||
WINDSOR = 555,
|
||||
YANKEE = 456,
|
||||
YOSEMITE = 554,
|
||||
ZR350 = 477
|
||||
}
|
||||
|
||||
public class Vehicle : Element
|
||||
{
|
||||
#region Properties
|
||||
|
||||
public string Type
|
||||
{
|
||||
get
|
||||
{
|
||||
return Native.Vehicle.GetType( this.GetUserData() );
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public Vehicle( UInt32 userdata )
|
||||
: base( userdata )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Vehicle( VehicleModel model, Vector3 position, Vector3 rotation, string numberplate = null, bool direction = false, int variant1 = 255, int variant2 = 255 )
|
||||
: base( Native.Vehicle.Create( (int)model, position, rotation, numberplate, direction, variant1, variant2 ) )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
#region Set
|
||||
|
||||
public bool Fix()
|
||||
{
|
||||
return Native.Vehicle.Fix( this.GetUserData() );
|
||||
}
|
||||
|
||||
public bool Blow( bool blow = true )
|
||||
{
|
||||
return Native.Vehicle.Blow( this.GetUserData(), blow );
|
||||
}
|
||||
|
||||
public bool SetTurnVelocity( Vector3 velocity )
|
||||
{
|
||||
return Native.Vehicle.SetTurnVelocity( this.GetUserData(), velocity );
|
||||
}
|
||||
|
||||
public bool SetColor( Color color1, Color color2 = null, Color color3 = null, Color color4 = null )
|
||||
{
|
||||
return Native.Vehicle.SetColor( this.GetUserData(), color1, color2, color3, color4 );
|
||||
}
|
||||
|
||||
public bool SetLandingGearDown( bool state )
|
||||
{
|
||||
return Native.Vehicle.SetLandingGearDown( this.GetUserData(), state );
|
||||
}
|
||||
|
||||
public bool SetLocked( bool locked )
|
||||
{
|
||||
return Native.Vehicle.SetLocked( this.GetUserData(), locked );
|
||||
}
|
||||
|
||||
public bool SetDoorsUndamageable( bool state )
|
||||
{
|
||||
return Native.Vehicle.SetDoorsUndamageable( this.GetUserData(), state );
|
||||
}
|
||||
|
||||
public bool SetSirensOn( bool state )
|
||||
{
|
||||
return Native.Vehicle.SetSirensOn( this.GetUserData(), state );
|
||||
}
|
||||
|
||||
public bool SetTaxiLightOn( bool state )
|
||||
{
|
||||
return Native.Vehicle.SetTaxiLightOn( this.GetUserData(), state );
|
||||
}
|
||||
|
||||
public bool AddUpgrade( int upgrade )
|
||||
{
|
||||
return Native.Vehicle.AddUpgrade( this.GetUserData(), upgrade );
|
||||
}
|
||||
|
||||
public bool RemoveUpgrade( int upgrade )
|
||||
{
|
||||
return Native.Vehicle.RemoveUpgrade( this.GetUserData(), upgrade );
|
||||
}
|
||||
|
||||
public bool SetDoorState( int door, int state )
|
||||
{
|
||||
return Native.Vehicle.SetDoorState( this.GetUserData(), door, state );
|
||||
}
|
||||
|
||||
public bool SetWheelStates( int frontLeft, int rearLeft, int frontRight, int rearRight )
|
||||
{
|
||||
return Native.Vehicle.SetWheelStates( this.GetUserData(), frontLeft, rearLeft, frontRight, rearRight );
|
||||
}
|
||||
|
||||
public bool SetLightState( int light, int state )
|
||||
{
|
||||
return Native.Vehicle.SetLightState( this.GetUserData(), light, state );
|
||||
}
|
||||
|
||||
public bool SetPanelState( int panelID, int state )
|
||||
{
|
||||
return Native.Vehicle.SetPanelState( this.GetUserData(), panelID, state );
|
||||
}
|
||||
|
||||
public bool SetIdleRespawnDelay( int timeDelay )
|
||||
{
|
||||
return Native.Vehicle.SetIdleRespawnDelay( this.GetUserData(), timeDelay );
|
||||
}
|
||||
|
||||
public bool SetRespawnDelay( int timeDelay )
|
||||
{
|
||||
return Native.Vehicle.SetRespawnDelay( this.GetUserData(), timeDelay );
|
||||
}
|
||||
|
||||
public bool SetRespawnPosition( Vector3 position, Vector3 rotation )
|
||||
{
|
||||
return Native.Vehicle.SetRespawnPosition( this.GetUserData(), position, rotation );
|
||||
}
|
||||
|
||||
public bool ToggleRespawn( bool respawn )
|
||||
{
|
||||
return Native.Vehicle.ToggleRespawn( this.GetUserData(), respawn );
|
||||
}
|
||||
|
||||
public bool ResetExplosionTime()
|
||||
{
|
||||
return Native.Vehicle.ResetExplosionTime( this.GetUserData() );
|
||||
}
|
||||
|
||||
public bool ResetIdleTime()
|
||||
{
|
||||
return Native.Vehicle.ResetIdleTime( this.GetUserData() );
|
||||
}
|
||||
|
||||
public bool Spawn( Vector3 position, Vector3 rotation )
|
||||
{
|
||||
return Native.Vehicle.Spawn( this.GetUserData(), position, rotation );
|
||||
}
|
||||
|
||||
public bool Respawn()
|
||||
{
|
||||
return Native.Vehicle.Respawn( this.GetUserData() );
|
||||
}
|
||||
|
||||
public bool SetOverrideLights( int state )
|
||||
{
|
||||
return Native.Vehicle.SetOverrideLights( this.GetUserData(), state );
|
||||
}
|
||||
|
||||
public bool AttachTrailerToVehicle( Element trailer )
|
||||
{
|
||||
return Native.Vehicle.AttachTrailerToVehicle( this.GetUserData(), trailer.GetUserData() );
|
||||
}
|
||||
|
||||
public bool DetachTrailerFromVehicle( Element trailer = null )
|
||||
{
|
||||
if( trailer == null )
|
||||
return Native.Vehicle.DetachTrailerFromVehicle( this.GetUserData() );
|
||||
|
||||
return Native.Vehicle.DetachTrailerFromVehicle( this.GetUserData(), trailer.GetUserData() );
|
||||
}
|
||||
|
||||
public bool SetEngineState( bool state )
|
||||
{
|
||||
return Native.Vehicle.SetEngineState( this.GetUserData(), state );
|
||||
}
|
||||
|
||||
public bool SetDamageProof( bool state )
|
||||
{
|
||||
return Native.Vehicle.SetDamageProof( this.GetUserData(), state );
|
||||
}
|
||||
|
||||
public bool SetPaintjob( int value )
|
||||
{
|
||||
return Native.Vehicle.SetPaintjob( this.GetUserData(), value );
|
||||
}
|
||||
|
||||
public bool SetFuelTankExplodable( bool state )
|
||||
{
|
||||
return Native.Vehicle.SetFuelTankExplodable( this.GetUserData(), state );
|
||||
}
|
||||
|
||||
public bool SetTrainDerailed( bool state )
|
||||
{
|
||||
return Native.Vehicle.SetTrainDerailed( this.GetUserData(), state );
|
||||
}
|
||||
|
||||
public bool SetTrainDerailable( bool state )
|
||||
{
|
||||
return Native.Vehicle.SetTrainDerailable( this.GetUserData(), state );
|
||||
}
|
||||
|
||||
public bool SetTrainDirection( bool state )
|
||||
{
|
||||
return Native.Vehicle.SetTrainDirection( this.GetUserData(), state );
|
||||
}
|
||||
|
||||
public bool SetTrainSpeed( float speed )
|
||||
{
|
||||
return Native.Vehicle.SetTrainSpeed( this.GetUserData(), speed );
|
||||
}
|
||||
|
||||
public bool SetHeadLightColor( Color color )
|
||||
{
|
||||
return Native.Vehicle.SetHeadLightColor( this.GetUserData(), color );
|
||||
}
|
||||
|
||||
public bool SetTurretPosition( float x, float y )
|
||||
{
|
||||
return Native.Vehicle.SetTurretPosition( this.GetUserData(), x, y );
|
||||
}
|
||||
|
||||
public bool SetDoorOpenRatio( int door, float ratio, int time = 0 )
|
||||
{
|
||||
return Native.Vehicle.SetDoorOpenRatio( this.GetUserData(), door, ratio, time );
|
||||
}
|
||||
|
||||
public bool SetVariant( int variant1 = 255, int variant2 = 255 )
|
||||
{
|
||||
return Native.Vehicle.SetVariant( this.GetUserData(), variant1, variant2 );
|
||||
}
|
||||
|
||||
public bool AddSirens( int sirenCount, int sirenType, bool flag360 = false, bool checkLos = true, bool useRandomiser = true, bool silent = false )
|
||||
{
|
||||
return Native.Vehicle.AddSirens( this.GetUserData(), sirenCount, sirenType, flag360, checkLos, useRandomiser, silent );
|
||||
}
|
||||
|
||||
public bool RemoveSirens()
|
||||
{
|
||||
return Native.Vehicle.RemoveSirens( this.GetUserData() );
|
||||
}
|
||||
|
||||
public bool SetSirens( int sirenPoint, Vector3 position, Color color = null, float minAlpha = 0.0f )
|
||||
{
|
||||
if( color == null )
|
||||
return Native.Vehicle.SetSirens( this.GetUserData(), sirenPoint, position, color, minAlpha );
|
||||
|
||||
return Native.Vehicle.SetSirens( this.GetUserData(), sirenPoint, position, color, minAlpha );
|
||||
}
|
||||
|
||||
public bool SetPlateText( string text )
|
||||
{
|
||||
return Native.Vehicle.SetPlateText( this.GetUserData(), text );
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Get
|
||||
|
||||
public Array GetSirens()
|
||||
{
|
||||
return Native.Vehicle.GetSirens( this.GetUserData() );
|
||||
}
|
||||
|
||||
public Object GetSirenParams()
|
||||
{
|
||||
return Native.Vehicle.GetSirenParams( this.GetUserData() );
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Is
|
||||
|
||||
public bool IsTaxiLightOn()
|
||||
{
|
||||
return Native.Vehicle.IsTaxiLightOn( this.GetUserData() );
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
35
MultiTheftAuto/VehicleColor.cs
Normal file
35
MultiTheftAuto/VehicleColor.cs
Normal file
@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto
|
||||
{
|
||||
public class VehicleColor
|
||||
{
|
||||
private Color[] Colors;
|
||||
|
||||
public VehicleColor( Color color1, Color color2, Color color3, Color color4 )
|
||||
{
|
||||
this.Colors = new Color[ 4 ];
|
||||
|
||||
this.Colors[ 0 ] = color1;
|
||||
this.Colors[ 1 ] = color2;
|
||||
this.Colors[ 2 ] = color3;
|
||||
this.Colors[ 3 ] = color4;
|
||||
}
|
||||
|
||||
public Color this[ int key ]
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.Colors[ key ];
|
||||
}
|
||||
set
|
||||
{
|
||||
this.Colors[ key ] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
24
MultiTheftAuto/VehicleWheelsState.cs
Normal file
24
MultiTheftAuto/VehicleWheelsState.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MultiTheftAuto
|
||||
{
|
||||
public class VehicleWheelsState
|
||||
{
|
||||
public byte FrontLeft;
|
||||
public byte RearLeft;
|
||||
public byte FrontRight;
|
||||
public byte RearRight;
|
||||
|
||||
public VehicleWheelsState( byte frontLeft, byte rearLeft, byte frontRight, byte rearRight )
|
||||
{
|
||||
this.FrontLeft = frontLeft;
|
||||
this.RearLeft = rearLeft;
|
||||
this.FrontRight = frontRight;
|
||||
this.RearRight = rearRight;
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user