State of 0.2

This commit is contained in:
Oliver Booth 2022-08-27 18:16:44 +01:00
parent 85bf078a27
commit 9708d78aa2
No known key found for this signature in database
GPG Key ID: 32A00B35503AF634
143 changed files with 9091 additions and 8576 deletions

20
change.log Normal file
View File

@ -0,0 +1,20 @@
-=Version 0.2 alpha (LATEST)=-
+ Added callback hooks for OnPlayerEditObject and OnPlayerEditAttachedObject for a possiblity to be implemented later
+ License included in binary download archive
+ Added a Vehicle property for the Player class. Removes and places the player in a vehicle
+ Added a Seat property for the Player class. Changes and determines the seat number the player is in.
(NOTE: If the player is not currently in a vehicle, this value is stored and will be used when next placing the player in a vehicle)
+ Added vehicle component functionality
+ Added source archive available for download from the forum post
* Fixed a bug with the Util class not being part of the API namespace
* Fixed a bug where the native GetVehicleComponentInSlot wouldn't return an int
- Removed console output of the Function not found upon loading
-=Version 0.1.1 alpha=-
+ Added Example scripts
-=Version 0.1 alpha=-
+ Majority of callbacks
+ All a_samp.inc 0.3e functions
(every function from a_objects, and various functions from other files are to be implemented soon)
+ XML documentation

51
license.txt Normal file
View File

@ -0,0 +1,51 @@
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
1. Definitions
"Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
"Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License.
"Distribute" means to make available to the public the original and copies of the Work through sale or other transfer of ownership.
"Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
"Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
"Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
"Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
"Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections; and,
to Distribute and Publicly Perform the Work including as incorporated in Collections.
The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats, but otherwise you have no rights to make Adaptations. Subject to 8(f), all rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Section 4(d).
4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(c), as requested.
You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
If You Distribute, or Publicly Perform the Work or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work. The credit required by this Section 4(c) may be implemented in any reasonable manner; provided, however, that in the case of a Collection, at a minimum such credit will appear, if a credit for all contributing authors of Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
For the avoidance of doubt:
Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License if Your exercise of such rights is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b) and otherwise waives the right to collect royalties through any statutory or compulsory licensing scheme; and,
Voluntary License Schemes. The Licensor reserves the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License that is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b).
Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation.
5. Representations, Warranties and Disclaimer
UNLESS OTHERWISE MUTUALLY AGREED BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
7. Termination
This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
8. Miscellaneous
Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.

View File

@ -1,9 +1,8 @@

namespace SAMP.API {
/// <summary>
/// Alignment.
/// </summary>
public enum Alignment : int {
namespace SAMP.API
{
public enum Alignment : int
{
Left = 1,
Centered = 2,
Right = 3

View File

@ -1,9 +1,8 @@

namespace SAMP.API {
/// <summary>
/// Camera mode.
/// </summary>
public enum CameraMode : int {
namespace SAMP.API
{
public enum CameraMode : int
{
TramTrain = 3,
OnFootChase = 4,
SniperAim = 7,

View File

@ -1,22 +0,0 @@

namespace SAMP.API {
/// <summary>
/// Component slot.
/// </summary>
public enum ComponentSlot : int {
Spoiler = 0,
Hood = 1,
Root = 2,
SideSkirt = 3,
Lamps = 4,
Nitro = 5,
Exhaust = 6,
Wheels = 7,
Stereo = 8,
Hydraulics = 9,
FrontBumper = 10,
RearBumper = 11,
VentRight = 12,
VentLeft = 13
};
};

View File

@ -0,0 +1,21 @@

namespace SAMP.API
{
public enum ComponentSlots
{
Spoiler = 0,
Hood = 1,
Root = 2,
SideSkirt = 3,
Lamps = 4,
Nitro = 5,
Exhaust = 6,
Wheels = 7,
Stereo = 8,
Hydraulics = 9,
FrontBumper = 10,
RearBumper = 11,
VentRight = 12,
VentLeft = 13
};
};

View File

@ -1,9 +1,8 @@

namespace SAMP.API {
/// <summary>
/// Dialog style.
/// </summary>
public enum DialogStyle : int {
namespace SAMP.API
{
public enum DialogStyle : int
{
MessageBox = 0,
Input = 1,
List = 2,

View File

@ -1,6 +1,8 @@

namespace SAMP.API {
public enum DisconnectReason : int {
namespace SAMP.API
{
public enum DisconnectReason : int
{
TimedOut = 0,
LeftNormally,
KickedOrBanned

View File

@ -1,9 +1,8 @@

namespace SAMP.API {
/// <summary>
/// Keys.
/// </summary>
public enum Keys : int {
namespace SAMP.API
{
public enum Keys
{
Action = 1,
Crouch = 2,
Fire = 4,

View File

@ -1,9 +1,8 @@

namespace SAMP.API {
/// <summary>
/// Player state.
/// </summary>
public enum PlayerState : int {
namespace SAMP.API
{
public enum PlayerState : int
{
None = 0,
OnFoot = 1,
Driver = 2,

View File

@ -1,9 +1,8 @@

namespace SAMP.API {
/// <summary>
/// Skin.
/// </summary>
public enum Skin : int {
namespace SAMP.API
{
public enum Skin : int
{
cj = 0,
truth = 1,
maccer = 2,

View File

@ -1,29 +0,0 @@

namespace SAMP.API {
/// <summary>
/// Special action.
/// </summary>
public enum SpecialAction : int {
None = 0,
UseJetpack = 2,
Dance1 = 5,
Dance2 = 6,
Dance3 = 7,
Dance4 = 8,
HandsUp = 10,
UseCellPhone = 11,
Sitting = 12,
StopUseCellPhone = 13,
Duck = 1, // Can't be set
EnterVehicle = 3, // Can't be set
ExitVehicle = 4, // Can't be set
Beer = 20,
Ciggy = 21,
Wine = 22,
Sprunk = 23,
Pissing = 68,
Cuffed = 24
};
};

View File

@ -1,51 +0,0 @@

namespace SAMP.API {
/// <summary>
/// Weapon.
/// </summary>
public enum Weapon : int {
Fist = 0,
BrassKnucles,
GolfClub,
Nightstick,
Knife,
BaseballBat,
Shovel,
PoolCue,
Katana,
Chainsaw,
DoubleEndedDildo,
Dildo,
Vibrator,
SilverVibrator,
Flowers,
Cane,
Grenade,
TearGas,
MolotovCocktail,
NineMM,
SilencedNineMM,
DesertEagle,
Shotgun,
SawnoffShotgun,
CombatShotgun,
MicroSMG,
MP5,
AK47,
M4,
Tec9,
CountryRifle,
RPG,
HSRocket,
FlameThrower,
Minigun,
SatchelCharge,
Detonator,
Spraycan,
FireExtinguisher,
Camera,
NightVisionGoggles,
ThermalGoggles,
Parachute
};
};

View File

@ -1,13 +0,0 @@

namespace SAMP.API {
/// <summary>
/// Weapon state.
/// </summary>
public enum WeaponState : int {
Unknown = -1,
NoBullets = 0,
LastBullet = 1,
MoreBullets = 2,
Reloading = 3
};
};

View File

@ -1,19 +0,0 @@

namespace SAMP.API {
/// <summary>
/// Weapon type.
/// </summary>
public enum WeaponType : int {
Pistol = 0,
PistolSilenced,
DesertEagle,
Shotgun,
SawnoffShotgun,
SPAS12Shotgun,
MicroUzi,
MP5,
AK47,
M4,
SniperRifle
};
};

View File

@ -1,34 +1,35 @@
using System;
namespace SAMP.API.EventData {
public class DialogResponseEventArgs : EventArgs {
namespace SAMP.API.EventData
{
public class DialogResponseEventArgs : EventArgs
{
#region Class Variables
private int
m_iId,
m_iResponse,
m_iListItem;
private string
m_strInputText;
private bool
m_bPassOn;
_nDialogID,
_nResponse,
_nListItem;
private string _strInputText;
private bool _bPassOn;
#endregion
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="SAMP.API.EventData.DialogResponseEventArgs"/> class.
/// Creates a new OnPlayerDisconnectEventArgs object.
/// </summary>
/// <param name="dialogid">The ID of the dialog the player responded to, assigned in Player.ShowDialog.</param>
/// <param name="response">1 for first button and 0 for second button.</param>
/// <param name="listitem">The ID of the list item selected by the player.</param>
/// <param name="inputtext">The text entered into the input box by the player or the selected list item text.</param>
public DialogResponseEventArgs(int dialogid, int response, int listitem, string inputtext) {
this.m_iId = dialogid;
this.m_iResponse = response;
this.m_iListItem = listitem;
this.m_strInputText = inputtext;
public DialogResponseEventArgs(int dialogid, int response, int listitem, string inputtext)
{
_nDialogID = dialogid;
_nResponse = response;
_nListItem = listitem;
_strInputText = inputtext;
}
#endregion
@ -36,50 +37,44 @@ namespace SAMP.API.EventData {
#region Accessors & Mutators
/// <summary>
/// Gets the ID of the dialog the player responded to, assigned in <see cref="SAMP.API.Player.ShowDialog"/>.
/// gets the ID of the dialog the player responded to, assigned in Player.ShowDialog.
/// </summary>
public int DialogID {
get {
return this.m_iId;
}
public int DialogID
{
get { return _nDialogID; }
}
/// <summary>
/// Gets the response from the dialog.
/// Gets the response from the dialog. 1 for first button and 0 for second button.
/// </summary>
public int Response {
get {
return this.m_iResponse;
}
public int Response
{
get { return _nResponse; }
}
/// <summary>
/// Gets the ID of the list item selected by the player.
/// </summary>
public int ListItem {
get {
return this.m_iListItem;
}
public int ListItem
{
get { return _nListItem; }
}
/// <summary>
/// Gets the text entered into the input box by the player or the selected list item text.
/// </summary>
public string InputText {
get {
return this.m_strInputText;
}
public string InputText
{
get { return _strInputText; }
}
/// <summary>
/// Gets or sets whether or not this callback should be passed on to filterscripts.
/// </summary>
public bool ContinueToFilterscripts {
get {
return this.m_bPassOn;
} set {
this.m_bPassOn = value;
}
public bool ContinueToFilterscripts
{
get { return _bPassOn; }
set { _bPassOn = value; }
}
#endregion

View File

@ -0,0 +1,77 @@
K 25
svn:wc:ra_dav:version-url
V 61
/svn/!svn/ver/30/branches/0.2/sampdotnet/API/EventData/Player
END
PlayerDeathEventArgs.cs
K 25
svn:wc:ra_dav:version-url
V 85
/svn/!svn/ver/30/branches/0.2/sampdotnet/API/EventData/Player/PlayerDeathEventArgs.cs
END
PlayerStateChangeEventArgs.cs
K 25
svn:wc:ra_dav:version-url
V 91
/svn/!svn/ver/30/branches/0.2/sampdotnet/API/EventData/Player/PlayerStateChangeEventArgs.cs
END
PlayerPickUpPickupEventArgs.cs
K 25
svn:wc:ra_dav:version-url
V 92
/svn/!svn/ver/30/branches/0.2/sampdotnet/API/EventData/Player/PlayerPickUpPickupEventArgs.cs
END
PlayerSpawnEventArgs.cs
K 25
svn:wc:ra_dav:version-url
V 85
/svn/!svn/ver/30/branches/0.2/sampdotnet/API/EventData/Player/PlayerSpawnEventArgs.cs
END
PlayerExitVehicleEventArgs.cs
K 25
svn:wc:ra_dav:version-url
V 91
/svn/!svn/ver/30/branches/0.2/sampdotnet/API/EventData/Player/PlayerExitVehicleEventArgs.cs
END
PlayerDisconnectEventArgs.cs
K 25
svn:wc:ra_dav:version-url
V 90
/svn/!svn/ver/30/branches/0.2/sampdotnet/API/EventData/Player/PlayerDisconnectEventArgs.cs
END
PlayerEnterVehicleEventArgs.cs
K 25
svn:wc:ra_dav:version-url
V 92
/svn/!svn/ver/30/branches/0.2/sampdotnet/API/EventData/Player/PlayerEnterVehicleEventArgs.cs
END
PlayerRequestClassEventArgs.cs
K 25
svn:wc:ra_dav:version-url
V 92
/svn/!svn/ver/30/branches/0.2/sampdotnet/API/EventData/Player/PlayerRequestClassEventArgs.cs
END
PlayerEnterExitModShopEventArgs.cs
K 25
svn:wc:ra_dav:version-url
V 96
/svn/!svn/ver/30/branches/0.2/sampdotnet/API/EventData/Player/PlayerEnterExitModShopEventArgs.cs
END
PlayerCommandTextEventArgs.cs
K 25
svn:wc:ra_dav:version-url
V 91
/svn/!svn/ver/30/branches/0.2/sampdotnet/API/EventData/Player/PlayerCommandTextEventArgs.cs
END
PlayerClickMapEventArgs.cs
K 25
svn:wc:ra_dav:version-url
V 88
/svn/!svn/ver/30/branches/0.2/sampdotnet/API/EventData/Player/PlayerClickMapEventArgs.cs
END
PlayerTextEventArgs.cs
K 25
svn:wc:ra_dav:version-url
V 84
/svn/!svn/ver/30/branches/0.2/sampdotnet/API/EventData/Player/PlayerTextEventArgs.cs
END

View File

@ -0,0 +1,436 @@
10
dir
33
http://samp-dot-net.googlecode.com/svn/branches/0.2/sampdotnet/API/EventData/Player
http://samp-dot-net.googlecode.com/svn
2012-07-07T17:04:38.829891Z
30
yasahiro93
a955bdad-90f8-2b12-97e1-62c735084bea
PlayerCommandTextEventArgs.cs
file
2016-02-16T17:04:51.056990Z
c56d97029dbb767e20decc7e486d486d
2012-07-07T17:04:38.829891Z
30
yasahiro93
1259
PlayerClickMapEventArgs.cs
file
2016-02-16T17:04:51.056990Z
2975c5558913833994f5a2a17405be38
2012-07-07T17:04:38.829891Z
30
yasahiro93
847
PlayerTextEventArgs.cs
file
2016-02-16T17:04:51.056990Z
966641b9b066b6b40ce77592b6eea644
2012-07-07T17:04:38.829891Z
30
yasahiro93
1199
PlayerDeathEventArgs.cs
file
2016-02-16T17:04:51.056990Z
038ab995902bc34d0a7366be45e664a9
2012-07-07T17:04:38.829891Z
30
yasahiro93
1212
PlayerStateChangeEventArgs.cs
file
2016-02-16T17:04:51.056990Z
35ce0c40421ea8709bd68fca0e628481
2012-07-07T17:04:38.829891Z
30
yasahiro93
1178
PlayerPickUpPickupEventArgs.cs
file
2016-02-16T17:04:51.056990Z
4d984d32c5d5daa7a161c6da5da99f36
2012-07-07T17:04:38.829891Z
30
yasahiro93
800
PlayerSpawnEventArgs.cs
file
2016-02-16T17:04:51.056990Z
b646d31a7b3e162695e853ca7115a44b
2012-07-07T17:04:38.829891Z
30
yasahiro93
544
PlayerExitVehicleEventArgs.cs
file
2016-02-16T17:04:51.056990Z
61baf0f104f2289e1c873f319c431c27
2012-07-07T17:04:38.829891Z
30
yasahiro93
835
PlayerDisconnectEventArgs.cs
file
2016-02-16T17:04:51.056990Z
f98b0a034d15b38946714cc7bdba8d17
2012-07-07T17:04:38.829891Z
30
yasahiro93
830
PlayerEnterVehicleEventArgs.cs
file
2016-02-16T17:04:51.056990Z
55a561c55381bf3e60fb084680b99330
2012-07-07T17:04:38.829891Z
30
yasahiro93
1465
PlayerRequestClassEventArgs.cs
file
2016-02-16T17:04:51.056990Z
c31691ed428cbe7440393314ace03b4a
2012-07-07T17:04:38.829891Z
30
yasahiro93
1103
PlayerEnterExitModShopEventArgs.cs
file
2016-02-16T17:04:51.056990Z
6dc5f7e9175bb03893aa85364cec87fe
2012-07-07T17:04:38.829891Z
30
yasahiro93
1356

View File

@ -0,0 +1,38 @@
using System;
namespace SAMP.API.EventData
{
public class PlayerClickMapEventArgs : EventArgs
{
#region Class Variables
private Vector3 _qPosition;
#endregion
#region Constructor
/// <summary>
/// Creates a new PlayerClickMapEventArgs object.
/// </summary>
/// <param name="position">The coordinates of where the player clicked.</param>
public PlayerClickMapEventArgs(Vector3 position)
{
_qPosition = position;
}
#endregion
#region Accessors & Mutators
/// <summary>
/// The coordinates of where the player clicked
/// </summary>
public Vector3 Position
{
get { return _qPosition; }
}
#endregion
};
};

View File

@ -0,0 +1,49 @@
using System;
namespace SAMP.API.EventData
{
public class PlayerCommandTextEventArgs : EventArgs
{
#region Class Variables
private string _strMessage;
private bool _bHandled;
#endregion
#region Constructor
/// <summary>
/// Creates a new PlayerCommandTextEventArgs object.
/// </summary>
/// <param name="message">The chat message associated with this PlayerCommandTextEventArgs.</param>
public PlayerCommandTextEventArgs(string message)
{
_strMessage = message;
_bHandled = false;
}
#endregion
#region Accessors & Mutators
/// <summary>
/// Gets the chat message associated with this event.
/// </summary>
public string Message
{
get { return _strMessage; }
}
/// <summary>
/// Gets or sets whether the event was handled. Returning TRUE will prevent the 'SERVER: Unknown Command' message being shown.
/// </summary>
public bool Handled
{
get { return _bHandled; }
set { _bHandled = value; }
}
#endregion
};
};

View File

@ -0,0 +1,49 @@
using System;
namespace SAMP.API.EventData
{
public class PlayerDeathEventArgs : EventArgs
{
#region Class Variables
private Player _qKiller;
private int _nReason;
#endregion
#region Constructor
/// <summary>
/// Creates a new PlayerDeathEventArgs object.
/// </summary>
/// <param name="killer">The player who killed the player who died. NULL if none.</param>
/// <param name="reason">The ID of the reason for the player's death.</param>
public PlayerDeathEventArgs(Player killer, int reason)
{
_qKiller = killer;
_nReason = reason;
}
#endregion
#region Accessors & Mutators
/// <summary>
/// Gets the player who killed the player who died. NULL if none.
/// </summary>
public Player Killer
{
get { return _qKiller; }
}
/// <summary>
/// Gets the ID of the reason for the player's death.
/// </summary>
public int Reason
{
get { return _nReason; }
}
#endregion
};
};

View File

@ -0,0 +1,38 @@
using System;
namespace SAMP.API.EventData
{
public class PlayerDisconnectEventArgs : EventArgs
{
#region Class Variables
private DisconnectReason _qReason;
#endregion
#region Constructor
/// <summary>
/// Creates a new PlayerDisconnectEventArgs object.
/// </summary>
/// <param name="reason">The reason for the disconnect.</param>
public PlayerDisconnectEventArgs(DisconnectReason reason)
{
_qReason = reason;
}
#endregion
#region Accessors & Mutators
/// <summary>
/// The reason they left.
/// </summary>
public DisconnectReason Reason
{
get { return _qReason; }
}
#endregion
};
};

View File

@ -0,0 +1,49 @@
using System;
namespace SAMP.API.EventData
{
public class PlayerEnterExitModShopEventArgs : EventArgs
{
#region Class Variables
private bool _bEntering;
private int _nInterior;
#endregion
#region Constructor
/// <summary>
/// Creates a new PlayerEnterExitModShopEventArgs object.
/// </summary>
/// <param name="entering">TRUE if the player is entering, FALSE otherwise.</param>
/// <param name="interiodid">The interior ID of the modshop that the player is entering (or 0 if exiting).</param>
public PlayerEnterExitModShopEventArgs(bool entering, int interiodid)
{
_bEntering = entering;
_nInterior = interiodid;
}
#endregion
#region Accessors & Mutators
/// <summary>
/// Gets whether or not the player is Entering a mod shop.
/// </summary>
public bool Entering
{
get { return _bEntering; }
}
/// <summary>
/// Gets the interior ID of the modshop that the player is entering. This property will be 0 if the player is exiting.
/// </summary>
public int Interior
{
get { return _nInterior; }
}
#endregion
};
};

View File

@ -0,0 +1,57 @@
using System;
namespace SAMP.API.EventData
{
public class PlayerEnterVehicleEventArgs : EventArgs
{
#region Class Variables
private Vehicle _qVehicle;
private bool _bIsPassenger;
#endregion
#region Constructor
/// <summary>
/// Creates a new PlayerEnterVehicleEventArgs object.
/// </summary>
/// <param name="vehicle">The vehicle the player is attempting to enter.</param>
/// <param name="passenger">True = Driver, False = Passenger.</param>
public PlayerEnterVehicleEventArgs(Vehicle vehicle, bool passenger)
{
_qVehicle = vehicle;
_bIsPassenger = passenger;
}
#endregion
#region Accessors & Mutators
/// <summary>
/// Gets whether or not the player was entering as a driver.
/// </summary>
public bool Driver
{
get { return !_bIsPassenger; }
}
/// <summary>
/// Gets whether or not the player was entering as a passenger.
/// </summary>
public bool Passenger
{
get { return _bIsPassenger; }
}
/// <summary>
/// Gets the vehicle the player is attempting to enter.
/// </summary>
public Vehicle Vehicle
{
get { return _qVehicle; }
}
#endregion
};
};

View File

@ -0,0 +1,38 @@
using System;
namespace SAMP.API.EventData
{
public class PlayerExitVehicleEventArgs : EventArgs
{
#region Class Variables
private Vehicle _qVehicle;
#endregion
#region Constructor
/// <summary>
/// Creates a new PlayerExitVehicleEventArgs object.
/// </summary>
/// <param name="vehicle">The vehicle the player is exiting.</param>
public PlayerExitVehicleEventArgs(Vehicle vehicle)
{
_qVehicle = vehicle;
}
#endregion
#region Accessors & Mutators
/// <summary>
/// Gets the vehicle the player is exiting.
/// </summary>
public Vehicle Vehicle
{
get { return _qVehicle; }
}
#endregion
};
};

View File

@ -0,0 +1,38 @@
using System;
namespace SAMP.API.EventData
{
public class PlayerPickUpPickupEventArgs : EventArgs
{
#region Class Variables
private int _nPickupId;
#endregion
#region Constructor
/// <summary>
/// Creates a new PlayerPickUpPickupEventArgs object.
/// </summary>
/// <param name="position">The ID of the pickup.</param>
public PlayerPickUpPickupEventArgs(int pickupid)
{
_nPickupId = pickupid;
}
#endregion
#region Accessors & Mutators
/// <summary>
/// The ID of the pickup.
/// </summary>
public int PickUp
{
get { return _nPickupId; }
}
#endregion
};
};

View File

@ -0,0 +1,48 @@
using System;
namespace SAMP.API.EventData
{
public class PlayerRequestClassEventArgs : EventArgs
{
#region Class Variables
private int _nClassId;
private bool _bCancel;
#endregion
#region Constructor
/// <summary>
/// Creates a new OnPlayerDisconnectEventArgs object.
/// </summary>
/// <param name="reason">The reason for the disconnect.</param>
public PlayerRequestClassEventArgs(int classid)
{
_nClassId = classid;
}
#endregion
#region Accessors & Mutators
/// <summary>
/// The ID of the current class being viewed.
/// </summary>
public int Class
{
get { return _nClassId; }
}
/// <summary>
/// Gets or sets whether the event should cancel (class denied.)
/// </summary>
public bool Cancel
{
get { return _bCancel; }
set { _bCancel = value; }
}
#endregion
};
};

View File

@ -0,0 +1,26 @@
using System;
namespace SAMP.API.EventData
{
public class PlayerSpawnEventArgs : EventArgs
{
#region Class Variables
private bool _bCancel;
#endregion
#region Accessors & Mutators
/// <summary>
/// Gets or sets whether the event should be cancelled (send back to class selection).
/// </summary>
public bool Cancel
{
get { return _bCancel; }
set { _bCancel = value; }
}
#endregion
};
};

View File

@ -0,0 +1,48 @@
using System;
namespace SAMP.API.EventData
{
public class PlayerStateChangeEventArgs : EventArgs
{
#region Class Variables
private PlayerState[] state = { PlayerState.None, PlayerState.None };
#endregion
#region Constructor
/// <summary>
/// Creates a new PlayerStateChangeEventArgs object.
/// </summary>
/// <param name="newState">The player's new state.</param>
/// <param name="oldState">The player's old state.</param>
public PlayerStateChangeEventArgs(PlayerState newState, PlayerState oldState)
{
state[0] = newState;
state[1] = oldState;
}
#endregion
#region Accessors & Mutators
/// <summary>
/// Gets the player's new state.
/// </summary>
public PlayerState NewState
{
get { return state[0]; }
}
/// <summary>
/// Gets the player's old state.
/// </summary>
public PlayerState OldState
{
get { return state[1]; }
}
#endregion
};
};

View File

@ -0,0 +1,50 @@
using System;
namespace SAMP.API.EventData
{
public class PlayerTextEventArgs : EventArgs
{
#region Class Variables
private string _strMessage;
private bool _bCancel;
internal bool _bSet = false;
#endregion
#region Constructor
/// <summary>
/// Creates a new PlayerTextEventArgs object.
/// </summary>
/// <param name="message">The chat message associated with this PlayerTextEventArgs.</param>
public PlayerTextEventArgs(string message)
{
_strMessage = message;
_bCancel = false;
}
#endregion
#region Accessors & Mutators
/// <summary>
/// Gets the chat message.
/// </summary>
public string Message
{
get { return _strMessage; }
}
/// <summary>
/// Gets or sets whether the event should cancel (chat message displayed).
/// </summary>
public bool Cancel
{
get { return _bCancel; }
set { _bCancel = value; _bSet = true; }
}
#endregion
};
};

View File

@ -1,22 +1,24 @@
using System;
namespace SAMP.API.EventData {
public class PlayerClickMapEventArgs : EventArgs {
namespace SAMP.API.EventData
{
public class PlayerClickMapEventArgs : EventArgs
{
#region Class Variables
private Vector3
m_qPosition;
private Vector3 _qPosition;
#endregion
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="SAMP.API.EventData.PlayerClickMapEventArgs"/> class.
/// Creates a new PlayerClickMapEventArgs object.
/// </summary>
/// <param name="position">The coordinates of where the player clicked.</param>
public PlayerClickMapEventArgs(Vector3 position) {
this.m_qPosition = position;
public PlayerClickMapEventArgs(Vector3 position)
{
_qPosition = position;
}
#endregion
@ -26,10 +28,9 @@ namespace SAMP.API.EventData {
/// <summary>
/// The coordinates of where the player clicked
/// </summary>
public Vector3 Position {
get {
return this.m_qPosition;
}
public Vector3 Position
{
get { return _qPosition; }
}
#endregion

View File

@ -1,25 +1,26 @@
using System;
namespace SAMP.API.EventData {
public class PlayerCommandTextEventArgs : EventArgs {
namespace SAMP.API.EventData
{
public class PlayerCommandTextEventArgs : EventArgs
{
#region Class Variables
private string
m_strMessage;
private bool
m_bHandled;
private string _strMessage;
private bool _bHandled;
#endregion
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="SAMP.API.EventData.PlayerCommandTextEventArgs"/> class.
/// Creates a new PlayerCommandTextEventArgs object.
/// </summary>
/// <param name="message">The chat message.</param>
public PlayerCommandTextEventArgs(string message) {
this.m_strMessage = message;
this.m_bHandled = false;
/// <param name="message">The chat message associated with this PlayerCommandTextEventArgs.</param>
public PlayerCommandTextEventArgs(string message)
{
_strMessage = message;
_bHandled = false;
}
#endregion
@ -29,9 +30,9 @@ namespace SAMP.API.EventData {
/// <summary>
/// Gets the chat message associated with this event.
/// </summary>
public string Message {
get {
return this.m_strMessage; }
public string Message
{
get { return _strMessage; }
}
/// <summary>
@ -39,11 +40,8 @@ namespace SAMP.API.EventData {
/// </summary>
public bool Handled
{
get {
return this.m_bHandled;
} set {
this.m_bHandled = value;
}
get { return _bHandled; }
set { _bHandled = value; }
}
#endregion

View File

@ -1,13 +1,13 @@
using System;
namespace SAMP.API.EventData {
public class PlayerDeathEventArgs : EventArgs {
namespace SAMP.API.EventData
{
public class PlayerDeathEventArgs : EventArgs
{
#region Class Variables
private Player
m_qKiller;
private int
m_iReason;
private Player _qKiller;
private int _nReason;
#endregion
@ -18,9 +18,10 @@ namespace SAMP.API.EventData {
/// </summary>
/// <param name="killer">The player who killed the player who died. NULL if none.</param>
/// <param name="reason">The ID of the reason for the player's death.</param>
public PlayerDeathEventArgs(Player killer, int reason) {
this.m_qKiller = killer;
this.m_iReason = reason;
public PlayerDeathEventArgs(Player killer, int reason)
{
_qKiller = killer;
_nReason = reason;
}
#endregion
@ -30,19 +31,17 @@ namespace SAMP.API.EventData {
/// <summary>
/// Gets the player who killed the player who died. NULL if none.
/// </summary>
public Player Killer {
get {
return this.m_qKiller;
}
public Player Killer
{
get { return _qKiller; }
}
/// <summary>
/// Gets the ID of the reason for the player's death.
/// </summary>
public int Reason {
get {
return this.m_iReason;
}
public int Reason
{
get { return _nReason; }
}
#endregion

View File

@ -1,22 +1,24 @@
using System;
namespace SAMP.API.EventData {
public class PlayerDisconnectEventArgs : EventArgs {
namespace SAMP.API.EventData
{
public class PlayerDisconnectEventArgs : EventArgs
{
#region Class Variables
private DisconnectReason
m_qReason;
private DisconnectReason _qReason;
#endregion
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="SAMP.API.EventData.PlayerDisconnectEventArgs"/> class.
/// Creates a new PlayerDisconnectEventArgs object.
/// </summary>
/// <param name="reason">The reason for the disconnect.</param>
public PlayerDisconnectEventArgs(DisconnectReason reason) {
this.m_qReason = reason;
public PlayerDisconnectEventArgs(DisconnectReason reason)
{
_qReason = reason;
}
#endregion
@ -26,10 +28,9 @@ namespace SAMP.API.EventData {
/// <summary>
/// The reason they left.
/// </summary>
public DisconnectReason Reason {
get {
return this.m_qReason;
}
public DisconnectReason Reason
{
get { return _qReason; }
}
#endregion

View File

@ -1,26 +1,27 @@
using System;
namespace SAMP.API.EventData {
public class PlayerEnterExitModShopEventArgs : EventArgs {
namespace SAMP.API.EventData
{
public class PlayerEnterExitModShopEventArgs : EventArgs
{
#region Class Variables
private bool
m_bEntering;
private int
m_iInterior;
private bool _bEntering;
private int _nInterior;
#endregion
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="SAMP.API.EventData.PlayerEnterExitModShopEventArgs"/> class.
/// Creates a new PlayerEnterExitModShopEventArgs object.
/// </summary>
/// <param name="entering"><c>true</c> if the player is entering, otherwise <c>false</c>.</param>
/// <param name="entering">TRUE if the player is entering, FALSE otherwise.</param>
/// <param name="interiodid">The interior ID of the modshop that the player is entering (or 0 if exiting).</param>
public PlayerEnterExitModShopEventArgs(bool entering, int interiodid) {
this.m_bEntering = entering;
this.m_iInterior = interiodid;
public PlayerEnterExitModShopEventArgs(bool entering, int interiodid)
{
_bEntering = entering;
_nInterior = interiodid;
}
#endregion
@ -30,19 +31,17 @@ namespace SAMP.API.EventData {
/// <summary>
/// Gets whether or not the player is Entering a mod shop.
/// </summary>
public bool Entering {
get {
return this.m_bEntering;
}
public bool Entering
{
get { return _bEntering; }
}
/// <summary>
/// Gets the interior ID of the modshop that the player is entering. This property will be 0 if the player is exiting.
/// </summary>
public int Interior {
get {
return this.m_iInterior;
}
public int Interior
{
get { return _nInterior; }
}
#endregion

View File

@ -1,22 +1,24 @@
using System;
namespace SAMP.API.EventData {
public class PlayerExitVehicleEventArgs : EventArgs {
namespace SAMP.API.EventData
{
public class PlayerExitVehicleEventArgs : EventArgs
{
#region Class Variables
private Vehicle
m_qVehicle;
private Vehicle _qVehicle;
#endregion
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="SAMP.API.EventData.PlayerExitVehicleEventArgs"/> class.
/// Creates a new PlayerExitVehicleEventArgs object.
/// </summary>
/// <param name="vehicle">The vehicle the player is exiting.</param>
public PlayerExitVehicleEventArgs(Vehicle vehicle) {
this.m_qVehicle = vehicle;
public PlayerExitVehicleEventArgs(Vehicle vehicle)
{
_qVehicle = vehicle;
}
#endregion
@ -26,10 +28,9 @@ namespace SAMP.API.EventData {
/// <summary>
/// Gets the vehicle the player is exiting.
/// </summary>
public Vehicle Vehicle {
get {
return this.m_qVehicle;
}
public Vehicle Vehicle
{
get { return _qVehicle; }
}
#endregion

View File

@ -1,22 +1,24 @@
using System;
namespace SAMP.API.EventData {
public class PlayerPickUpPickupEventArgs : EventArgs {
namespace SAMP.API.EventData
{
public class PlayerPickUpPickupEventArgs : EventArgs
{
#region Class Variables
private int
m_iId;
private int _nPickupId;
#endregion
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="SAMP.API.EventData.PlayerPickUpPickupEventArgs"/> class.
/// Creates a new PlayerPickUpPickupEventArgs object.
/// </summary>
/// <param name="position">The ID of the pickup.</param>
public PlayerPickUpPickupEventArgs(int pickupid) {
this.m_iId = pickupid;
public PlayerPickUpPickupEventArgs(int pickupid)
{
_nPickupId = pickupid;
}
#endregion
@ -26,10 +28,9 @@ namespace SAMP.API.EventData {
/// <summary>
/// The ID of the pickup.
/// </summary>
public int PickUp {
get {
return this.m_iId;
}
public int PickUp
{
get { return _nPickupId; }
}
#endregion

View File

@ -1,24 +1,25 @@
using System;
namespace SAMP.API.EventData {
public class PlayerRequestClassEventArgs : EventArgs {
namespace SAMP.API.EventData
{
public class PlayerRequestClassEventArgs : EventArgs
{
#region Class Variables
private int
m_iClassId;
private bool
m_bCancel;
private int _nClassId;
private bool _bCancel;
#endregion
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="SAMP.API.EventData.PlayerRequestClassEventArgs"/> class.
/// Creates a new OnPlayerDisconnectEventArgs object.
/// </summary>
/// <param name="reason">The reason for the disconnect.</param>
public PlayerRequestClassEventArgs(int classid) {
m_iClassId = classid;
public PlayerRequestClassEventArgs(int classid)
{
_nClassId = classid;
}
#endregion
@ -28,21 +29,18 @@ namespace SAMP.API.EventData {
/// <summary>
/// The ID of the current class being viewed.
/// </summary>
public int Class {
get {
return this.m_iClassId;
}
public int Class
{
get { return _nClassId; }
}
/// <summary>
/// Gets or sets whether the event should cancel (class denied.)
/// </summary>
public bool Cancel {
get {
return this.m_bCancel;
} set {
this.m_bCancel = value;
}
public bool Cancel
{
get { return _bCancel; }
set { _bCancel = value; }
}
#endregion

View File

@ -1,11 +1,12 @@
using System;
namespace SAMP.API.EventData {
public class PlayerSpawnEventArgs : EventArgs {
namespace SAMP.API.EventData
{
public class PlayerSpawnEventArgs : EventArgs
{
#region Class Variables
private bool
m_bCancel;
private bool _bCancel;
#endregion
@ -16,11 +17,8 @@ namespace SAMP.API.EventData {
/// </summary>
public bool Cancel
{
get {
return this.m_bCancel;
} set {
this.m_bCancel = value;
}
get { return _bCancel; }
set { _bCancel = value; }
}
#endregion

View File

@ -1,7 +1,9 @@
using System;
namespace SAMP.API.EventData {
public class PlayerStateChangeEventArgs : EventArgs {
namespace SAMP.API.EventData
{
public class PlayerStateChangeEventArgs : EventArgs
{
#region Class Variables
private PlayerState[] state = { PlayerState.None, PlayerState.None };
@ -11,13 +13,14 @@ namespace SAMP.API.EventData {
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="SAMP.API.EventData.PlayerStateChangeEventArgs"/> class.
/// Creates a new PlayerStateChangeEventArgs object.
/// </summary>
/// <param name="newState">The player's new state.</param>
/// <param name="oldState">The player's old state.</param>
public PlayerStateChangeEventArgs(PlayerState newState, PlayerState oldState) {
this.state[0] = newState;
this.state[1] = oldState;
public PlayerStateChangeEventArgs(PlayerState newState, PlayerState oldState)
{
state[0] = newState;
state[1] = oldState;
}
#endregion
@ -27,19 +30,17 @@ namespace SAMP.API.EventData {
/// <summary>
/// Gets the player's new state.
/// </summary>
public PlayerState NewState {
get {
return this.state[0];
}
public PlayerState NewState
{
get { return state[0]; }
}
/// <summary>
/// Gets the player's old state.
/// </summary>
public PlayerState OldState {
get {
return this.state[1];
}
public PlayerState OldState
{
get { return state[1]; }
}
#endregion

View File

@ -1,37 +0,0 @@
using System;
namespace SAMP.API.EventData {
public class PlayerStreamEventArgs : EventArgs {
#region Class Variables
private Player
m_qPlayer;
#endregion
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="SAMP.API.EventData.PlayerStreamEventArgs"/> class.
/// </summary>
/// <param name="forplayer">The player who the player streamed in or out for.</param>
public PlayerStreamEventArgs(Player forplayer) {
this.m_qPlayer = forplayer;
}
#endregion
#region Accessors & Mutators
/// <summary>
/// Gets the player who the player streamed in or out for.
/// </summary>
public Player ForPlayer {
get {
return this.m_qPlayer;
}
}
#endregion
};
};

View File

@ -1,27 +1,27 @@
using System;
namespace SAMP.API.EventData {
public class PlayerTextEventArgs : EventArgs {
namespace SAMP.API.EventData
{
public class PlayerTextEventArgs : EventArgs
{
#region Class Variables
private string
m_strMessage;
private bool
m_bCancel;
internal bool
m_bSet = false;
private string _strMessage;
private bool _bCancel;
internal bool _bSet = false;
#endregion
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="SAMP.API.EventData.PlayerTextEventArgs"/> class.
/// Creates a new PlayerTextEventArgs object.
/// </summary>
/// <param name="message">The chat message associated with this PlayerTextEventArgs.</param>
public PlayerTextEventArgs(string message) {
this.m_strMessage = message;
this.m_bCancel = false;
public PlayerTextEventArgs(string message)
{
_strMessage = message;
_bCancel = false;
}
#endregion
@ -31,22 +31,18 @@ namespace SAMP.API.EventData {
/// <summary>
/// Gets the chat message.
/// </summary>
public string Message {
get {
return this.m_strMessage;
}
public string Message
{
get { return _strMessage; }
}
/// <summary>
/// Gets or sets whether the event should cancel (chat message displayed).
/// </summary>
public bool Cancel {
get {
return this.m_bCancel;
} set {
this.m_bCancel = value;
this.m_bSet = true;
}
public bool Cancel
{
get { return _bCancel; }
set { _bCancel = value; _bSet = true; }
}
#endregion

View File

@ -1,27 +0,0 @@
using System;
namespace SAMP.API.EventData {
public class PlayerUpdateEventArgs : EventArgs {
#region Class Variables
private bool
m_bCancel;
#endregion
#region Accessors & Mutators
/// <summary>
/// Gets or sets whether the event should cancel.
/// </summary>
public bool Cancel {
get {
return this.m_bCancel;
} set {
this.m_bCancel = value;
}
}
#endregion
};
};

View File

@ -1,24 +1,25 @@
using System;
namespace SAMP.API.EventData {
public class RconCommandEventArgs : EventArgs {
namespace SAMP.API.EventData
{
public class RconCommandEventArgs : EventArgs
{
#region Class Variables
private string
m_strCommand;
private bool
m_bHandled;
private string _strCommand;
private bool _bHandled;
#endregion
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="SAMP.API.EventData.RconCommandEventArgs"/> class.
/// Creates a new RconCommandEventArgs object.
/// </summary>
/// <param name="command">The command entered.</param>
public RconCommandEventArgs(string command) {
this.m_strCommand = command;
public RconCommandEventArgs(string command)
{
_strCommand = command;
}
#endregion
@ -28,21 +29,18 @@ namespace SAMP.API.EventData {
/// <summary>
/// Gets the chat message associated with this event.
/// </summary>
public string Command {
get {
return this.m_strCommand;
}
public string Command
{
get { return _strCommand; }
}
/// <summary>
/// Gets or sets whether the event was handled. Returning TRUE will prevent the command being passed to other scripts.
/// </summary>
public bool Handled {
get {
return this.m_bHandled;
} set {
this.m_bHandled = value;
}
public bool Handled
{
get { return _bHandled; }
set { _bHandled = value; }
}
#endregion

View File

@ -1,62 +0,0 @@
using System;
namespace SAMP.API.EventData {
public class RconLoginAttemptEventArgs : EventArgs {
#region Class Variables
private string
m_strIp,
m_strPassword;
private bool
m_bSuccess;
#endregion
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="SAMP.API.EventData.RconLoginAttemptEventArgs"/> class.
/// </summary>
/// <param name="ip">The IP of the player that tried to login to RCON.</param>
/// <param name="password">The password used to login with.</param>
/// <param name="success">False if the password was incorrect or True if it was correct.</param>
public RconLoginAttemptEventArgs(string ip, string password, bool success) {
this.m_strIp = ip;
this.m_strPassword = password;
this.m_bSuccess = success;
}
#endregion
#region Accessors & Mutators
/// <summary>
/// Gets the IP of the player that tried to login to RCON.
/// </summary>
public string IP {
get {
return this.m_strIp;
}
}
/// <summary>
/// Gets the password used to login with.
/// </summary>
public string Password {
get {
return this.m_strPassword;
}
}
/// <summary>
/// Gets whether or not the password was correct.
/// </summary>
public bool Success {
get {
return this.m_bSuccess;
}
}
#endregion
};
};

View File

@ -0,0 +1,11 @@
K 25
svn:wc:ra_dav:version-url
V 62
/svn/!svn/ver/30/branches/0.2/sampdotnet/API/EventData/Vehicle
END
VehicleDeathEventArgs.cs
K 25
svn:wc:ra_dav:version-url
V 87
/svn/!svn/ver/30/branches/0.2/sampdotnet/API/EventData/Vehicle/VehicleDeathEventArgs.cs
END

View File

@ -0,0 +1,62 @@
10
dir
33
http://samp-dot-net.googlecode.com/svn/branches/0.2/sampdotnet/API/EventData/Vehicle
http://samp-dot-net.googlecode.com/svn
2012-07-07T17:04:38.829891Z
30
yasahiro93
a955bdad-90f8-2b12-97e1-62c735084bea
VehicleDeathEventArgs.cs
file
2016-02-16T17:04:51.032999Z
8acf669b8e88ba1897b39a4ab18be97c
2012-07-07T17:04:38.829891Z
30
yasahiro93
816

View File

@ -0,0 +1,38 @@
using System;
namespace SAMP.API.EventData
{
public class VehicleDeathEventArgs : EventArgs
{
#region Class Variables
private Player _qKiller;
#endregion
#region Constructor
/// <summary>
/// Creates a new VehicleDeathEventArgs object.
/// </summary>
/// <param name="killer">The player who destroyed the vehicle.</param>
public VehicleDeathEventArgs(Player killer)
{
_qKiller = killer;
}
#endregion
#region Accessors & Mutators
/// <summary>
/// Gets the player who destroyed the vehicle.
/// </summary>
public Player Killer
{
get { return _qKiller; }
}
#endregion
};
};

View File

@ -1,22 +1,24 @@
using System;
namespace SAMP.API.EventData {
public class VehicleDeathEventArgs : EventArgs {
namespace SAMP.API.EventData
{
public class VehicleDeathEventArgs : EventArgs
{
#region Class Variables
private Player
m_qKiller;
private Player _qKiller;
#endregion
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="SAMP.API.EventData.VehicleDeathEventArgs"/> class.
/// Creates a new VehicleDeathEventArgs object.
/// </summary>
/// <param name="killer">The player who destroyed the vehicle.</param>
public VehicleDeathEventArgs(Player killer) {
this.m_qKiller = killer;
public VehicleDeathEventArgs(Player killer)
{
_qKiller = killer;
}
#endregion
@ -26,10 +28,9 @@ namespace SAMP.API.EventData {
/// <summary>
/// Gets the player who destroyed the vehicle.
/// </summary>
public Player Killer {
get {
return this.m_qKiller;
}
public Player Killer
{
get { return _qKiller; }
}
#endregion

View File

@ -1,37 +0,0 @@
using System;
namespace SAMP.API.EventData {
public class VehicleStreamEventArgs : EventArgs {
#region Class Variables
private Player
m_qPlayer;
#endregion
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="SAMP.API.EventData.VehicleStreamEventArgs"/> class.
/// </summary>
/// <param name="forplayer">The player who the vehicle streamed in or out for.</param>
public VehicleStreamEventArgs(Player forplayer) {
this.m_qPlayer = forplayer;
}
#endregion
#region Accessors & Mutators
/// <summary>
/// Gets the player who the vehicle streamed in or out for.
/// </summary>
public Player ForPlayer {
get {
return this.m_qPlayer;
}
}
#endregion
};
};

View File

@ -0,0 +1,175 @@
using System;
namespace SAMP.API
{
public class GameMode
{
#region Class Variables
private static bool _bGameModeInitialized = false;
private static bool _bPlayerPedAnims = false;
private static int _nClassCount = 0;
private static int _nTeamCount = 0;
private static string _strGameModeText = string.Empty;
#endregion
#region Events & Delegates
public delegate void OnInitHandler(object sender, EventArgs e);
public delegate void OnExitHandler(object sender, EventArgs e);
public static event OnInitHandler OnInit;
public static event OnExitHandler OnExit;
#endregion
#region Accessors & Mutators
[Obsolete("This property is deprecated. Please see the SAMP.API.Player.OnClickMap event.", true)]
/// <summary>
/// Gets or sets whether RCON admins will be teleported to their waypoint when they set one.
/// </summary>
public static bool AllowAdminTeleport { get { return false; } set { } }
[Obsolete("This property is deprecated.", true)]
/// <summary>
/// Gets or sets the amount of money dropped when a player dies.
/// </summary>
public static int DeathDropAmount { get { return 0; } set { } }
[Obsolete("This property is deprecated due to crashes it caused.", true)]
/// <summary>
/// Gets or sets the zone / area names being shown on screen as a player enters the area.
/// </summary>
public static bool ZoneNames { get { return false; } set { } }
/// <summary>
/// Gets the amount of player classes used in the gamemode.
/// </summary>
public static int ClassCount
{
get { return _nClassCount; }
}
// Pointless property, but meh - I tried to port everything.
/// <summary>
/// Gets or sets the amount of teams used in the gamemode.
/// </summary>
/// <remarks>You can pass 2 billion here if you like, this function has no effect at all.</remarks>
public static int TeamCount
{
get { return _nTeamCount; }
set { _nTeamCount = value; Core.Natives.SetTeamCount(value); }
}
/// <summary>
/// Gets or sets the name of the gamemode, which appears in the list of servers.
/// </summary>
public static string Text
{
get { return _strGameModeText; }
set { _strGameModeText = value; Core.Natives.SetGameModeText(value); }
}
/// <summary>
/// Gets or sets whether to use standard player walking animation (animation of CJ)
/// </summary>
/// <remarks>Only works when placed under the SAMP.API.GameMode.Init event.</remarks>
public static bool UsePlayerPedAnims
{
get { return _bPlayerPedAnims; }
set
{
// This property only works under Init event
if(!_bGameModeInitialized)
{
_bPlayerPedAnims = value;
// Check the value was true. We don't want to call the function
// if they didn't intend it to be true.
if(value)
Core.Natives.UsePlayerPedAnims();
}
else
throw Core.Exceptions.GameModeInitialized;
}
}
#endregion
#region Public Methods
/// <summary>
/// Adds a class to class selection.
/// </summary>
/// <param name="skin">The skin which the player will spawn with.</param>
/// <param name="spawnPoint">The spawnpoint of this class.</param>
/// <param name="angle">The direction in which the player should face after spawning.</param>
/// <param name="weapon1">The first spawn-weapon for the player.</param>
/// <param name="weapon1_ammo">The amount of ammunition for the primary spawnweapon.</param>
/// <param name="weapon2">The second spawn-weapon for the player.</param>
/// <param name="weapon2_ammo">The amount of ammunition for the secondary spawnweapon.</param>
/// <param name="weapon3">The third spawn-weapon for the player.</param>
/// <param name="weapon3_ammo">The amount of ammunition for the third spawnweapon.</param>
/// <returns>Returns the ID of the class which was just added.</returns>
/// <remarks>Classes are used so players may spawn with a skin of their choice and so on.</remarks>
/// <example>SAMP.API.GameMode.AddPlayerClass(SAMP.API.Skin.cj, new Vector3(1958.33f, 1343.12f, 15.36f), 269.15, 26, 36, 28, 150, 0, 0);</example>
public int AddPlayerClass(Skin skin, Vector3 spawnPoint, float angle, int weapon1, int weapon1_ammo, int weapon2, int weapon2_ammo, int weapon3, int weapon3_ammo)
{
// Call native
_nClassCount++;
return Core.Natives.AddPlayerClass((int)skin, spawnPoint.X, spawnPoint.Y, spawnPoint.Z, angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
}
/// <summary>
/// Adds a class to class selection, with a team parameter.
/// </summary>
/// <param name="team">The team you want the player to spawn in.</param>
/// <param name="skin">The skin which the player will spawn with.</param>
/// <param name="spawnPoint">The spawnpoint of this class.</param>
/// <param name="angle">The direction in which the player should face after spawning.</param>
/// <param name="weapon1">The first spawn-weapon for the player.</param>
/// <param name="weapon1_ammo">The amount of ammunition for the primary spawnweapon.</param>
/// <param name="weapon2">The second spawn-weapon for the player.</param>
/// <param name="weapon2_ammo">The amount of ammunition for the secondary spawnweapon.</param>
/// <param name="weapon3">The third spawn-weapon for the player.</param>
/// <param name="weapon3_ammo">The amount of ammunition for the third spawnweapon.</param>
/// <returns>Returns the ID of the class which was just added.</returns>
/// <remarks>Classes are used so players may spawn with a skin of their choice and so on.</remarks>
/// <example>SAMP.API.GameMode.AddPlayerClass(15, SAMP.API.Skin.cj, new Vector3(1958.33f, 1343.12f, 15.36f), 269.15, 26, 36, 28, 150, 0, 0);</example>
public int AddPlayerClass(int team, Skin skin, Vector3 spawnPoint, float angle, int weapon1, int weapon1_ammo, int weapon2, int weapon2_ammo, int weapon3, int weapon3_ammo)
{
// Call native
_nClassCount++;
return Core.Natives.AddPlayerClassEx(team, (int)skin, spawnPoint.X, spawnPoint.Y, spawnPoint.Z, angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
}
#endregion
#region Internal Methods
/// <summary>
/// Invoke the OnExit event.
/// </summary>
internal static void _OnExit()
{
try { OnExit(null, null); }
catch { }
_bGameModeInitialized = false;
}
/// <summary>
/// Invoke the OnInit event.
/// </summary>
internal static void _OnInit()
{
try { OnInit(null, null); }
catch { }
_bGameModeInitialized = true;
}
#endregion
};
};

View File

@ -0,0 +1,140 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SAMP.API
{
public class GangZone
{
#region Class Variables
private int _nId;
private Vector2 _qMin, _qMax;
#endregion
#region Constructor
/// <summary>
/// Creates a GangZone (colored radar area).
/// </summary>
/// <param name="min">The south-west side of the gangzone. (X = west, Y = south).</param>
/// <param name="max">The north-east side of the gangzone. (X = east, Y = north).</param>
public GangZone(Vector2 min, Vector2 max)
{
_qMin = min;
_qMax = max;
_nId = Core.Natives.GangZoneCreate(min.X, min.Y, max.X, max.Y);
}
#endregion
#region Accessors & Mutators
/// <summary>
/// Gets the ID of this GangZone.
/// </summary>
internal int ID
{
get { return _nId; }
}
/// <summary>
/// Gets the maximum position.
/// </summary>
public Vector2 Maximum
{
get { return _qMax; }
}
/// <summary>
/// Gets the minimum position.
/// </summary>
public Vector2 Minimum
{
get { return _qMin; }
}
#endregion
#region Public Methods
/// <summary>
/// Makes the GangZone flash for all players.
/// </summary>
/// <param name="color">The color the zone will flash.</param>
public void FlashForAll(Color color)
{
Core.Natives.GangZoneFlashForAll(this.ID, color.ToArgb());
}
/// <summary>
/// Makes the GangZone flash for a player.
/// </summary>
/// <param name="player">The player you would like to hide the GangZone for.</param>
/// <param name="color">The color the zone will flash.</param>
public void FlashForPlayer(Player player, Color color)
{
Core.Natives.GangZoneFlashForPlayer(player.ID, this.ID, color.ToArgb());
}
/// <summary>
/// Hides the GangZone for all players.
/// </summary>
/// <param name="color">The color for the GangZone to be.</param>
public void HideForAll(Color color)
{
Core.Natives.GangZoneHideForAll(this.ID);
}
/// <summary>
/// Hides the GangZone for a player.
/// </summary>
/// <param name="player">The player you would like to hide the GangZone for.</param>
/// <param name="color">The color for the GangZone to be.</param>
public void HideForPlayer(Player player, Color color)
{
Core.Natives.GangZoneHideForPlayer(player.ID, this.ID);
}
/// <summary>
/// Shows the GangZone for all players.
/// </summary>
/// <param name="color">The color for the GangZone to be.</param>
/// <returns>Returns a System.Boolean representing whether or not the GangZone was shown.</returns>
public bool ShowForAll(Color color)
{
return Core.Natives.GangZoneShowForAll(this.ID, color.ToArgb()) == 1;
}
/// <summary>
/// Shows the GangZone for a player.
/// </summary>
/// <param name="player">The player you would like to show the GangZone for.</param>
/// <param name="color">The color for the GangZone to be.</param>
public void ShowForPlayer(Player player, Color color)
{
Core.Natives.GangZoneShowForPlayer(player.ID, this.ID, color.ToArgb());
}
/// <summary>
/// Stops the GangZone flashing for all players.
/// </summary>
public void StopFlashForAll()
{
Core.Natives.GangZoneStopFlashForAll(this.ID);
}
/// <summary>
/// Stops the GangZone flashing for a player.
/// </summary>
/// <param name="player">The player you would like to hide the GangZone for.</param>
public void StopFlashForPlayer(Player player)
{
Core.Natives.GangZoneStopFlashForPlayer(player.ID, this.ID);
}
#endregion
};
};

View File

@ -0,0 +1,116 @@
using System.Collections.Generic;
namespace SAMP.API
{
public class Menu
{
#region Class Variables
private static List<Menu> _qMenuStore = new List<Menu>();
private int _nId = -1;
#endregion
#region Constructor
/// <summary>
/// Creates a new Menu object.
/// </summary>
/// <param name="title">The title for the new menu.</param>
/// <param name="columns">How many colums shall the new menu have.</param>
/// <param name="position">The position of the menu.</param>
/// <param name="col1width">The width for the first column.</param>
/// <param name="col2width">The width for the second column.</param>
public Menu(string title, int columns, Vector2 position, float col1width, float col2width=0.0f)
{
_nId = Core.Natives.CreateMenu(title, columns, position.X, position.Y, col1width, col2width);
_qMenuStore.Add(this);
}
#endregion
#region Accessors & Mutators
/// <summary>
/// Gets the ID of this Menu.
/// </summary>
internal int ID
{
get { return _nId; }
}
/// <summary>
/// Sets the caption of a column in the menu.
/// </summary>
/// <param name="column">Which column in the menu shall be manipulated.</param>
/// <param name="text">The caption-text for the column.</param>
public void SetColumnHeader(int column, string text)
{
Core.Natives.SetMenuColumnHeader(this.ID, column, text);
}
#endregion
#region Public Methods
/// <summary>
/// Finds the Menu whose ID is menuid.
/// </summary>
/// <param name="menuid">The menu ID to search for.</param>
/// <returns>Returns a Menu whose ID is menuid.</returns>
internal static Menu Get(int menuid)
{
foreach(Menu menu in _qMenuStore)
if(menu.ID == menuid)
return menu;
return null;
}
/// <summary>
/// Determines whether the specified menu ID is valid.
/// </summary>
/// <param name="menuid">The menu ID to check.</param>
/// <returns>Returns a System.Boolean representing whether the specified menu ID is valid.</returns>
public static bool IsValid(Menu menu)
{
return Core.Natives.IsValidMenu(menu.ID) == 1;
}
/// <summary>
/// Adds an item to the Menu.
/// </summary>
/// <param name="title">The title for the new menu item.</param>
/// <param name="column">The column to add the item to.</param>
public void AddItem(string title, int column = 0)
{
Core.Natives.AddMenuItem(this.ID, column, title);
}
/// <summary>
/// Destroys the Menu. Setting the object to null (destructing) calls this method.
/// </summary>
public bool Destroy()
{
_qMenuStore.Remove(this);
return Core.Natives.DestroyMenu(this.ID) == 1;
}
/// <summary>
/// Disables the Menu.
/// </summary>
public void Disable()
{
Core.Natives.DestroyMenu(this.ID);
}
/// <summary>
/// Disables a row in the menu.
/// </summary>
public void DisableRow(int row)
{
Core.Natives.DisableMenuRow(this.ID, row);
}
#endregion
};
};

View File

@ -0,0 +1,703 @@
using System.Collections;
using System.Collections.Generic;
using System.Text;
namespace SAMP.API
{
public class Player : Core.IWorldEntity, Core.ICountable
{
#region Class Variables
private bool _bFindZOnPosChange;
private int _nPlayerID;
private int _nSeat;
private SpawnInfo _qSpawnInfo;
private PlayerCamera _qCamera;
internal static Hashtable playerStore = new Hashtable();
internal Hashtable variables = new Hashtable();
#endregion
#region Constructor
/// <summary>
/// Creates a new Player object.
/// <param name="id">The ID of the player.</param>
/// </summary>
internal Player(int id)
{
_nPlayerID = id;
_qCamera = new PlayerCamera(this);
_qSpawnInfo = new API.SpawnInfo(this);
}
#endregion
#region Accessors & Mutators
/// <summary>
/// Gets an array representing the currently connected players.
/// </summary>
public static Player[] All
{
get
{
// Create a temporary buffer list to store the player collection
List<Player> l = new List<Player>();
// Iterate through the player collection
foreach(DictionaryEntry line in playerStore)
{
// Add the current player entry to the buffer
l.Add((Player)line.Value);
}
// Return an array representing the players
return l.ToArray();
}
}
/// <summary>
/// Gets or sets the player's facing angle.
/// </summary>
public float Angle
{
get
{
float angle = 0f;
Core.Natives.GetPlayerFacingAngle(this.ID, ref angle);
return angle;
}
set
{
Core.Natives.SetPlayerFacingAngle(this.ID, value);
}
}
/// <summary>
/// Gets or sets the player's armour.
/// </summary>
public float Armour
{
get
{
float armour = 0f;
Core.Natives.GetPlayerArmour(this.ID, ref armour);
return armour;
}
set
{
Core.Natives.SetPlayerArmour(this.ID, value);
}
}
/// <summary>
/// Gets the PlayerCamera associated with this player (for use with GetPlayerCameraPos etc.)
/// </summary>
public PlayerCamera Camera
{
get
{
return _qCamera;
}
}
/// <summary>
/// Gets or sets whether the player's position adjusts on the Z axis to the nearest solid ground under the position.
/// NOTE: This value is reset to FALSE after every position change.
/// </summary>
public bool FindZOnPosChange
{
get { return _bFindZOnPosChange; }
set { _bFindZOnPosChange = value; }
}
/// <summary>
/// Gets or sets the player's health.
/// </summary>
public float Health
{
get
{
float health = 0f;
Core.Natives.GetPlayerHealth(this.ID, ref health);
return health;
}
set
{
Core.Natives.SetPlayerHealth(this.ID, value);
}
}
/// <summary>
/// Gets the player's ID.
/// </summary>
public int ID
{
get { return this._nPlayerID; }
}
/// <summary>
/// Gets the player's IP address.
/// </summary>
public string IPAddress
{
get
{
StringBuilder sb = new StringBuilder(16);
Core.Natives.GetPlayerIp(this.ID, sb, sb.Capacity);
return sb.ToString();
}
}
/// <summary>
/// Gets whether the player is logged into RCON.
/// </summary>
public bool IsAdmin
{
get { return Core.Natives.IsPlayerAdmin(this.ID) == 1; }
}
/// <summary>
/// Gets the Menu the player is currently viewing, or NULL if they aren't viewing one.
/// </summary>
public Menu Menu
{
get
{
int menuid = Core.Natives.GetPlayerMenu(this.ID);
return menuid == 255 ? null : Menu.Get(menuid);
}
}
/// <summary>
/// Gets the player's name
/// </summary>
public string Name
{
get
{
StringBuilder sb = new StringBuilder(24);
Core.Natives.GetPlayerName(this.ID, sb, sb.Capacity);
return sb.ToString();
}
}
/// <summary>
/// Gets or sets the player's money.
/// </summary>
public int Money
{
get
{
return Core.Natives.GetPlayerMoney(this.ID);
}
set
{
Core.Natives.ResetPlayerMoney(this.ID);
Core.Natives.GivePlayerMoney(this.ID, value);
}
}
/// <summary>
/// Gets or sets a player's position.
/// </summary>
public Vector3 Position
{
get
{
float
x = 0f,
y = 0f,
z = 0f;
Core.Natives.GetPlayerPos(this.ID, ref x, ref y, ref z);
return new Vector3(x, y, z);
}
set
{
if(this.FindZOnPosChange)
{
this.FindZOnPosChange = false;
Core.Natives.SetPlayerPosFindZ(this.ID, value.X, value.Y, value.Z);
}
else
Core.Natives.SetPlayerPos(this.ID, value.X, value.Y, value.Z);
}
}
/// <summary>
/// Gets or sets the seat of the vehicle the player is in.
/// </summary>
public int Seat
{
get
{
return Core.Natives.GetPlayerVehicleSeat(this.ID);
}
set
{
if(Core.Natives.IsPlayerInAnyVehicle(this.ID) == 0)
_nSeat = value;
else
Core.Natives.PutPlayerInVehicle(this.ID, this.Vehicle.ID, value);
}
}
/// <summary>
/// Gets or sets the player's skin.
/// </summary>
public int Skin
{
get
{
return Core.Natives.GetPlayerSkin(this.ID);
}
set
{
Core.Natives.SetPlayerSkin(this.ID, value);
}
}
/// <summary>
/// Gets the SpawnInfo of this player.
/// </summary>
public SpawnInfo SpawnInfo
{
get { return _qSpawnInfo; }
}
/// <summary>
/// Gets or sets a player's vehicle.
/// </summary>
public Vehicle Vehicle
{
get
{
if(Core.Natives.IsPlayerInAnyVehicle(this.ID) == 0)
return null;
return Vehicle.Get(Core.Natives.GetPlayerVehicleID(this.ID));
}
set
{
if(value == null)
Core.Natives.RemovePlayerFromVehicle(this.ID);
else
Core.Natives.PutPlayerInVehicle(this.ID, value.ID, _nSeat);
}
}
/// <summary>
/// Gets the player's client version.
/// </summary>
public string Version
{
get
{
StringBuilder sb = new StringBuilder(10);
Core.Natives.GetPlayerVersion(this.ID, sb, sb.Capacity);
return sb.ToString();
}
}
#endregion
#region Public Methods
/// <summary>
/// Gets a player by their player ID.
/// </summary>
/// <param name="playerid">The player ID to search for.</param>
/// <returns>Returns a Player object whose ID is playerid, or NULL if no such player is connected.</returns>
public static Player Get(int playerid)
{
// Iterate through the player collection store
foreach(DictionaryEntry d in playerStore)
{
if(d.Key.Equals(playerid))
return (Player)d.Value;
}
// The player doesn't exist.
return null;
}
/// <summary>
/// Bans the player from the server. Bans are IP-based, and stored in samp.ban.
/// </summary>
public void Ban()
{
Core.Natives.Ban(this.ID);
}
/// <summary>
/// Bans the player from the server with a reason. Bans are IP-based, and stored in samp.ban.
/// </summary>
public void Ban(string reason)
{
Core.Natives.BanEx(this.ID, reason);
}
/// <summary>
/// Gets all players in a given range of this player.
/// </summary>
/// <param name="range">The range to scan.</param>
/// <returns>An array of Player objects representing the players within the given range of this player.</returns>
public Player[] GetInRange(float range)
{
// Create variables
List<Player> buffer = new List<Player>();
Player[] players = Player.All;
// Iterate through the connected players
for(int i = 0; i < players.Length; i++)
{
// Check their distance
if(Vector3.Distance(this.Position, players[i].Position) <= range)
// Add them to the buffer if they are in range
buffer.Add(players[i]);
}
// Return the buffer as an array
return buffer.ToArray();
}
/// <summary>
/// Gives the player a weapon.
/// </summary>
/// <param name="weapon">The ID of the weapon you want to give the player.</param>
/// <param name="ammo">How much ammo to giev the player.</param>
public void GiveWeapon(int weapon, int ammo)
{
Core.Natives.GivePlayerWeapon(this.ID, weapon, ammo);
}
/// <summary>
/// Hides a menu to the player.
/// </summary>
/// <param name="menu">The menu to hide.</param>
public void HideMenu(Menu menu)
{
Core.Natives.HideMenuForPlayer(menu.ID, this.ID);
}
/// <summary>
/// Determines if the player is in any vehicle.
/// </summary>
/// <returns>Returns a System.Boolean representing whether or not the player is in any vehicle.</returns>
public bool IsInVehicle()
{
return Core.Natives.IsPlayerInAnyVehicle(this.ID) == 1;
}
/// <summary>
/// Determines if the player is in the specified vehicle.
/// </summary>
/// <param name="vehicle">The vehicle to check.</param>
/// <returns>Returns a System.Boolean representing whether or not the player is in the vehicle.</returns>
public bool IsInVehicle(Vehicle vehicle)
{
return Core.Natives.IsPlayerInVehicle(this.ID, vehicle.ID) == 1;
}
/// <summary>
/// Determines if a player is streamed in another player's client.
/// </summary>
/// <param name="player">The player to check if this player is streamed in for.</param>
/// <returns>Returns a System.Boolean representing whether or not the player is streamed in for the given player.</returns>
public bool IsStreamedIn(Player player)
{
return Core.Natives.IsPlayerStreamedIn(this.ID, player.ID) == 1;
}
/// <summary>
/// Kicks the player from the server.
/// </summary>
public void Kick()
{
Core.Natives.Kick(this.ID);
}
/// <summary>
/// Show a dialog to the player.
/// </summary>
/// <param name="style">The style of the dialog.</param>
/// <param name="text">The text to display.</param>
/// <param name="caption">The title at the top of the dialog.</param>
/// <param name="button1">The text on the left button.</param>
/// <param name="button2">The text on the right button. Leave blank to hide it.</param>
public void ShowDialog(DialogStyle style, int dialogid, string text, string caption, string button1, string button2 = "")
{
Core.Natives.ShowPlayerDialog(this.ID, dialogid, (int)style, caption, text, button1, button2);
}
/// <summary>
/// Sends a message to the player with white text. SA-MP color embedding is supported.
/// </summary>
/// <param name="message">The string of text you would like to send.</param>
/// <seealso cref="World.SendMessageToAll"/>
public void SendMessage(string message)
{
SendMessage(message, Color.White);
}
/// <summary>
/// Sends a message to the player with the certain color. SA-MP color embedding is supported.
/// </summary>
/// <param name="message">The string of text you would like to send.</param>
/// <param name="color">The color it should be in. This overload supports a SAMP.Color.</param>
/// <seealso cref="World.SendMessageToAll"/>
public void SendMessage(string message, Color color)
{
Core.Natives.SendClientMessage(this.ID, color.ToArgb(), message);
}
/// <summary>
/// Shows a menu to the player.
/// </summary>
/// <param name="menu">The menu to show.</param>
public void ShowMenu(Menu menu)
{
Core.Natives.ShowMenuForPlayer(menu.ID, this.ID);
}
/// <summary>
/// Spawns or respawns the player with the given SpawnInfo.
/// </summary>
public void Spawn()
{
Core.Natives.SpawnPlayer(this.ID);
}
#endregion
#region Events, Delegates and Method Calls
// TODO: Implement more events
#region OnConnect
public delegate void OnConnectHandler(object sender, System.EventArgs e);
public static event OnConnectHandler OnConnect;
internal void _OnConnect()
{
playerStore.Add(this.ID, this);
try { OnConnect(this, null); }
catch { }
}
#endregion
#region OnDisconnect
public delegate void OnDisconnectHandler(object sender, EventData.PlayerDisconnectEventArgs e);
public static event OnDisconnectHandler OnDisconnect;
internal void _OnDisconnect(int reason)
{
// Remove from collection
Player.playerStore.Remove(this.ID);
EventData.PlayerDisconnectEventArgs args = new EventData.PlayerDisconnectEventArgs((DisconnectReason)reason);
try { OnDisconnect(this, args); }
catch { }
}
#endregion
#region OnDeath
public delegate void OnDeathHandler(object sender, EventData.PlayerDeathEventArgs e);
public static event OnDeathHandler OnDeath;
internal void _OnDeath(Player killer, int reason)
{
EventData.PlayerDeathEventArgs args = new EventData.PlayerDeathEventArgs(killer, reason);
try { OnDeath(this, args); }
catch { }
}
#endregion
#region OnSpawn
public delegate void OnSpawnHandler(object sender, EventData.PlayerSpawnEventArgs e);
public static event OnSpawnHandler OnSpawn;
internal void _OnSpawn(ref bool cancel)
{
EventData.PlayerSpawnEventArgs args = new EventData.PlayerSpawnEventArgs();
try { OnSpawn(this, args); cancel = args.Cancel; }
catch { }
}
#endregion
#region OnText
public delegate void OnTextHandler(object sender, EventData.PlayerTextEventArgs e);
public static event OnTextHandler OnText;
internal int _OnText(string text)
{
EventData.PlayerTextEventArgs args = new EventData.PlayerTextEventArgs(text);
try { OnText(this, args); }
catch { }
return args.Cancel ? 0 : 1;
}
#endregion
#region OnCommandText
public delegate void OnCommandTextHandler(object sender, EventData.PlayerCommandTextEventArgs e);
public static event OnCommandTextHandler OnCommandText;
internal void _OnCommandText(string text, ref bool handled)
{
EventData.PlayerCommandTextEventArgs args = new EventData.PlayerCommandTextEventArgs(text);
try { OnCommandText(this, args); handled = args.Handled; }
catch { }
}
#endregion
#region OnRequestClass
public delegate void OnRequestClassHandler(object sender, EventData.PlayerRequestClassEventArgs e);
public static event OnRequestClassHandler OnRequestClass;
internal void _OnRequestClass(int classid, ref bool cancel)
{
EventData.PlayerRequestClassEventArgs args = new EventData.PlayerRequestClassEventArgs(classid);
try { OnRequestClass(this, args); cancel = args.Cancel; }
catch { }
}
#endregion
#region OnEnterVehicle
public delegate void OnEnterVehicleHandler(object sender, EventData.PlayerEnterVehicleEventArgs e);
public static event OnEnterVehicleHandler OnEnterVehicle;
internal void _OnEnterVehicle(int vehicleid, bool ispassenger)
{
EventData.PlayerEnterVehicleEventArgs args = new EventData.PlayerEnterVehicleEventArgs(Vehicle.Get(vehicleid), ispassenger);
try { OnEnterVehicle(this, args); }
catch { }
}
#endregion
#region OnExitVehicle
public delegate void OnExitVehicleHandler(object sender, EventData.PlayerExitVehicleEventArgs e);
public static event OnExitVehicleHandler OnExitVehicle;
internal void _OnExitVehicle(int vehicleid)
{
EventData.PlayerExitVehicleEventArgs args = new EventData.PlayerExitVehicleEventArgs(Vehicle.Get(vehicleid));
try { OnExitVehicle(this, args); }
catch { }
}
#endregion
#region OnStateChange
public delegate void OnStateChangeHandler(object sender, EventData.PlayerStateChangeEventArgs e);
public static event OnStateChangeHandler OnStateChange;
internal void _OnStateChange(int newstate, int oldstate)
{
EventData.PlayerStateChangeEventArgs args = new EventData.PlayerStateChangeEventArgs((PlayerState)newstate, (PlayerState)oldstate);
try { OnStateChange(this, args); }
catch { }
}
#endregion
#region OnEnterCheckpoint
public delegate void OnEnterCheckpointHandler(object sender, System.EventArgs e);
public static event OnEnterCheckpointHandler OnEnterCheckpoint;
internal void _OnEnterCheckpoint()
{
try { OnEnterCheckpoint(this, null); }
catch { }
}
#endregion
#region OnLeaveCheckpoint
public delegate void OnLeaveCheckpointHandler(object sender, System.EventArgs e);
public static event OnLeaveCheckpointHandler OnLeaveCheckpoint;
internal void _OnLeaveCheckpoint()
{
try { OnLeaveCheckpoint(this, null); }
catch { }
}
#endregion
#region OnEnterRaceCheckpoint
public delegate void OnEnterRaceCheckpointHandler(object sender, System.EventArgs e);
public static event OnEnterRaceCheckpointHandler OnEnterRaceCheckpoint;
internal void _OnEnterRaceCheckpoint()
{
try { OnEnterRaceCheckpoint(this, null); }
catch { }
}
#endregion
#region OnLeaveRaceCheckpoint
public delegate void OnLeaveRaceCheckpointHandler(object sender, System.EventArgs e);
public static event OnLeaveRaceCheckpointHandler OnLeaveRaceCheckpoint;
internal void _OnLeaveRaceCheckpoint()
{
try { OnLeaveRaceCheckpoint(this, null); }
catch { }
}
#endregion
#region OnRequestSpawn
public delegate void OnRequestSpawnHandler(object sender, EventData.PlayerSpawnEventArgs e);
public static event OnRequestSpawnHandler OnRequestSpawn;
internal int _OnRequestSpawn()
{
EventData.PlayerSpawnEventArgs args = new EventData.PlayerSpawnEventArgs();
try { OnRequestSpawn(this, args); }
catch { }
return args.Cancel ? 0 : 1;
}
#endregion
#region OnEnterExitModShop
public delegate void OnEnterExitModShopHandler(object sender, EventData.PlayerEnterExitModShopEventArgs e);
public static event OnEnterExitModShopHandler OnEnterExitModShop;
internal void _OnEnterExitModShop(int enterexit, int interiodid)
{
EventData.PlayerEnterExitModShopEventArgs args = new EventData.PlayerEnterExitModShopEventArgs(enterexit == 1, interiodid);
try { OnEnterExitModShop(this, args); }
catch { }
}
#endregion
#region OnPickupPickUp
public delegate void OnPickUpPickupHandler(object sender, EventData.PlayerPickUpPickupEventArgs e);
public static event OnPickUpPickupHandler OnPickUpPickup;
internal void _OnPickupPickUp(int pickupid)
{
EventData.PlayerPickUpPickupEventArgs args = new EventData.PlayerPickUpPickupEventArgs(pickupid);
try { OnPickUpPickup(this, args); }
catch { }
}
#endregion
#region OnClickMap
public delegate void OnClickMapHandler(object sender, EventData.PlayerClickMapEventArgs e);
public static event OnClickMapHandler OnClickMap;
internal void _OnClickMap(float x, float y, float z)
{
switch(0)
{
case 0:
case 1:
goto case 2;
case 2:
goto default;
default:
break;
}
EventData.PlayerClickMapEventArgs args = new EventData.PlayerClickMapEventArgs(new Vector3(x, y, z));
try { OnClickMap(this, args); }
catch { }
}
#endregion
#region OnDialogResponse
public delegate void OnDialogResponseHandler(object sender, EventData.DialogResponseEventArgs e);
public static event OnDialogResponseHandler OnDialogResponse;
internal void _OnDialogResponse(int dialogid, int response, int listitem, string inputtext, ref bool passon)
{
EventData.DialogResponseEventArgs args = new EventData.DialogResponseEventArgs(dialogid, response, listitem, inputtext);
try { OnDialogResponse(this, args); passon = args.ContinueToFilterscripts; }
catch { }
}
#endregion
#endregion
};
};

View File

@ -0,0 +1,71 @@

namespace SAMP.API
{
public class PlayerCamera : Core.IWorldEntity
{
private int _playerid;
/// <summary>
/// Creates a new Camera object relating to a player.
/// </summary>
/// <param name="sender">The Player to attach to.</param>
internal PlayerCamera(Player sender)
{
this._playerid = sender.ID;
}
/// <summary>
/// Gets or sets a player's position.
/// </summary>
public Vector3 Position
{
get
{
float
x = 0f,
y = 0f,
z = 0f;
Core.Natives.GetPlayerCameraPos(_playerid, ref x, ref y, ref z);
return new Vector3(x, y, z);
}
set
{
Core.Natives.SetPlayerCameraPos(_playerid, value.X, value.Y, value.Z);
}
}
/// <summary>
/// Gets or sets the player's camera LookAt value in 3D space.
/// </summary>
/// <remarks>In 0.3a the camera front vector is available when player is inside a tank, S.W.A.T tank, fire truck, or on foot. Since 0.3b the camera data can be obtained when the player is in any vehicle.</remarks>
/// <seealso cref="Position"/>
public Vector3 LookAt
{
get
{
float
x = 0f,
y = 0f,
z = 0f;
Core.Natives.GetPlayerCameraFrontVector(_playerid, ref x, ref y, ref z);
return new Vector3(x, y, z);
}
set
{
Core.Natives.SetPlayerCameraLookAt(_playerid, value.X, value.Y, value.Z);
}
}
/// <summary>
/// Gets the current GTA camera mode for the player.
/// <remarks>The camera modes are useful in determining whether a player is aiming, doing a passenger driveby etc.</remarks>
/// </summary>
public CameraMode Mode
{
get
{
return CameraMode.OnFootChase;
}
}
};
};

View File

@ -0,0 +1,119 @@

namespace SAMP.API
{
public class Text3D
{
#region Class Variables
private int _nId;
private bool _bDeleted;
private string _strText;
private Color _qColor;
#endregion
#region Constructor
/// <summary>
/// Creates a 3D Text Label. NOTE: This merely initializes the 3D Text Label. Use SAMP.API.Text3D.Create to create/spawn it!
/// </summary>
/// <param name="text">The initial text string.</param>
/// <param name="color">The text color.</param>
public Text3D(string text, Color color)
{
_strText = text;
_qColor = color;
}
#endregion
#region Accessors & Mutators
/// <summary>
/// Gets or sets the color of this 3D text label.
/// </summary>
public Color Color
{
get { return _qColor; }
set
{
if(_bDeleted) return;
Core.Natives.Update3DTextLabelText(this.ID, value.ToArgb(), _strText);
}
}
/// <summary>
/// Gets the ID of the 3D text label.
/// </summary>
internal int ID
{
get { return _nId; }
}
/// <summary>
/// Gets or sets the text of this 3D text label.
/// </summary>
public string Text
{
get { return _strText; }
set
{
if(_bDeleted) return;
if(!_strText.Equals(string.Empty))
Core.Natives.Update3DTextLabelText(this.ID, _qColor.ToArgb(), value);
}
}
#endregion
#region Public Methods
/// <summary>
/// Creates the 3D Text Label at a specific location in the world.
/// </summary>
/// <param name="position">The position.</param>
/// <param name="drawDistance">The distance from where you are able to see the 3D Text Label.</param>
/// <param name="virtualWorld">The virtual world in which you are able to see the 3D Text.</param>
/// <param name="testLOS">Test the line-of-sight so this text can't be seen through objects.</param>
public void Create(Vector3 position, float drawDistance, int virtualWorld, bool testLOS = false)
{
_nId = Core.Natives.Create3DTextLabel(this.Text, this.Color.ToArgb(), position.X, position.Y, position.Z, drawDistance, virtualWorld, testLOS ? 1 : 0);
}
/// <summary>
/// Attaches the 3D text label to a player.
/// </summary>
/// <param name="player">The player to attach the 3D text label to.</param>
/// <param name="offset">The offset from the player.</param>
public void AttachToPlayer(Player player, Vector3 offset)
{
if(_bDeleted) return;
Core.Natives.Attach3DTextLabelToPlayer(this.ID, player.ID, offset.X, offset.Y, offset.Z);
}
/// <summary>
/// Attaches the 3D text label to a vehicle.
/// </summary>
/// <param name="vehicle">The vehicle to attach the 3D text label to.</param>
/// <param name="offset">The offset from the player.</param>
public void AttachToVehicle(Vehicle vehicle, Vector3 offset)
{
if(_bDeleted) return;
Core.Natives.Attach3DTextLabelToVehicle(this.ID, vehicle.ID, offset.X, offset.Y, offset.Z);
}
/// <summary>
/// Deletes the 3D text label.
/// </summary>
/// <returns>Returns a System.Boolean representing whether or not the 3D text label was deleted.</returns>
public bool Delete()
{
_bDeleted = true;
return Core.Natives.Delete3DTextLabel(this.ID) == 1;
}
#endregion
};
};

View File

@ -0,0 +1,432 @@
using System;
namespace SAMP.API
{
public class TextDraw
{
#region Class Variables
private int _nId = -1, _nFont = 0, _nShadow = 0, _nOutline = 0;
private string _strText = " ";
private Vector2 _qPosition = Vector2.Zero, _qSize = new Vector2(3f), _qLetterSize = new Vector2(3.2f, 5.1f);
private Color _qColor = Color.Black, _qBoxColor = Color.Black, _qBackColor = Color.Transparent;
private Alignment _qAlignment = Alignment.Left;
private bool _bUseBox = false, _bDestroyed = false, _bProportional = false, _bSelectable = false;
#endregion
#region Constructor
/// <summary>
/// Creates a textdraw.
/// </summary>
/// <param name="text">The text in the textdraw.</param>
/// <param name="position">The position.</param>
public TextDraw(string text, Vector2 position)
{
// Set vars and call native
_strText = text;
_qPosition = position;
_nId = Core.Natives.TextDrawCreate(position.X, position.Y, text);
}
#endregion
#region Accessors & Mutators
/// <summary>
/// Gets or sets the ID.
/// </summary>
internal int ID
{
get
{
// Check the TextDraw is valid
if(_bDestroyed) throw Core.Exceptions.TextDrawDestroyed;
// Return the ID
return _nId;
}
}
/// <summary>
/// Gets or sets the Alignment.
/// </summary>
public Alignment Alignment
{
get
{
// Check the TextDraw is valid
if(_bDestroyed) throw Core.Exceptions.TextDrawDestroyed;
// Return the alignment
return _qAlignment;
}
set
{
// Check the TextDraw is valid
if(_bDestroyed) throw Core.Exceptions.TextDrawDestroyed;
// Change the alignment
_qAlignment = value;
// Call native
Core.Natives.TextDrawAlignment(this.ID, (int)value);
}
}
/// <summary>
/// Gets or sets the text box colour (only used if UseBox is true).
/// </summary>
public Color BackColor
{
get
{
// Check the TextDraw is valid
if(_bDestroyed) throw Core.Exceptions.TextDrawDestroyed;
// Return the text colour
return _qBackColor;
}
set
{
// Check the TextDraw is valid
if(_bDestroyed) throw Core.Exceptions.TextDrawDestroyed;
// Change the colour
_qBackColor = value;
// Call native
Core.Natives.TextDrawBackgroundColor(this.ID, value.ToArgb());
}
}
/// <summary>
/// Gets or sets the text box colour (only used if UseBox is true).
/// </summary>
public Color BoxColor
{
get
{
// Check the TextDraw is valid
if(_bDestroyed) throw Core.Exceptions.TextDrawDestroyed;
// Return the text colour
return _qBoxColor;
}
set
{
// Check the TextDraw is valid
if(_bDestroyed) throw Core.Exceptions.TextDrawDestroyed;
// Change the colour
_qBoxColor = value;
// Call native
Core.Natives.TextDrawBoxColor(this.ID, value.ToArgb());
}
}
/// <summary>
/// Gets or sets the font.
/// </summary>
public int Font
{
get
{
// Check the TextDraw is valid
if(_bDestroyed) throw Core.Exceptions.TextDrawDestroyed;
// Return the font
return _nFont;
}
set
{
// Check the TextDraw is valid
if(_bDestroyed) throw Core.Exceptions.TextDrawDestroyed;
// Change the font
_nFont = value;
Core.Natives.TextDrawFont(this.ID, value);
}
}
/// <summary>
/// Gets or sets the text color.
/// </summary>
public Color ForeColor
{
get
{
// Check the TextDraw is valid
if(_bDestroyed) throw Core.Exceptions.TextDrawDestroyed;
// Return the text colour
return _qColor;
}
set
{
// Check the TextDraw is valid
if(_bDestroyed) throw Core.Exceptions.TextDrawDestroyed;
// Change the colour
_qColor = value;
// Call native
Core.Natives.TextDrawColor(this.ID, value.ToArgb());
}
}
/// <summary>
/// Gets or sets whether the TextDraw should use a box.
/// </summary>
public Vector2 LetterSize
{
get
{
// Check the TextDraw is valid
if(_bDestroyed) throw Core.Exceptions.TextDrawDestroyed;
// Return the size
return _qLetterSize;
}
set
{
// Check the TextDraw is valid
if(_bDestroyed) throw Core.Exceptions.TextDrawDestroyed;
// Change the size
_qLetterSize = value;
// Call native
Core.Natives.TextDrawLetterSize(this.ID, value.X, value.Y);
}
}
/// <summary>
/// Gets or sets the thickness of the outline.
/// </summary>
public int Outline
{
get
{
// Check the TextDraw is valid
if(_bDestroyed) throw Core.Exceptions.TextDrawDestroyed;
// Return the outline
return _nOutline;
}
set
{
// Check the TextDraw is valid
if(_bDestroyed) throw Core.Exceptions.TextDrawDestroyed;
// Change the outline
_nOutline = value;
// Call native
Core.Natives.TextDrawSetOutline(this.ID, value);
}
}
/// <summary>
/// Gets or sets whether the text spacing scales to a propotional ratio.
/// </summary>
public bool Proportional
{
get
{
// Check the TextDraw is valid
if(_bDestroyed) throw Core.Exceptions.TextDrawDestroyed;
// Return the bool
return _bProportional;
}
set
{
// Check the TextDraw is valid
if(_bDestroyed) throw Core.Exceptions.TextDrawDestroyed;
// Change the bool
_bProportional = value;
// Call native
Core.Natives.TextDrawSetProportional(this.ID, value ? 1 : 0);
}
}
/// <summary>
/// Gets or sets whether the TextDraw is selectable.
/// </summary>
public bool Selectable
{
get
{
// Check the TextDraw is valid
if(_bDestroyed) throw Core.Exceptions.TextDrawDestroyed;
// Return the bool
return _bSelectable;
}
set
{
// Check the TextDraw is valid
if(_bDestroyed) throw Core.Exceptions.TextDrawDestroyed;
// Change the bool
_bSelectable = value;
// Call native
Core.Natives.TextDrawSetSelectable(this.ID, value ? 1 : 0);
}
}
/// <summary>
/// Gets or sets whether the TextDraw should use a box.
/// </summary>
public Vector2 Size
{
get
{
// Check the TextDraw is valid
if(_bDestroyed) throw Core.Exceptions.TextDrawDestroyed;
// Return the size
return _qSize;
}
set
{
// Check the TextDraw is valid
if(_bDestroyed) throw Core.Exceptions.TextDrawDestroyed;
// Change the size
_qSize = value;
// Call native
Core.Natives.TextDrawTextSize(this.ID, value.X, value.Y);
}
}
/// <summary>
/// Gets or sets the side of the shadow.
/// </summary>
public int Shadow
{
get
{
// Check the TextDraw is valid
if(_bDestroyed) throw Core.Exceptions.TextDrawDestroyed;
// Return the shadow
return _nShadow;
}
set
{
// Check the TextDraw is valid
if(_bDestroyed) throw Core.Exceptions.TextDrawDestroyed;
// Change the shadow
_nShadow = value;
// Call native
Core.Natives.TextDrawSetShadow(this.ID, value);
}
}
/// <summary>
/// Gets or sets the text on the TextDraw.
/// </summary>
public string Text
{
get
{
// Check the TextDraw is valid
if(_bDestroyed) throw Core.Exceptions.TextDrawDestroyed;
// Return the text
return _strText;
}
set
{
// Check the TextDraw is valid
if(_bDestroyed) throw Core.Exceptions.TextDrawDestroyed;
// Change the text
_strText = value;
// Call native
Core.Natives.TextDrawSetString(this.ID, value);
}
}
/// <summary>
/// Gets or sets whether the TextDraw should use a box.
/// </summary>
public bool UseBox
{
get
{
// Check the TextDraw is valid
if(_bDestroyed) throw Core.Exceptions.TextDrawDestroyed;
// Return UseBox
return _bUseBox;
}
set
{
// Check the TextDraw is valid
if(_bDestroyed) throw Core.Exceptions.TextDrawDestroyed;
// Change the UseBox
_bUseBox = value;
// Call native
Core.Natives.TextDrawUseBox(this.ID, value ? 1 : 0);
}
}
#endregion
#region Public Methods
/// <summary>
/// Shows the TextDraw for the specified players.
/// </summary>
/// <param name="player">The players to show the TextDraw for.</param>
public void Show(params Player[] player)
{
if(player.Equals(Player.All) || player.Length.Equals(0))
Core.Natives.TextDrawShowForAll(_nId);
else
for(int i = 0; i < player.Length; i++)
Core.Natives.TextDrawShowForPlayer(player[i].ID, _nId);
}
/// <summary>
/// Hides the TextDraw for the specified players.
/// </summary>
/// <param name="player">The players to hide the TextDraw for.</param>
public void Hide(params Player[] player)
{
if(player.Equals(Player.All) || player.Length.Equals(0))
Core.Natives.TextDrawHideForAll(_nId);
else
for(int i = 0; i < player.Length; i++)
Core.Natives.TextDrawHideForPlayer(player[i].ID, _nId);
}
/// <summary>
/// Destroys the TextDraw.
/// </summary>
public void Destroy()
{
// Set destroyed
_bDestroyed = true;
// Call native
Core.Natives.TextDrawDestroy(_nId);
}
#endregion
};
};

View File

@ -0,0 +1,292 @@
using System.Collections;
namespace SAMP.API
{
public class Vehicle : Core.IWorldEntity, Core.ICountable
{
#region Class Variables
private int
_nId = -1,
_nModel,
_nColor1,
_nColor2,
_nRespawn;
private float _fAngle = 0f;
private Vector3 _qPosition = Vector3.Zero;
internal static Hashtable vehicleStore = new Hashtable();
#endregion
#region Constructor
/// <summary>
/// Creates a new SAMP.API.Vehicle to be spawned with World.SpawnVehicle.
/// </summary>
/// <param name="modelid">The model for the vehicle.</param>
/// <param name="color1">The primary color ID.</param>
/// <param name="color2">The secondary color ID.</param>
/// <param name="respawn_delay">The delay until the car is respawned without a driver in seconds.</param>
public Vehicle(int modelid, int color1, int color2, int respawn_delay)
{
_nModel = modelid;
_nColor1 = color1;
_nColor2 = color2;
_nRespawn = respawn_delay;
}
#endregion
#region Events, Delegates and Method Calls
#region OnSpawn
public delegate void OnSpawnHandler(object sender, System.EventArgs e);
public static event OnSpawnHandler OnSpawn;
internal void _OnSpawn()
{
try { OnSpawn(this, null); }
catch { }
}
#endregion
#region OnDeath
public delegate void OnDeathHandler(object sender, System.EventArgs e);
public static event OnDeathHandler OnDeath;
internal void _OnDeath(int killerid)
{
EventData.VehicleDeathEventArgs args = new EventData.VehicleDeathEventArgs(Player.Get(killerid));
try { OnDeath(this, args); }
catch { }
}
#endregion
#endregion
#region Accessors & Mutators
/// <summary>
/// Gets the model ID of this SAMP.API.Vehicle.
/// </summary>
public int Model
{
get
{
if(!this.ID.Equals(-1))
_nModel = Core.Natives.GetVehicleModel(this.ID);
return _nModel;
}
}
/// <summary>
/// Gets the primary color of this SAMP.API.Vehicle.
/// </summary>
public int PrimaryColor
{
get { return _nColor1; }
set
{
_nColor1 = value;
if(!this.ID.Equals(-1))
Core.Natives.ChangeVehicleColor(this.ID, value, this.SecondaryColor);
}
}
/// <summary>
/// Gets the secondary color of this SAMP.API.Vehicle.
/// </summary>
public int SecondaryColor
{
get { return _nColor2; }
set
{
_nColor2 = value;
if(!this.ID.Equals(-1))
Core.Natives.ChangeVehicleColor(this.ID, this.PrimaryColor, value);
}
}
/// <summary>
/// Gets the respawn delay of this SAMP.API.Vehicle.
/// </summary>
public int RespawnDelay { get { return _nRespawn; } }
/// <summary>
/// Gets the vehicle ID.
/// </summary>
public int ID { get { return _nId; } internal set { _nId = value; } }
/// <summary>
/// Gets or sets the vehicle's facing angle.
/// </summary>
public float Angle
{
get
{
if(!this.ID.Equals(-1))
Core.Natives.GetVehicleZAngle(this.ID, ref _fAngle);
return _fAngle;
}
set
{
_fAngle = value;
if(!this.ID.Equals(-1))
Core.Natives.SetVehicleZAngle(_nId, value);
}
}
/// <summary>
/// Gets or sets the vehicle's health.
/// </summary>
public float Health
{
get {
float health = 0f;
if(!this.ID.Equals(-1))
Core.Natives.GetVehicleHealth(this.ID, ref health);
return health; }
set
{
if(!this.ID.Equals(-1))
Core.Natives.SetVehicleHealth(this.ID, value);
}
}
/// <summary>
/// Gets whether the vehicle is occupied by a player.
/// </summary>
public bool Occupied
{
get
{
foreach(Player player in Player.All)
{
if(player.IsInVehicle(this))
return true;
}
return false;
}
}
/// <summary>
/// Gets or sets the vehicle's position.
/// </summary>
public Vector3 Position
{
get
{
float
x = 0f,
y = 0f,
z = 0f;
if(!this.ID.Equals(-1))
Core.Natives.GetVehiclePos(this.ID, ref x, ref y, ref z);
return new Vector3(x, y, z);
}
set
{
_qPosition = value;
if(!this.ID.Equals(-1))
Core.Natives.SetVehiclePos(this.ID, value.X, value.Y, value.Z);
}
}
/// <summary>
/// Gets or sets the trailer attatched to this vehicle.
/// </summary>
public Vehicle Trailer
{
get
{
if(!this.ID.Equals(-1))
return Vehicle.Get(Core.Natives.GetVehicleTrailer(this.ID));
else
return null;
}
set
{
if(!this.ID.Equals(-1))
if(value == null)
Core.Natives.DetachTrailerFromVehicle(this.ID);
else
Core.Natives.AttachTrailerToVehicle(value.ID, this.ID);
}
}
#endregion
#region Public Methods
internal static Vehicle Get(int vehicleid)
{
// Iterate through the vehicle collection store
foreach(DictionaryEntry d in vehicleStore)
{
if(d.Key.Equals(vehicleid))
return (Vehicle)d.Value;
}
// The vehicle doesn't exist.
return null;
}
/// <summary>
/// Adds a component to the vehicle.
/// </summary>
/// <param name="componentid">The componentid that needs to be added to the vehicle.</param>
/// <remarks>Important Note: Using an invalid componentid crashes the game.</remarks>
public void AddComponent(int componentid)
{
Core.Natives.AddVehicleComponent(this.ID, componentid);
}
/// <summary>
/// Destroys the vehicle.
/// </summary>
public void Destroy()
{
Core.Natives.DestroyVehicle(this.ID);
vehicleStore.Remove(this.ID);
}
/// <summary>
/// Determines the installed component from a vehicle in a specific slot.
/// </summary>
/// <param name="slot">The component slot to check for components.</param>
/// <returns>Returns the ID of the component installed in the specified slot.</returns>
public int GetComponentInSlot(int slot)
{
return Core.Natives.GetVehicleComponentInSlot(this.ID, slot);
}
/// <summary>
/// Determines what type of component (the slot) of a component id Find out what type of component a certain ID is.
/// </summary>
/// <param name="component">The component ID to check.</param>
/// <returns>Returns the component slot ID of the specified component.</returns>
public static int GetComponentType(int component)
{
return Core.Natives.GetVehicleComponentType(component);
}
/// <summary>
/// Removes a component from the vehicle.
/// </summary>
/// <param name="componentid">The componentid that needs to be removed from the vehicle.</param>
public void RemoveComponent(int componentid)
{
Core.Natives.RemoveVehicleComponent(this.ID, componentid);
}
#endregion
};
};

View File

@ -0,0 +1,220 @@

using System;
namespace SAMP.API
{
public class World
{
#region Class Variables
private static bool _bTirePopping = true;
private static bool _bInteriorWeapons = true;
private static bool _bInteriorEnterExits = true;
private static float _fNameTagDrawDistance = 70f;
private static float _fGlobalChatRadius = 0.0f;
private static float _fGravity = 0.008f;
private static float _fPlayerMarkerRadius = 0.0f;
private static int _nWeather = 0;
private static int _nTime = 0;
#endregion
#region Accessors & Mutators
/// <summary>
/// Gets or sets whether the usage of weapons in interiors is allowed.
/// </summary>
public static bool InteriorWeapons
{
get { return _bInteriorWeapons; }
set { _bInteriorWeapons = value; Core.Natives.AllowInteriorWeapons(value ? 1 : 0); }
}
/// <summary>
/// Gets or sets the radius limitation for chat (i.e. only players within the giving distance will see their message in chat.)
/// Also changes the distance at which a player can see other players on the map at the same distance.
/// </summary>
public static float GlobalChatRadius
{
get { return _fGlobalChatRadius; }
set { _fGlobalChatRadius = value; Core.Natives.LimitGlobalChatRadius(value); }
}
/// <summary>
/// Gets or sets the gravity for all players.
/// </summary>
/// <remarks>Default gravity is 0.008.</remarks>
public static float Gravity
{
get { return _fGravity; }
set { _fGravity = value; Core.Natives.SetGravity(value); }
}
/// <summary>
/// Gets or sets the maximum distance to display the names of players.
/// </summary>
public static float NameTagDrawDistance
{
get { return _fNameTagDrawDistance; }
set { _fNameTagDrawDistance = value; Core.Natives.SetNameTagDrawDistance(value); }
}
/// <summary>
/// Gets or sets the player marker radius.
/// </summary>
public static float PlayerMarkerRadius
{
get { return _fPlayerMarkerRadius; }
set { _fPlayerMarkerRadius = value; Core.Natives.LimitPlayerMarkerRadius(value); }
}
/// <summary>
/// Gets or sets the world time to a specific hour.
/// </summary>
public static int Time
{
get { return _nTime; }
set { _nTime = value; Core.Natives.SetWorldTime(value); }
}
#pragma warning disable 618
[Obsolete("This property was removed in SA-MP 0.3. Tire popping is enabled by default.")]
/// <summary>
/// Gets or sets the possibility of tire popping.
/// </summary>
public static bool TirePopping
{
get { return _bTirePopping; }
set { _bTirePopping = value; Core.Natives.EnableTirePopping(value ? 1 : 0); }
}
#pragma warning restore 618
/// <summary>
/// Gets or sets the world weather for all players.
/// </summary>
public static int Weather
{
get { return _nWeather; }
set { _nWeather = value; Core.Natives.SetWeather(value); }
}
/// <summary>
/// Gets or sets whether the interior entrances/exits (the yellow object outside and inside each door) are enabled.
/// </summary>
public static bool InteriorEnterExits
{
get { return _bInteriorEnterExits; }
set
{
_bInteriorEnterExits = value;
// Check the value was true. We don't want to call the function
// if they didn't intend it to be true.
if(value)
Core.Natives.UsePlayerPedAnims();
}
}
#endregion
#region Public Methods (also they're static)
/// <summary>
/// Creates an object.
/// </summary>
/// <param name="model">The model you want to use.</param>
/// <param name="position">The position at which to create the object.</param>
/// <param name="rotation">The rotation at which to create the object.</param>
/// <param name="drawDistance">The distance that San Andreas renders objects. 0.0 will cause objects to render at their default distances. 300.0 is the usable maximum.</param>
/// <returns>Returns the ID of the object that was created.</returns>
public static int CreateObject(int model, Vector3 position, Vector3 rotation, float drawDistance = 0.0f)
{
return Core.Natives.CreateObject(model, position.X, position.Y, position.Z, rotation.X, rotation.Y, rotation.Z, drawDistance);
}
/// <summary>
/// Adds an object to the game in a pickupable form.
/// </summary>
/// <param name="model">The pickup model.</param>
/// <param name="type">The pickup type.</param>
/// <param name="position">The position.</param>
/// <param name="virtualworld">The virtual world.</param>
/// <returns>Returns the ID of the created pickup.</returns>
public static int CreatePickup(int model, int type, Vector3 position, int virtualworld = -1)
{
int ret = Core.Natives.CreatePickup(model, type, position.X, position.Y, position.Z, virtualworld);
if(ret == -1)
throw Core.Exceptions.PickupMaxLimit;
return ret;
}
/// <summary>
/// Creates an explosion at the specified position.
/// </summary>
/// <param name="position">The position of the explosion.</param>
/// <param name="type">The type of explosion.</param>
/// <param name="radius">The explosion radius</param>
/// <remarks>
/// Important Note: Explosions are shown to all players, in all interiors and virtual worlds. There is currently no getting around this.
/// Note: There is a limit as to how many explosions can be seen at once by a client. This is roughly 10.
/// </remarks>
public static void Explosion(Vector3 position, int type, float radius)
{
Core.Natives.CreateExplosion(position.X, position.Y, position.Z, type, radius);
}
/// <summary>
/// Disables the nametag Line-Of-Sight checking so players can see nametags through objects.
/// </summary>
public static void DisableNameTagLOS()
{
Core.Natives.DisableNameTagLOS();
}
/// <summary>
/// Spawns a SAMP.API.Vehicle.
/// </summary>
/// <param name="vehicle">The vehicle to spawn.</param>
/// <param name="position">The position to spawn the vehicle.</param>
/// <param name="angle">The facing angle of the vehicle.</param>
public static void SpawnVehicle(Vehicle vehicle, Vector3 position, float angle)
{
vehicle.ID = Core.Natives.CreateVehicle(vehicle.Model, position.X, position.Y, position.Z, vehicle.Angle, vehicle.PrimaryColor, vehicle.SecondaryColor, vehicle.RespawnDelay);
vehicle.Angle = angle;
Vehicle.vehicleStore.Add(vehicle.ID, vehicle);
}
/// <summary>
/// Sends a message to all players connected, specifying the message the players will receive. This is a multiple-user equivalent of Player.SendMessage().
/// </summary>
/// <param name="message">The string of text you would like to send.</param>
/// <seealso cref="Player.SendMessage"/>
public static void SendMessageToAll(string message)
{
SendMessageToAll(message, Color.White);
}
/// <summary>
/// Sends a message to all players connected, specifying both the message the players will receive as the colour in which the message should show up. This is a multiple-user equivalent of Player.SendMessage().
/// </summary>
/// <param name="message">The string of text you would like to send.</param>
/// <param name="color">The color it should be in. This overload supports HEX notation.</param>
/// <seealso cref="Player.SendMessage"/>
public static void SendMessageToAll(string message, uint color)
{
SendMessageToAll(message, Color.FromArgb(color));
}
/// <summary>
/// Sends a message to all players connected, specifying both the message the players will receive as the colour in which the message should show up. This is a multiple-user equivalent of Player.SendMessage().
/// </summary>
/// <param name="message">The string of text you would like to send.</param>
/// <param name="color">The color it should be in. This overload supports a SAMP.Color.</param>
/// <seealso cref="Player.SendMessage"/>
public static void SendMessageToAll(string message, Color color)
{
Core.Natives.SendClientMessageToAll(color.ToArgb(), message);
}
#endregion
};
};

View File

@ -1,19 +1,25 @@
using System;
namespace SAMP.API {
public struct Color {
namespace SAMP.API
{
public struct Color
{
#region Struct Variables
private uint
m_u32Color;
private uint _color;
#endregion
#region Constructors
internal Color(uint argb) {
// Store into a variable
this.m_u32Color = argb;
/// <summary>
/// Creates a SAMP.API.Color structure from a 32-bit ARGB value.
/// </summary>
/// <param name="argb">A value specifying the 32-bit ARGB value.</param>
internal Color(uint argb)
{
// Store
this._color = argb;
}
#endregion
@ -21,32 +27,31 @@ namespace SAMP.API {
#region Static Methods
/// <summary>
/// Returns a new instance of the <see cref="SAMP.API.Color"/> struct from a 32-bit ARGB value.
/// Creates a SAMP.API.Color structure from a 32-bit ARGB value.
/// </summary>
/// <param name="argb">A value specifying the 32-bit ARGB value.</param>
/// <returns>The <see cref="SAMP.API.Color"/> structure that this method creates.</returns>
public static Color FromArgb(uint argb) {
/// <returns>The SAMP.API.Color structure that this method creates.</returns>
public static Color FromArgb(uint argb)
{
// Return the created colour
return new Color(argb);
}
/// <summary>
/// Creates a <see cref="SAMP.API.Color"/> structure from the specified 8-bit color values
/// Creates a System.Drawing.Color structure from the specified 8-bit color values
/// (red, green, and blue). The alpha value is implicitly 255 (fully opaque).
/// Although this method allows a 32-bit value to be passed for each color component,
/// the value of each component is limited to 8 bits.
/// </summary>
/// <param name="red">The red component. Valid values are 0 through 255.</param>
/// <param name="green">The green component. Valid values are 0 through 255.</param>
/// <param name="blue">The blue component. Valid values are 0 through 255.</param>
/// <returns>The <see cref="SAMP.API.Color"/> structure that this method creates.</returns>
public static Color FromArgb(int red, int green, int blue) {
// Return the created colour
/// <param name="argb">A value specifying the 32-bit ARGB value.</param>
/// <returns>The SAMP.API.Color structure that this method creates.</returns>
public static Color FromArgb(int red, int green, int blue)
{
return FromArgb(255, red, green, blue);
}
/// <summary>
/// Creates a <see cref="SAMP.API.Color"/> structure from the specified 8-bit color values
/// Creates a SAMP.API.Color structure from the specified 8-bit color values
/// (red, green, and blue). The alpha value is implicitly 255 (fully opaque).
/// Although this method allows a 32-bit value to be passed for each color component,
/// the value of each component is limited to 8 bits.
@ -55,8 +60,9 @@ namespace SAMP.API {
/// <param name="red">The red component. Valid values are 0 through 255.</param>
/// <param name="green">The green component. Valid values are 0 through 255.</param>
/// <param name="blue">The blue component. Valid values are 0 through 255.</param>
/// <returns>The <see cref="SAMP.API.Color"/> structure that this method creates.</returns>
public static Color FromArgb(int alpha, int red, int green, int blue) {
/// <returns>The SAMP.API.Color structure that this method creates.</returns>
public static Color FromArgb(int alpha, int red, int green, int blue)
{
// Convert the passed parameters to a HTML colour
string html = ArgbToHex(red, green, blue, alpha);
@ -68,11 +74,12 @@ namespace SAMP.API {
}
/// <summary>
/// Creates a <see cref="SAMP.API.Color"/> structure from the specified Html color value (hexadecimal notation).
/// Creates a SAMP.API.Color structure from the specified Html color value (hexadecimal notation).
/// </summary>
/// <param name="htmlColor">A value specifying the Html color notation.</param>
/// <returns>The <see cref="SAMP.API.Color"/> structure that this method creates.</returns>
public static Color FromHtml(string htmlColor) {
/// <param name="html">A value specifying the Html color notation.</param>
/// <returns>The SAMP.API.Color structure that this method creates.</returns>
public static Color FromHtml(string htmlColor)
{
// Truncate the HTML colour prefix ("0x" or "#") if necessary
if(htmlColor.StartsWith("0x"))
htmlColor = htmlColor.Substring(2);
@ -83,7 +90,9 @@ namespace SAMP.API {
if(htmlColor.Length.Equals(6))
// Append an alpha value
htmlColor = string.Format("{0}FF", htmlColor.ToUpper());
else if(htmlColor.Length.Equals(3)) {
else if(htmlColor.Length.Equals(3))
{
// Elongate shorthand HTML
string
r = htmlColor.Substring(0, 1),
@ -104,16 +113,18 @@ namespace SAMP.API {
#region Internal Methods
internal static string ArgbToHex(int r, int g, int b) {
internal static string ArgbToHex(int r, int g, int b)
{
return ArgbToHex(r, g, b, 255);
}
internal static string ArgbToHex(int r, int g, int b, int a) {
internal static string ArgbToHex(int r, int g, int b, int a)
{
string
hr = r.ToString("X"),
hg = g.ToString("X"),
hb = b.ToString("X"),
ha = a.ToString ("X");
ha = a.ToString("X");
if(hr.Length < 2)
hr = string.Format("0{0}", hr);
@ -132,29 +143,30 @@ namespace SAMP.API {
#region Public Methods
/// <summary>
/// Translates the specified <see cref="SAMP.API.Color"/> instance to an HTML string color representation.
/// Translates the specified SAMP.API.Color instance to an HTML string color representation.
/// </summary>
/// <param name="alpha">Whether or not to include the alpha channel.</param>
/// <returns>Returns the <see cref="System.String"/> that represents the HTML color.</returns>
public string ToHtml(bool alpha) {
/// <returns>The string that represents the HTML color.</returns>
public string ToHtml(bool alpha)
{
// Convert the Argb to a hexadecimal value
string html = m_u32Color.ToString("X");
string html = _color.ToString("X");
// Truncate to 6 characters if we want to omit the alpha channel
if(!alpha)
html = html.Substring(0, 6);
if(!alpha) html = html.Substring(0, 6);
// Return the HTML color representatio.
return html;
}
/// <summary>
/// Gets the 32-bit ARGB value of this <see cref="SAMP.API.Color"/> instance.
/// Gets the 32-bit ARGB value of this SAMP.API.Color instance.
/// </summary>
/// <returns>Returns the 32-bit ARGB value of this <see cref="SAMP.API.Color"/>.</returns>
public uint ToArgb() {
/// <returns>The 32-bit ARGB value of this SAMP.API.Color.</returns>
public uint ToArgb()
{
// Return the Argb value
return m_u32Color;
return _color;
}
#endregion
@ -164,9 +176,11 @@ namespace SAMP.API {
/// <summary>
/// Gets the Red value of this Color.
/// </summary>
public byte R {
get {
string hex = m_u32Color.ToString("X");
public byte R
{
get
{
string hex = _color.ToString("X");
string val = hex.Substring(0, 2);
return Convert.ToByte(val, 16);
}
@ -175,9 +189,11 @@ namespace SAMP.API {
/// <summary>
/// Gets the Green value of this Color.
/// </summary>
public byte G {
get {
string hex = m_u32Color.ToString("X");
public byte G
{
get
{
string hex = _color.ToString("X");
string val = hex.Substring(2, 2);
return Convert.ToByte(val, 16);
}
@ -186,9 +202,11 @@ namespace SAMP.API {
/// <summary>
/// Gets the Blue value of this Color.
/// </summary>
public byte B {
get {
string hex = m_u32Color.ToString("X");
public byte B
{
get
{
string hex = _color.ToString("X");
string val = hex.Substring(4, 2);
return Convert.ToByte(val, 16);
}
@ -197,9 +215,11 @@ namespace SAMP.API {
/// <summary>
/// Gets the Alpha value of this Color.
/// </summary>
public byte A {
get {
string hex = m_u32Color.ToString("X");
public byte A
{
get
{
string hex = _color.ToString("X");
string val = hex.Substring(6, 2);
return Convert.ToByte(val, 16);
}
@ -212,567 +232,567 @@ namespace SAMP.API {
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFF0F8FF.
/// </summary>
public static Color AliceBlue { get { return FromHtml ("F0F8FF"); } }
public static Color AliceBlue { get { return FromHtml("F0F8FF"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFAEBD7.
/// </summary>
public static Color AntiqueWhite { get { return FromHtml ("FAEBD7"); } }
public static Color AntiqueWhite { get { return FromHtml("FAEBD7"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF00FFFF.
/// </summary>
public static Color Aqua { get { return FromHtml ("00FFFF"); } }
public static Color Aqua { get { return FromHtml("00FFFF"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF7FFFD4.
/// </summary>
public static Color Aquamarine { get { return FromHtml ("7FFFD4"); } }
public static Color Aquamarine { get { return FromHtml("7FFFD4"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFF0FFFF.
/// </summary>
public static Color Azure { get { return FromHtml ("F0FFFF"); } }
public static Color Azure { get { return FromHtml("F0FFFF"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFF5F5DC.
/// </summary>
public static Color Beige { get { return FromHtml ("F5F5DC"); } }
public static Color Beige { get { return FromHtml("F5F5DC"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFFE4C4.
/// </summary>
public static Color Bisque { get { return FromHtml ("FFE4C4"); } }
public static Color Bisque { get { return FromHtml("FFE4C4"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF000000.
/// </summary>
public static Color Black { get { return FromHtml ("000000"); } }
public static Color Black { get { return FromHtml("000000"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFFEBCD.
/// </summary>
public static Color BlanchedAlmond { get { return FromHtml ("FFEBCD"); } }
public static Color BlanchedAlmond { get { return FromHtml("FFEBCD"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF0000FF.
/// </summary>
public static Color Blue { get { return FromHtml ("0000FF"); } }
public static Color Blue { get { return FromHtml("0000FF"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF8A2BE2.
/// </summary>
public static Color BlueViolet { get { return FromHtml ("8A2BE2"); } }
public static Color BlueViolet { get { return FromHtml("8A2BE2"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFA52A2A.
/// </summary>
public static Color Brown { get { return FromHtml ("A52A2A"); } }
public static Color Brown { get { return FromHtml("A52A2A"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFDEB887.
/// </summary>
public static Color BurlyWood { get { return FromHtml ("DEB887"); } }
public static Color BurlyWood { get { return FromHtml("DEB887"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF5F9EA0.
/// </summary>
public static Color CadetBlue { get { return FromHtml ("5F9EA0"); } }
public static Color CadetBlue { get { return FromHtml("5F9EA0"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF7FFF00.
/// </summary>
public static Color Chartreuse { get { return FromHtml ("7FFF00"); } }
public static Color Chartreuse { get { return FromHtml("7FFF00"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFD2691E.
/// </summary>
public static Color Chocolate { get { return FromHtml ("D2691E"); } }
public static Color Chocolate { get { return FromHtml("D2691E"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFF7F50.
/// </summary>
public static Color Coral { get { return FromHtml ("FF7F50"); } }
public static Color Coral { get { return FromHtml("FF7F50"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF6495ED.
/// </summary>
public static Color CornflowerBlue { get { return FromHtml ("6495ED"); } }
public static Color CornflowerBlue { get { return FromHtml("6495ED"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFFF8DC.
/// </summary>
public static Color Cornsilk { get { return FromHtml ("FFF8DC"); } }
public static Color Cornsilk { get { return FromHtml("FFF8DC"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFDC143C.
/// </summary>
public static Color Crimson { get { return FromHtml ("DC143C"); } }
public static Color Crimson { get { return FromHtml("DC143C"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF00FFFF.
/// </summary>
public static Color Cyan { get { return FromHtml ("00FFFF"); } }
public static Color Cyan { get { return FromHtml("00FFFF"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF00008B.
/// </summary>
public static Color DarkBlue { get { return FromHtml ("00008B"); } }
public static Color DarkBlue { get { return FromHtml("00008B"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF008B8B.
/// </summary>
public static Color DarkCyan { get { return FromHtml ("008B8B"); } }
public static Color DarkCyan { get { return FromHtml("008B8B"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFB8860B.
/// </summary>
public static Color DarkGoldenrod { get { return FromHtml ("B8860B"); } }
public static Color DarkGoldenrod { get { return FromHtml("B8860B"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFA9A9A9.
/// </summary>
public static Color DarkGray { get { return FromHtml ("A9A9A9"); } }
public static Color DarkGray { get { return FromHtml("A9A9A9"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF006400.
/// </summary>
public static Color DarkGreen { get { return FromHtml ("006400"); } }
public static Color DarkGreen { get { return FromHtml("006400"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFBDB76B.
/// </summary>
public static Color DarkKhaki { get { return FromHtml ("BDB76B"); } }
public static Color DarkKhaki { get { return FromHtml("BDB76B"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF8B008B.
/// </summary>
public static Color DarkMagenta { get { return FromHtml ("8B008B"); } }
public static Color DarkMagenta { get { return FromHtml("8B008B"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF556B2F.
/// </summary>
public static Color DarkOliveGreen { get { return FromHtml ("556B2F"); } }
public static Color DarkOliveGreen { get { return FromHtml("556B2F"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFF8C00.
/// </summary>
public static Color DarkOrange { get { return FromHtml ("FF8C00"); } }
public static Color DarkOrange { get { return FromHtml("FF8C00"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF9932CC.
/// </summary>
public static Color DarkOrchid { get { return FromHtml ("9932CC"); } }
public static Color DarkOrchid { get { return FromHtml("9932CC"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF8B0000.
/// </summary>
public static Color DarkRed { get { return FromHtml ("8B0000"); } }
public static Color DarkRed { get { return FromHtml("8B0000"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFE9967A.
/// </summary>
public static Color DarkSalmon { get { return FromHtml ("E9967A"); } }
public static Color DarkSalmon { get { return FromHtml("E9967A"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF8FBC8F.
/// </summary>
public static Color DarkSeaGreen { get { return FromHtml ("8FBC8F"); } }
public static Color DarkSeaGreen { get { return FromHtml("8FBC8F"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF483D8B.
/// </summary>
public static Color DarkSlateBlue { get { return FromHtml ("483D8B"); } }
public static Color DarkSlateBlue { get { return FromHtml("483D8B"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF2F4F4F.
/// </summary>
public static Color DarkSlateGray { get { return FromHtml ("2F4F4F"); } }
public static Color DarkSlateGray { get { return FromHtml("2F4F4F"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF00CED1.
/// </summary>
public static Color DarkTurquoise { get { return FromHtml ("00CED1"); } }
public static Color DarkTurquoise { get { return FromHtml("00CED1"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF9400D3.
/// </summary>
public static Color DarkViolet { get { return FromHtml ("9400D3"); } }
public static Color DarkViolet { get { return FromHtml("9400D3"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFF1493.
/// </summary>
public static Color DeepPink { get { return FromHtml ("FF1493"); } }
public static Color DeepPink { get { return FromHtml("FF1493"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF00BFFF.
/// </summary>
public static Color DeepSkyBlue { get { return FromHtml ("00BFFF"); } }
public static Color DeepSkyBlue { get { return FromHtml("00BFFF"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF696969.
/// </summary>
public static Color DimGray { get { return FromHtml ("696969"); } }
public static Color DimGray { get { return FromHtml("696969"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF1E90FF.
/// </summary>
public static Color DodgerBlue { get { return FromHtml ("1E90FF"); } }
public static Color DodgerBlue { get { return FromHtml("1E90FF"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFB22222.
/// </summary>
public static Color Firebrick { get { return FromHtml ("B22222"); } }
public static Color Firebrick { get { return FromHtml("B22222"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFFFAF0.
/// </summary>
public static Color FloralWhite { get { return FromHtml ("FFFAF0"); } }
public static Color FloralWhite { get { return FromHtml("FFFAF0"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF228B22.
/// </summary>
public static Color ForestGreen { get { return FromHtml ("228B22"); } }
public static Color ForestGreen { get { return FromHtml("228B22"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFF00FF.
/// </summary>
public static Color Fuchsia { get { return FromHtml ("FF00FF"); } }
public static Color Fuchsia { get { return FromHtml("FF00FF"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFDCDCDC.
/// </summary>
public static Color Gainsboro { get { return FromHtml ("DCDCDC"); } }
public static Color Gainsboro { get { return FromHtml("DCDCDC"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFF8F8FF.
/// </summary>
public static Color GhostWhite { get { return FromHtml ("F8F8FF"); } }
public static Color GhostWhite { get { return FromHtml("F8F8FF"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFFD700.
/// </summary>
public static Color Gold { get { return FromHtml ("FFD700"); } }
public static Color Gold { get { return FromHtml("FFD700"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFDAA520.
/// </summary>
public static Color Goldenrod { get { return FromHtml ("DAA520"); } }
public static Color Goldenrod { get { return FromHtml("DAA520"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF808080.
/// </summary>
public static Color Gray { get { return FromHtml ("808080"); } }
public static Color Gray { get { return FromHtml("808080"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF008000.
/// </summary>
public static Color Green { get { return FromHtml ("008000"); } }
public static Color Green { get { return FromHtml("008000"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFADFF2F.
/// </summary>
public static Color GreenYellow { get { return FromHtml ("ADFF2F"); } }
public static Color GreenYellow { get { return FromHtml("ADFF2F"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFF0FFF0.
/// </summary>
public static Color Honeydew { get { return FromHtml ("F0FFF0"); } }
public static Color Honeydew { get { return FromHtml("F0FFF0"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFF69B4.
/// </summary>
public static Color HotPink { get { return FromHtml ("FF69B4"); } }
public static Color HotPink { get { return FromHtml("FF69B4"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFCD5C5C.
/// </summary>
public static Color IndianRed { get { return FromHtml ("CD5C5C"); } }
public static Color IndianRed { get { return FromHtml("CD5C5C"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF4B0082.
/// </summary>
public static Color Indigo { get { return FromHtml ("4B0082"); } }
public static Color Indigo { get { return FromHtml("4B0082"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFFFFF0.
/// </summary>
public static Color Ivory { get { return FromHtml ("FFFFF0"); } }
public static Color Ivory { get { return FromHtml("FFFFF0"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFF0E68C.
/// </summary>
public static Color Khaki { get { return FromHtml ("F0E68C"); } }
public static Color Khaki { get { return FromHtml("F0E68C"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFE6E6FA.
/// </summary>
public static Color Lavender { get { return FromHtml ("E6E6FA"); } }
public static Color Lavender { get { return FromHtml("E6E6FA"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFFF0F5.
/// </summary>
public static Color LavenderBlush { get { return FromHtml ("FFF0F5"); } }
public static Color LavenderBlush { get { return FromHtml("FFF0F5"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF7CFC00.
/// </summary>
public static Color LawnGreen { get { return FromHtml ("7CFC00"); } }
public static Color LawnGreen { get { return FromHtml("7CFC00"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFFFACD.
/// </summary>
public static Color LemonChiffon { get { return FromHtml ("FFFACD"); } }
public static Color LemonChiffon { get { return FromHtml("FFFACD"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFADD8E6.
/// </summary>
public static Color LightBlue { get { return FromHtml ("ADD8E6"); } }
public static Color LightBlue { get { return FromHtml("ADD8E6"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFF08080.
/// </summary>
public static Color LightCoral { get { return FromHtml ("F08080"); } }
public static Color LightCoral { get { return FromHtml("F08080"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFE0FFFF.
/// </summary>
public static Color LightCyan { get { return FromHtml ("E0FFFF"); } }
public static Color LightCyan { get { return FromHtml("E0FFFF"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFAFAD2.
/// </summary>
public static Color LightGoldenrodYellow { get { return FromHtml ("FAFAD2"); } }
public static Color LightGoldenrodYellow { get { return FromHtml("FAFAD2"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFD3D3D3.
/// </summary>
public static Color LightGray { get { return FromHtml ("D3D3D3"); } }
public static Color LightGray { get { return FromHtml("D3D3D3"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF90EE90.
/// </summary>
public static Color LightGreen { get { return FromHtml ("90EE90"); } }
public static Color LightGreen { get { return FromHtml("90EE90"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFFB6C1.
/// </summary>
public static Color LightPink { get { return FromHtml ("FFB6C1"); } }
public static Color LightPink { get { return FromHtml("FFB6C1"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFFA07A.
/// </summary>
public static Color LightSalmon { get { return FromHtml ("FFA07A"); } }
public static Color LightSalmon { get { return FromHtml("FFA07A"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF20B2AA.
/// </summary>
public static Color LightSeaGreen { get { return FromHtml ("20B2AA"); } }
public static Color LightSeaGreen { get { return FromHtml("20B2AA"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF87CEFA.
/// </summary>
public static Color LightSkyBlue { get { return FromHtml ("87CEFA"); } }
public static Color LightSkyBlue { get { return FromHtml("87CEFA"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF778899.
/// </summary>
public static Color LightSlateGray { get { return FromHtml ("778899"); } }
public static Color LightSlateGray { get { return FromHtml("778899"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFB0C4DE.
/// </summary>
public static Color LightSteelBlue { get { return FromHtml ("B0C4DE"); } }
public static Color LightSteelBlue { get { return FromHtml("B0C4DE"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFFFFE0.
/// </summary>
public static Color LightYellow { get { return FromHtml ("FFFFE0"); } }
public static Color LightYellow { get { return FromHtml("FFFFE0"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF00FF00.
/// </summary>
public static Color Lime { get { return FromHtml ("00FF00"); } }
public static Color Lime { get { return FromHtml("00FF00"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF32CD32.
/// </summary>
public static Color LimeGreen { get { return FromHtml ("32CD32"); } }
public static Color LimeGreen { get { return FromHtml("32CD32"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFAF0E6.
/// </summary>
public static Color Linen { get { return FromHtml ("FAF0E6"); } }
public static Color Linen { get { return FromHtml("FAF0E6"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFF00FF.
/// </summary>
public static Color Magenta { get { return FromHtml ("FF00FF"); } }
public static Color Magenta { get { return FromHtml("FF00FF"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF800000.
/// </summary>
public static Color Maroon { get { return FromHtml ("800000"); } }
public static Color Maroon { get { return FromHtml("800000"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF66CDAA.
/// </summary>
public static Color MediumAquamarine { get { return FromHtml ("66CDAA"); } }
public static Color MediumAquamarine { get { return FromHtml("66CDAA"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF0000CD.
/// </summary>
public static Color MediumBlue { get { return FromHtml ("0000CD"); } }
public static Color MediumBlue { get { return FromHtml("0000CD"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFBA55D3.
/// </summary>
public static Color MediumOrchid { get { return FromHtml ("BA55D3"); } }
public static Color MediumOrchid { get { return FromHtml("BA55D3"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF9370DB.
/// </summary>
public static Color MediumPurple { get { return FromHtml ("9370DB"); } }
public static Color MediumPurple { get { return FromHtml("9370DB"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF3CB371.
/// </summary>
public static Color MediumSeaGreen { get { return FromHtml ("3CB371"); } }
public static Color MediumSeaGreen { get { return FromHtml("3CB371"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF7B68EE.
/// </summary>
public static Color MediumSlateBlue { get { return FromHtml ("7B68EE"); } }
public static Color MediumSlateBlue { get { return FromHtml("7B68EE"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF00FA9A.
/// </summary>
public static Color MediumSpringGreen { get { return FromHtml ("00FA9A"); } }
public static Color MediumSpringGreen { get { return FromHtml("00FA9A"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF48D1CC.
/// </summary>
public static Color MediumTurquoise { get { return FromHtml ("48D1CC"); } }
public static Color MediumTurquoise { get { return FromHtml("48D1CC"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFC71585.
/// </summary>
public static Color MediumVioletRed { get { return FromHtml ("C71585"); } }
public static Color MediumVioletRed { get { return FromHtml("C71585"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF191970.
/// </summary>
public static Color MidnightBlue { get { return FromHtml ("191970"); } }
public static Color MidnightBlue { get { return FromHtml("191970"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFF5FFFA.
/// </summary>
public static Color MintCream { get { return FromHtml ("F5FFFA"); } }
public static Color MintCream { get { return FromHtml("F5FFFA"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFFE4E1.
/// </summary>
public static Color MistyRose { get { return FromHtml ("FFE4E1"); } }
public static Color MistyRose { get { return FromHtml("FFE4E1"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFFE4B5.
/// </summary>
public static Color Moccasin { get { return FromHtml ("FFE4B5"); } }
public static Color Moccasin { get { return FromHtml("FFE4B5"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFFDEAD.
/// </summary>
public static Color NavajoWhite { get { return FromHtml ("FFDEAD"); } }
public static Color NavajoWhite { get { return FromHtml("FFDEAD"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF000080.
/// </summary>
public static Color Navy { get { return FromHtml ("000080"); } }
public static Color Navy { get { return FromHtml("000080"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFDF5E6.
/// </summary>
public static Color OldLace { get { return FromHtml ("FDF5E6"); } }
public static Color OldLace { get { return FromHtml("FDF5E6"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF808000.
/// </summary>
public static Color Olive { get { return FromHtml ("808000"); } }
public static Color Olive { get { return FromHtml("808000"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF6B8E23.
/// </summary>
public static Color OliveDrab { get { return FromHtml ("6B8E23"); } }
public static Color OliveDrab { get { return FromHtml("6B8E23"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFFA500.
/// </summary>
public static Color Orange { get { return FromHtml ("FFA500"); } }
public static Color Orange { get { return FromHtml("FFA500"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFF4500.
/// </summary>
public static Color OrangeRed { get { return FromHtml ("FF4500"); } }
public static Color OrangeRed { get { return FromHtml("FF4500"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFDA70D6.
/// </summary>
public static Color Orchid { get { return FromHtml ("DA70D6"); } }
public static Color Orchid { get { return FromHtml("DA70D6"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFEEE8AA.
/// </summary>
public static Color PaleGoldenrod { get { return FromHtml ("EEE8AA"); } }
public static Color PaleGoldenrod { get { return FromHtml("EEE8AA"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF98FB98.
/// </summary>
public static Color PaleGreen { get { return FromHtml ("98FB98"); } }
public static Color PaleGreen { get { return FromHtml("98FB98"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFAFEEEE.
/// </summary>
public static Color PaleTurquoise { get { return FromHtml ("AFEEEE"); } }
public static Color PaleTurquoise { get { return FromHtml("AFEEEE"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFDB7093.
/// </summary>
public static Color PaleVioletRed { get { return FromHtml ("DB7093"); } }
public static Color PaleVioletRed { get { return FromHtml("DB7093"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFFEFD5.
/// </summary>
public static Color PapayaWhip { get { return FromHtml ("FFEFD5"); } }
public static Color PapayaWhip { get { return FromHtml("FFEFD5"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFFDAB9.
/// </summary>
public static Color PeachPuff { get { return FromHtml ("FFDAB9"); } }
public static Color PeachPuff { get { return FromHtml("FFDAB9"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFCD853F.
/// </summary>
public static Color Peru { get { return FromHtml ("CD853F"); } }
public static Color Peru { get { return FromHtml("CD853F"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFFC0CB.
/// </summary>
public static Color Pink { get { return FromHtml ("FFC0CB"); } }
public static Color Pink { get { return FromHtml("FFC0CB"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFDDA0DD.
/// </summary>
public static Color Plum { get { return FromHtml ("DDA0DD"); } }
public static Color Plum { get { return FromHtml("DDA0DD"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFB0E0E6.
/// </summary>
public static Color PowderBlue { get { return FromHtml ("B0E0E6"); } }
public static Color PowderBlue { get { return FromHtml("B0E0E6"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF800080.
/// </summary>
public static Color Purple { get { return FromHtml ("800080"); } }
public static Color Purple { get { return FromHtml("800080"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFF0000.
/// </summary>
public static Color Red { get { return FromHtml ("FF0000"); } }
public static Color Red { get { return FromHtml("FF0000"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFBC8F8F.
/// </summary>
public static Color RosyBrown { get { return FromHtml ("BC8F8F"); } }
public static Color RosyBrown { get { return FromHtml("BC8F8F"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF4169E1.
/// </summary>
public static Color RoyalBlue { get { return FromHtml ("4169E1"); } }
public static Color RoyalBlue { get { return FromHtml("4169E1"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF8B4513.
/// </summary>
public static Color SaddleBrown { get { return FromHtml ("8B4513"); } }
public static Color SaddleBrown { get { return FromHtml("8B4513"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFA8072.
/// </summary>
public static Color Salmon { get { return FromHtml ("FA8072"); } }
public static Color Salmon { get { return FromHtml("FA8072"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFF4A460.
/// </summary>
public static Color SandyBrown { get { return FromHtml ("F4A460"); } }
public static Color SandyBrown { get { return FromHtml("F4A460"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF2E8B57.
/// </summary>
public static Color SeaGreen { get { return FromHtml ("2E8B57"); } }
public static Color SeaGreen { get { return FromHtml("2E8B57"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFFF5EE.
/// </summary>
public static Color SeaShell { get { return FromHtml ("FFF5EE"); } }
public static Color SeaShell { get { return FromHtml("FFF5EE"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFA0522D.
/// </summary>
public static Color Sienna { get { return FromHtml ("A0522D"); } }
public static Color Sienna { get { return FromHtml("A0522D"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFC0C0C0.
/// </summary>
public static Color Silver { get { return FromHtml ("C0C0C0"); } }
public static Color Silver { get { return FromHtml("C0C0C0"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF87CEEB.
/// </summary>
public static Color SkyBlue { get { return FromHtml ("87CEEB"); } }
public static Color SkyBlue { get { return FromHtml("87CEEB"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF6A5ACD.
/// </summary>
public static Color SlateBlue { get { return FromHtml ("6A5ACD"); } }
public static Color SlateBlue { get { return FromHtml("6A5ACD"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF708090.
/// </summary>
public static Color SlateGray { get { return FromHtml ("708090"); } }
public static Color SlateGray { get { return FromHtml("708090"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFFFAFA.
/// </summary>
public static Color Snow { get { return FromHtml ("FFFAFA"); } }
public static Color Snow { get { return FromHtml("FFFAFA"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF00FF7F.
/// </summary>
public static Color SpringGreen { get { return FromHtml ("00FF7F"); } }
public static Color SpringGreen { get { return FromHtml("00FF7F"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF4682B4.
/// </summary>
public static Color SteelBlue { get { return FromHtml ("4682B4"); } }
public static Color SteelBlue { get { return FromHtml("4682B4"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFD2B48C.
/// </summary>
public static Color Tan { get { return FromHtml ("D2B48C"); } }
public static Color Tan { get { return FromHtml("D2B48C"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF008080.
/// </summary>
public static Color Teal { get { return FromHtml ("008080"); } }
public static Color Teal { get { return FromHtml("008080"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFD8BFD8.
/// </summary>
public static Color Thistle { get { return FromHtml ("D8BFD8"); } }
public static Color Thistle { get { return FromHtml("D8BFD8"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFF6347.
/// </summary>
public static Color Tomato { get { return FromHtml ("FF6347"); } }
public static Color Tomato { get { return FromHtml("FF6347"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #00000000.
/// </summary>
public static Color Transparent { get { return FromArgb (0, 0, 0, 0); } }
public static Color Transparent { get { return FromArgb(0, 0, 0, 0); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF40E0D0.
/// </summary>
public static Color Turquoise { get { return FromHtml ("40E0D0"); } }
public static Color Turquoise { get { return FromHtml("40E0D0"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFEE82EE.
/// </summary>
public static Color Violet { get { return FromHtml ("EE82EE"); } }
public static Color Violet { get { return FromHtml("EE82EE"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFF5DEB3.
/// </summary>
public static Color Wheat { get { return FromHtml ("F5DEB3"); } }
public static Color Wheat { get { return FromHtml("F5DEB3"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFFFFFF.
/// </summary>
public static Color White { get { return FromHtml ("FFFFFF"); } }
public static Color White { get { return FromHtml("FFFFFF"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFF5F5F5.
/// </summary>
public static Color WhiteSmoke { get { return FromHtml ("F5F5F5"); } }
public static Color WhiteSmoke { get { return FromHtml("F5F5F5"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FFFFFF00.
/// </summary>
public static Color Yellow { get { return FromHtml ("FFFF00"); } }
public static Color Yellow { get { return FromHtml("FFFF00"); } }
/// <summary>
/// Gets a system-defined color that has an ARGB value of #FF9ACD32.
/// </summary>
public static Color YellowGreen { get { return FromHtml ("9ACD32"); } }
public static Color YellowGreen { get { return FromHtml("9ACD32"); } }
#endregion
@ -788,8 +808,8 @@ namespace SAMP.API {
PalePistachio = 132,
ElectricBlue = 142,
TurquoiseBlue = 144,
};
};
#endregion
};
};

View File

@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SAMP.API
{
public class Constants
{
}
};

View File

@ -1,8 +1,10 @@
using System;
using System.Text;
namespace SAMP.API {
public class Server {
namespace SAMP.API
{
public class Server
{
#region Class Variables
// Nothing to see here
@ -12,35 +14,17 @@ namespace SAMP.API {
#region Events, Delegates and Method Calls
#region OnRconCommand
public delegate void OnRconCommandHandler(object sender,EventData.RconCommandEventArgs e);
/// <summary>
/// Occurs when an RCON command is received.
/// </summary>
public delegate void OnRconCommandHandler(object sender, System.EventArgs e);
public static event OnRconCommandHandler OnRconCommand;
internal static int _OnRconCommand(string cmd) {
internal static int _OnRconCommand(string cmd)
{
EventData.RconCommandEventArgs args = new EventData.RconCommandEventArgs(cmd);
if(OnRconCommand != null)
OnRconCommand(null, args);
try { OnRconCommand(null, args); }
catch { }
return args.Handled ? 1 : 0;
}
#endregion
#region OnRconLoginAttempt
public delegate void OnRconLoginAttemptHandler(object sender,EventData.RconLoginAttemptEventArgs e);
/// <summary>
/// Occurs when a play attempts to login to RCON.
/// </summary>
public static event OnRconLoginAttemptHandler OnRconLoginAttempt;
internal static void _OnRconLoginAttempt(string ip, string password, int success) {
EventData.RconLoginAttemptEventArgs args = new EventData.RconLoginAttemptEventArgs(ip, password, success == 1);
if(OnRconLoginAttempt != null)
OnRconLoginAttempt(null, args);
args = null;
}
#endregion
#endregion
@ -49,14 +33,16 @@ namespace SAMP.API {
/// <summary>
/// Gets the number of currently connected players.
/// </summary>
public static int PlayerCount {
get { return Player.s_qStore.Count; }
public static int PlayerCount
{
get { return Player.playerStore.Count; }
}
/// <summary>
/// Gets the maximum allowed players to connect.
/// </summary>
public static int MaxPlayers {
public static int MaxPlayers
{
get { return Core.Natives.GetMaxPlayers(); }
}
@ -68,28 +54,39 @@ namespace SAMP.API {
/// Sends an RCON command.
/// </summary>
/// <param name="command">The RCON command to be executed.</param>
public static void Rcon(string command) {
public static void Rcon(string command)
{
Core.Natives.SendRconCommand(command);
}
/// <summary>
/// Retrieve a server variable of the specified type.
/// </summary>
/// <typeparam name="T">The type of variable to search for and return. Valid types are System.String, System.Int32 and System.Boolean.</typeparam>
/// <param name="varname">The name of the variable to retrieve.</param>
/// <typeparam name="T">The type of variable to search for and return. Valid types are <see cref="System.String"/>, <see cref="System.Int32"/> and <see cref="System.Boolean"/>.</typeparam>
/// <returns>Returns a variable of type <c>T</c> containing the value of the server variable with the name <c>varname</c>.</returns>
public static T Var<T>(string varname) {
if (typeof(T).Equals(typeof(string))) {
StringBuilder sb = new StringBuilder (1024);
/// <returns>Returns a variable of type T containing the server variable value.</returns>
public static T Var<T>(string varname)
{
if(typeof(T).Equals(typeof(string)))
{
StringBuilder sb = new StringBuilder(1024);
Core.Natives.GetServerVarAsString(varname, sb, sb.Capacity);
return (T)Convert.ChangeType (sb.ToString(), typeof(T));
} else if (typeof(T).Equals(typeof(int))) {
return (T)Convert.ChangeType(sb.ToString(), typeof(T));
}
else if(typeof(T).Equals(typeof(int)))
{
int buffer = Core.Natives.GetServerVarAsInt(varname);
return (T)Convert.ChangeType (buffer, typeof(T));
} else if (typeof(T).Equals(typeof(bool))) {
return (T)Convert.ChangeType(buffer, typeof(T));
}
else if(typeof(T).Equals(typeof(bool)))
{
bool buffer = Core.Natives.GetServerVarAsInt(varname) == 1;
return (T)Convert.ChangeType(buffer, typeof(T));
} else
}
else
return default(T);
}

View File

@ -1,28 +1,30 @@

namespace SAMP.API {
public class SpawnInfo {
namespace SAMP.API
{
public class SpawnInfo
{
#region Class Variables
private Player
m_qPlayer;
private Skin
m_qSkin;
private Vector3
m_qPos;
private int
m_iTeam,
m_iWeapon1, m_nWeapon1Ammo,
m_iWeapon2, m_nWeapon2Ammo,
m_iWeapon3, m_nWeapon3Ammo;
private float
m_fpAngle = 0.0f;
private Player _qPlayer;
private int _nTeam;
private Skin _qSkin;
private Vector3 _qPos;
private float _fAngle;
private int _nWeapon1, _nWeapon1Ammo;
private int _nWeapon2, _nWeapon2Ammo;
private int _nWeapon3, _nWeapon3Ammo;
#endregion
#region Constructor
internal SpawnInfo(Player sender) {
m_qPlayer = sender;
/// <summary>
/// Initializes a new instance of SAMP.API.SpawnInfo.
/// </summary>
/// <param name="sender">The player whose spawn info is being affected.</param>
internal SpawnInfo(Player sender)
{
_qPlayer = sender;
}
#endregion
@ -32,93 +34,91 @@ namespace SAMP.API {
/// <summary>
/// Gets or sets the spawn facing angle of the player.
/// </summary>
public float Angle {
get {
return this.m_fpAngle;
} set {
this.m_fpAngle = value;
}
public float Angle
{
get { return _fAngle; }
set { _fAngle = value; }
}
/// <summary>
/// Gets or sets the spawn position of the player.
/// </summary>
public Vector3 Position {
get {
return m_qPos;
} set {
m_qPos = value;
}
public Vector3 Position
{
get { return _qPos; }
set { _qPos = value; }
}
/// <summary>
/// Gets or sets the skin of the player.
/// Gets or sets the Skin of the player.
/// </summary>
public Skin Skin {
get {
return m_qSkin;
} set {
m_qSkin = value;
}
public Skin Skin
{
get { return _qSkin; }
set { _qSkin = value; }
}
/// <summary>
/// Gets or sets the team ID of the player.
/// </summary>
public int Team {
get {
return m_iTeam;
} set {
m_iTeam = value;
}
public int Team
{
get { return _nTeam; }
set { _nTeam = value; }
}
/// <summary>
/// Gets or sets the primary spawn-weapon for the player.
/// </summary>
public int Weapon1 {
get { return m_iWeapon1; }
set { m_iWeapon1 = value; }
public int Weapon1
{
get { return _nWeapon1; }
set { _nWeapon1 = value; }
}
/// <summary>
/// Gets or sets the amount of ammunition for the primary spawn-weapon.
/// </summary>
public int Weapon1Ammo {
get { return m_nWeapon1Ammo; }
set { m_nWeapon1Ammo = value; }
public int Weapon1Ammo
{
get { return _nWeapon1Ammo; }
set { _nWeapon1Ammo = value; }
}
/// <summary>
/// Gets or sets the secondary spawn-weapon for the player.
/// </summary>
public int Weapon2 {
get { return m_iWeapon2; }
set { m_iWeapon2 = value; }
public int Weapon2
{
get { return _nWeapon2; }
set { _nWeapon2 = value; }
}
/// <summary>
/// Gets or sets the amount of ammunition for the secondary spawn-weapon.
/// </summary>
public int Weapon2Ammo {
get { return m_nWeapon2Ammo; }
set { m_nWeapon2Ammo = value; }
public int Weapon2Ammo
{
get { return _nWeapon2Ammo; }
set { _nWeapon2Ammo = value; }
}
/// <summary>
/// Gets or sets the third spawn-weapon for the player.
/// </summary>
public int Weapon3 {
get { return m_iWeapon3; }
set { m_iWeapon3 = value; }
public int Weapon3
{
get { return _nWeapon3; }
set { _nWeapon3 = value; }
}
/// <summary>
/// Gets or sets the amount of ammunition for the third spawn-weapon.
/// </summary>
public int Weapon3Ammo {
get { return m_nWeapon3Ammo; }
set { m_nWeapon3Ammo = value; }
public int Weapon3Ammo
{
get { return _nWeapon3Ammo; }
set { _nWeapon3Ammo = value; }
}
#endregion
@ -128,8 +128,9 @@ namespace SAMP.API {
/// <summary>
/// Sends all buffered SpawnInfo to be updated.
/// </summary>
public void Flush() {
Core.Natives.SetSpawnInfo(m_qPlayer.ID, Team, (int)Skin, Position.X, Position.Y, Position.Z, Angle, Weapon1, Weapon1Ammo, Weapon2, Weapon2Ammo, Weapon3, Weapon3Ammo);
public void Flush()
{
Core.Natives.SetSpawnInfo(_qPlayer.ID, Team, (int)Skin, Position.X, Position.Y, Position.Z, Angle, Weapon1, Weapon1Ammo, Weapon2, Weapon2Ammo, Weapon3, Weapon3Ammo);
}
#endregion

View File

@ -1,34 +1,19 @@
using System;
using System.Text;
namespace SAMP.API {
public class Util {
namespace SAMP.API
{
public class Util
{
#region Accessors & Mutators
/// <summary>
/// Gets a value indicating whether the current platform is Linux.
/// </summary>
public static bool IsLinux {
get {
int iPlatform = (int)Environment.OSVersion.Platform;
return (iPlatform == 4) || (iPlatform == 6) || (iPlatform == 128);
}
}
/// <summary>
/// Gets a value indicating whether the current platform is Windows.
/// </summary>
public static bool IsWindows {
get {
return !IsLinux;
}
}
/// <summary>
/// Gets the uptime of the actual server in milliseconds. (The machine, NOT the SA:MP server.)
/// </summary>
public static TimeSpan TickCount {
get {
public static TimeSpan TickCount
{
get
{
return TimeSpan.FromMilliseconds(Core.Natives.GetTickCount());
}
}
@ -42,19 +27,21 @@ namespace SAMP.API {
/// </summary>
/// <param name="format">The format string.</param>
/// <param name="args">Indefinite number of arguments of any tag.</param>
public static void Log(string format, params object[] args) {
public static void Log(string format, params object[] args)
{
Core.Natives.logprintf(string.Format(format, args));
}
/// <summary>
/// Gets the name of a weapon.
/// Get the name of a weapon.
/// </summary>
/// <param name="weaponid">The Weapon ID you want to know the name of.</param>
/// <returns>The weapon name.</returns>
public static string GetWeaponName(int weaponid) {
StringBuilder pstrWeaponName = new StringBuilder(50);
Core.Natives.GetWeaponName(weaponid, pstrWeaponName, pstrWeaponName.Capacity);
return pstrWeaponName.ToString();
/// <returns>Returns a System.String representing the name of the weapon.</returns>
public static string GetWeaponName(int weaponid)
{
StringBuilder sb = new StringBuilder(50);
Core.Natives.GetWeaponName(weaponid, sb, sb.Capacity);
return sb.ToString();
}
#endregion

View File

@ -1,52 +1,56 @@
using System;
namespace SAMP.API {
public struct Vector2 {
#region Struct Variables
namespace SAMP
{
public struct Vector2
{
#region Class Variables
private float
m_fpX,
m_fpY;
private float _x, _y;
#endregion
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="SAMP.API.Vector2"/> struct.
/// Creates a new Vector2 object.
/// </summary>
/// <param name="x">X position.</param>
/// <param name="y">Y position.</param>
public Vector2(float x, float y) {
this.m_fpX = x;
this.m_fpY = y;
public Vector2(float x, float y)
{
this._x = x;
this._y = y;
}
/// <summary>
/// Initializes a new instance of the <see cref="SAMP.API.Vector2"/> struct.
/// Creates a new Vector2 object.
/// </summary>
/// <param name="v">Uniform position.</param>
public Vector2(float v) {
this.m_fpX = v;
this.m_fpY = v;
public Vector2(float v)
{
this._x = v;
this._y = v;
}
/// <summary>
/// Initializes a new instance of the <see cref="SAMP.API.Vector2"/> struct.
/// Creates a new Vector2 object.
/// </summary>
/// <param name="v">The <see cref="SAMP.API.Vector2"/> to copy.</param>
public Vector2(Vector2 v) {
this.m_fpX = v.X;
this.m_fpY = v.Y;
/// <param name="v">Vector2 to copy.</param>
public Vector2(Vector2 v)
{
this._x = v.X;
this._y = v.Y;
}
/// <summary>
/// Initializes a new instance of the <see cref="SAMP.API.Vector2"/> struct.
/// Creates a new Vector2 object.
/// </summary>
/// <param name="v">The <see cref="SAMP.API.Vector3"/> to copy.</param>
public Vector2(Vector3 v) {
this.m_fpX = v.X;
this.m_fpY = v.Y;
/// <param name="v">Vector3 to copy.</param>
public Vector2(Vector3 v)
{
this._x = v.X;
this._y = v.Y;
}
#endregion
@ -54,34 +58,29 @@ namespace SAMP.API {
#region Accessors & Mutators
/// <summary>
/// Gets the zero-pointed <see cref="SAMP.API.Vector2"/>.
/// Gets a zero-pointed Vector2.
/// </summary>
public static Vector2 Zero {
get {
return new Vector2(0.0f, 0.0f);
}
public static Vector2 Zero
{
get { return new Vector2(0f, 0f); }
}
/// <summary>
/// Gets or sets the X position of this <see cref="SAMP.API.Vector2"/>.
/// Gets or sets the X position of this Vector2.
/// </summary>
public float X {
get {
return this.m_fpX;
} set {
this.m_fpX = value;
}
public float X
{
get { return this._x; }
set { this._x = value; }
}
/// <summary>
/// Gets or sets the Y position of this <see cref="SAMP.API.Vector2"/>.
/// Gets or sets the Y position of this Vector2.
/// </summary>
public float Y {
get {
return this.m_fpY;
} set {
this.m_fpY = value;
}
public float Y
{
get { return this._y; }
set { this._y = value; }
}
#endregion
@ -89,42 +88,46 @@ namespace SAMP.API {
#region Operator Overloads
/// <summary>
/// Adds a <see cref="Vector2"/> to a <see cref="Vector2"/>, yielding a new <see cref="Vector2"/>.
/// Add two Vector2 objects.
/// </summary>
/// <param name="v1">The first <see cref="Vector2"/> to add.</param>
/// <param name="v2">The second <see cref="Vector2"/> to add.</param>
/// <returns>The <see cref="Vector2"/> that is the sum of the values of <c>v1</c> and <c>v2</c>.</returns>
public static Vector2 operator +(Vector2 v1, Vector2 v2) {
/// <param name="v1">The base term Vector2.</param>
/// <param name="v2">The factor term Vector2</param>
/// <returns>Returns the sum of v1 and v2.</returns>
public static Vector2 operator +(Vector2 v1, Vector2 v2)
{
return new Vector2(v1.X + v2.X, v1.Y + v2.Y);
}
/// <summary>
/// Subtracts a <see cref="Vector2"/> from a <see cref="Vector2"/>, yielding a new <see cref="Vector2"/>.
/// Subtract two Vector2 objects.
/// </summary>
/// <param name="v1">The <see cref="Vector2"/> to subtract from (the minuend).</param>
/// <param name="v2">The <see cref="Vector2"/> to subtract (the subtrahend).</param>
/// <returns>The <see cref="Vector2"/> that is the <c>v1</c> minus <c>v2</c>.</returns>
public static Vector2 operator -(Vector2 v1, Vector2 v2) {
/// <param name="v1">The base term Vector2.</param>
/// <param name="v2">The factor term Vector2</param>
/// <returns>Returns the value of v2 subratcted from v1.</returns>
public static Vector2 operator -(Vector2 v1, Vector2 v2)
{
return new Vector2(v1.X + v2.X, v1.Y + v2.Y);
}
/// <summary>
/// Computes the product of <c>v1</c> and <c>v2</c>, yielding a new <see cref="Vector2"/>.
/// Add two Vector2 objects.
/// </summary>
/// <param name="v1">The <see cref="Vector2"/> to multiply.</param>
/// <param name="v2">The <see cref="Vector2"/> to multiply.</param>
/// <returns>The <see cref="Vector2"/> that is the <c>v1</c> * <c>v2</c>.</returns>
public static Vector2 operator *(Vector2 v1, Vector2 v2) {
/// <param name="v1">The base term Vector2.</param>
/// <param name="v2">The factor term Vector2</param>
/// <returns>Returns the sum of v1 and v2.</returns>
public static Vector2 operator *(Vector2 v1, Vector2 v2)
{
return new Vector2(v1.X * v2.X, v1.Y * v2.Y);
}
/// <summary>
/// Computes the division of <c>v1</c> and <c>v2</c>, yielding a new <see cref="Vector2"/>.
/// Subtract two Vector2 objects.
/// </summary>
/// <param name="v1">The <see cref="Vector2"/> to divide (the divident)./param>
/// <param name="v2">The <see cref="Vector2"/> to divide (the divisor).</param>
/// <returns>The <see cref="Vector2"/> that is the <c>v1</c> / <c>v2</c>.</returns>
public static Vector2 operator /(Vector2 v1, Vector2 v2) {
/// <param name="v1">The base term Vector2.</param>
/// <param name="v2">The factor term Vector2</param>
/// <returns>Returns the value of v2 subratcted from v1.</returns>
public static Vector2 operator /(Vector2 v1, Vector2 v2)
{
return new Vector2(v1.X / v2.X, v1.Y / v2.Y);
}
@ -133,10 +136,11 @@ namespace SAMP.API {
#region Method Overrides
/// <summary>
/// Returns a <see cref="System.String"/> that represents the current <see cref="SAMP.API.Vector2"/>.
/// Returns a System.String that represents the Vector2.
/// </summary>
/// <returns>A <see cref="System.String"/> that represents the current <see cref="SAMP.API.Vector2"/>.</returns>
public override string ToString() {
/// <returns>A System.String that represents the current Vector2.</returns>
public override string ToString()
{
return string.Format("{{X: {0}, Y: {1}}}", this.X, this.Y);
}
@ -145,27 +149,14 @@ namespace SAMP.API {
#region Static Methods
/// <summary>
/// Calculates the distance between two <see cref="SAMP.API.Vector2"/> objects.
/// Determines the distance between two Vector2 objects.
/// </summary>
/// <param name="v1">The base <see cref="SAMP.API.Vector2"/> term.</param>
/// <param name="v2">The factor <see cref="SAMP.API.Vector2"/> term.</param>
/// <returns>Returns a <see cref="System.Double"/> representing the distance between <c>v1</c> and <c>v2</c>.</returns>
public static double Distance(Vector2 v1, Vector2 v2) {
return Math.Sqrt(
Math.Pow((double)v1.X - (double)v2.X, 2) +
Math.Pow((double)v1.Y - (double)v2.Y, 2));
}
/// <summary>
/// Calculates the dot product of two vectors.
/// </summary>
/// <param name="v1">The base <see cref="SAMP.API.Vector2"/> term.</param>
/// <param name="v2">The factor <see cref="SAMP.API.Vector2"/> term.</param>
/// <returns>Returns a <see cref="SAMP.API.Vector2"/> representing the dot product of <c>v1</c> and <c>v2</c>.</returns>
public static Vector2 Dot(Vector2 v1, Vector2 v2) {
return new Vector2(
x: v1.X * v2.X,
y: v1.Y * v2.Y);
/// <param name="v1">The base Vector2 term.</param>
/// <param name="v2">The factor Vector2 term.</param>
/// <returns>Returns a double precision decimal representing the distance between v1 and v2.</returns>
public static double Distance(Vector2 v1, Vector2 v2)
{
return Math.Sqrt(Math.Pow((double)v1.X - (double)v2.X, 2) + Math.Pow((double)v1.Y - (double)v2.Y, 2));
}
#endregion
@ -173,14 +164,28 @@ namespace SAMP.API {
#region Public Methods
/// <summary>
/// Calculates the distance between the current <see cref="SAMP.API.Vector2"/> and another.
/// Determines the distance between this Vector2 and another Vector3.
/// </summary>
/// <param name="v">The <see cref="SAMP.API.Vector2"/> term.</param>
/// <returns>Returns a <see cref="System.Double"/> representing the distance between <c>v</c> and the current <see cref="SAMP.API.Vector2"/>.</returns>
public double Distance(Vector2 v) {
/// <param name="v">The Vector2 term.</param>
/// <returns>Returns a double precision decimal representing the distance between v and this Vector2.</returns>
public double Distance(Vector2 v)
{
return Vector2.Distance(this, v);
}
/// <summary>
/// Calculates the dot product of two vectors.
/// </summary>
/// <param name="v1">The base Vector2 term.</param>
/// <param name="v2">The factor Vector2 term.</param>
/// <returns>Returns the dot product of v1 and v2.</returns>
public Vector2 Dot(Vector2 v1, Vector2 v2)
{
return new Vector2(
x: v1.X * v2.X,
y: v1.Y * v2.Y);
}
#endregion
};
};

View File

@ -1,58 +1,61 @@
using System;
namespace SAMP.API {
public struct Vector3 {
#region Struct Variables
namespace SAMP
{
public struct Vector3
{
#region Class Variables
private float
m_fpX,
m_fpY,
m_fpZ;
private float _x, _y, _z;
#endregion
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="SAMP.API.Vector3"/> struct.
/// Creates a new Vector3 object.
/// </summary>
/// <param name="x">X position.</param>
/// <param name="y">Y position.</param>
/// <param name="z">Z position.</param>
public Vector3(float x, float y, float z) {
this.m_fpX = x;
this.m_fpY = y;
this.m_fpZ = z;
public Vector3(float x, float y, float z)
{
this._x = x;
this._y = y;
this._z = z;
}
/// <summary>
/// Initializes a new instance of the <see cref="SAMP.API.Vector3"/> struct.
/// Creates a new Vector3 object.
/// </summary>
/// <param name="v">Uniform position.</param>
public Vector3(float v) {
this.m_fpX = v;
this.m_fpY = v;
this.m_fpZ = v;
public Vector3(float v)
{
this._x = v;
this._y = v;
this._z = v;
}
/// <summary>
/// Initializes a new instance of the <see cref="SAMP.API.Vector3"/> struct.
/// Creates a new Vector3 object.
/// </summary>
/// <param name="v">The <see cref="SAMP.API.Vector2"/> to copy.</param>
public Vector3(Vector2 v) {
this.m_fpX = v.X;
this.m_fpY = v.Y;
this.m_fpZ = 0f;
/// <param name="v">Vector2 to copy.</param>
public Vector3(Vector2 v)
{
this._x = v.X;
this._y = v.Y;
this._z = 0f;
}
/// <summary>
/// Initializes a new instance of the <see cref="SAMP.API.Vector3"/> struct.
/// Creates a new Vector3 object.
/// </summary>
/// <param name="v">The <see cref="SAMP.API.Vector3"/> to copy.</param>
public Vector3(Vector3 v) {
this.m_fpX = v.X;
this.m_fpY = v.Y;
this.m_fpZ = v.Z;
/// <param name="v">Vector3 to copy.</param>
public Vector3(Vector3 v)
{
this._x = v.X;
this._y = v.Y;
this._z = v.Z;
}
#endregion
@ -60,45 +63,38 @@ namespace SAMP.API {
#region Accessors & Mutators
/// <summary>
/// Gets the zero-pointed <see cref="SAMP.API.Vector3"/>.
/// Gets a zero-pointed Vector3.
/// </summary>
public static Vector3 Zero {
get {
return new Vector3(0.0f, 0.0f, 0.0f);
}
public static Vector3 Zero
{
get { return new Vector3(0f, 0f, 0f); }
}
/// <summary>
/// Gets or sets the X position of this <see cref="SAMP.API.Vector3"/>.
/// Gets or sets the X position of this Vector3.
/// </summary>
public float X {
get {
return this.m_fpX;
} set {
this.m_fpX = value;
}
public float X
{
get { return this._x; }
set { this._x = value; }
}
/// <summary>
/// Gets or sets the Y position of this <see cref="SAMP.API.Vector3"/>.
/// Gets or sets the Y position of this Vector3.
/// </summary>
public float Y {
get {
return this.m_fpY;
} set {
this.m_fpY = value;
}
public float Y
{
get { return this._y; }
set { this._y = value; }
}
/// <summary>
/// Gets or sets the Z position of this <see cref="SAMP.API.Vector3"/>.
/// Gets or sets the Z position of this Vector3.
/// </summary>
public float Z {
get {
return this.m_fpZ;
} set {
this.m_fpZ = value;
}
public float Z
{
get { return this._z; }
set { this._z = value; }
}
#endregion
@ -106,42 +102,46 @@ namespace SAMP.API {
#region Operator Overloads
/// <summary>
/// Adds a <see cref="Vector3"/> to a <see cref="Vector3"/>, yielding a new <see cref="Vector3"/>.
/// Add two Vector3 objects.
/// </summary>
/// <param name="v1">The first <see cref="Vector3"/> to add.</param>
/// <param name="v2">The second <see cref="Vector3"/> to add.</param>
/// <returns>The <see cref="Vector3"/> that is the sum of the values of <c>v1</c> and <c>v2</c>.</returns>
public static Vector3 operator +(Vector3 v1, Vector3 v2) {
/// <param name="v1">The base term Vector3.</param>
/// <param name="v2">The factor term Vector3</param>
/// <returns>Returns the sum of v1 and v2.</returns>
public static Vector3 operator +(Vector3 v1, Vector3 v2)
{
return new Vector3(v1.X + v2.X, v1.Y + v2.Y, v1.Z + v2.Z);
}
/// <summary>
/// Subtracts a <see cref="Vector3"/> from a <see cref="Vector3"/>, yielding a new <see cref="Vector3"/>.
/// Subtract two Vector3 objects.
/// </summary>
/// <param name="v1">The <see cref="Vector3"/> to subtract from (the minuend).</param>
/// <param name="v2">The <see cref="Vector3"/> to subtract (the subtrahend).</param>
/// <returns>The <see cref="Vector3"/> that is the <c>v1</c> minus <c>v2</c>.</returns>
public static Vector3 operator -(Vector3 v1, Vector3 v2) {
/// <param name="v1">The base term Vector3.</param>
/// <param name="v2">The factor term Vector3</param>
/// <returns>Returns the value of v2 subratcted from v1.</returns>
public static Vector3 operator -(Vector3 v1, Vector3 v2)
{
return new Vector3(v1.X + v2.X, v1.Y + v2.Y, v1.Z + v2.Z);
}
/// <summary>
/// Computes the product of <c>v1</c> and <c>v2</c>, yielding a new <see cref="Vector3"/>.
/// Add two Vector3 objects.
/// </summary>
/// <param name="v1">The <see cref="Vector3"/> to multiply.</param>
/// <param name="v2">The <see cref="Vector3"/> to multiply.</param>
/// <returns>The <see cref="Vector3"/> that is the <c>v1</c> * <c>v2</c>.</returns>
public static Vector3 operator *(Vector3 v1, Vector3 v2) {
/// <param name="v1">The base term Vector3.</param>
/// <param name="v2">The factor term Vector3</param>
/// <returns>Returns the sum of v1 and v2.</returns>
public static Vector3 operator *(Vector3 v1, Vector3 v2)
{
return new Vector3(v1.X * v2.X, v1.Y * v2.Y, v1.Z * v2.Z);
}
/// <summary>
/// Computes the division of <c>v1</c> and <c>v2</c>, yielding a new <see cref="Vector3"/>.
/// Subtract two Vector3 objects.
/// </summary>
/// <param name="v1">The <see cref="Vector3"/> to divide (the divident).</param>
/// <param name="v2">The <see cref="Vector3"/> to divide (the divisor).</param>
/// <returns>The <see cref="Vector3"/> that is the <c>v1</c> / <c>v2</c>.</returns>
public static Vector3 operator /(Vector3 v1, Vector3 v2) {
/// <param name="v1">The base term Vector3.</param>
/// <param name="v2">The factor term Vector3</param>
/// <returns>Returns the value of v2 subratcted from v1.</returns>
public static Vector3 operator /(Vector3 v1, Vector3 v2)
{
return new Vector3(v1.X / v2.X, v1.Y / v2.Y, v1.Z / v2.Z);
}
@ -150,10 +150,11 @@ namespace SAMP.API {
#region Method Overrides
/// <summary>
/// Returns a <see cref="System.String"/> that represents the current <see cref="SAMP.API.Vector3"/>.
/// Returns a System.String that represents the Vector3.
/// </summary>
/// <returns>A <see cref="System.String"/> that represents the current <see cref="SAMP.API.Vector3"/>.</returns>
public override string ToString() {
/// <returns>A System.String that represents the current Vector3.</returns>
public override string ToString()
{
return string.Format("({0}, {1}, {2})", this.X, this.Y, this.Z);
}
@ -162,29 +163,14 @@ namespace SAMP.API {
#region Static Methods
/// <summary>
/// Calculates the distance between two <see cref="SAMP.API.Vector3"/> objects.
/// Determines the distance between two Vector3 objects.
/// </summary>
/// <param name="v1">The base <see cref="SAMP.API.Vector3"/> term.</param>
/// <param name="v2">The factor <see cref="SAMP.API.Vector3"/> term.</param>
/// <returns>Returns a <see cref="System.Double"/> representing the distance between <c>v1</c> and <c>v2</c>.</returns>
public static double Distance(Vector3 v1, Vector3 v2) {
return Math.Sqrt(
Math.Pow((double)v1.X - (double)v2.X, 2) +
Math.Pow((double)v1.Y - (double)v2.Y, 2) +
Math.Pow((double)v1.Z - (double)v2.Z, 2));
}
/// <summary>
/// Calculates the dot product of two <see cref="SAMP.API.Vector3"/> objects.
/// </summary>
/// <param name="v1">The base <see cref="SAMP.API.Vector3"/> term.</param>
/// <param name="v2">he factor <see cref="SAMP.API.Vector3"/> term./param>
/// <returns>Returns the dot product of <c>v1</c> and <c>v2</c>.</returns>
public static Vector3 Dot(Vector3 v1, Vector3 v2) {
return new Vector3(
x: v1.X * v2.X,
y: v1.Y * v2.Y,
z: v1.Z * v2.Z);
/// <param name="v1">The base Vector3 term.</param>
/// <param name="v2">The factor Vector3 term.</param>
/// <returns>Returns a double precision decimal representing the distance between v1 and v2.</returns>
public static double Distance(Vector3 v1, Vector3 v2)
{
return Math.Sqrt(Math.Pow((double)v1.X - (double)v2.X, 2) + Math.Pow((double)v1.Y - (double)v2.Y, 2) + Math.Pow((double)v1.Z - (double)v2.Z, 2));
}
#endregion
@ -192,14 +178,29 @@ namespace SAMP.API {
#region Public Methods
/// <summary>
/// Calculates the distance between the current <see cref="SAMP.API.Vector3"/> and another.
/// Determines the distance between this Vector3 and another Vector3.
/// </summary>
/// <param name="v">The <see cref="SAMP.API.Vector3"/> term.</param>
/// <returns>Returns a <see cref="System.Double"/> representing the distance between <c>v</c> and the current <see cref="SAMP.API.Vector3"/>.</returns>
public double Distance(Vector3 v) {
/// <param name="v">The Vector3 term.</param>
/// <returns>Returns a double precision decimal representing the distance between v and this Vector3.</returns>
public double Distance(Vector3 v)
{
return Vector3.Distance(this, v);
}
/// <summary>
/// Calculates the dot product of two vectors.
/// </summary>
/// <param name="v1">The base Vector3 term.</param>
/// <param name="v2">The factor Vector3 term.</param>
/// <returns>Returns the dot product of v1 and v2.</returns>
public Vector3 Dot(Vector3 v1, Vector3 v2)
{
return new Vector3(
x: v1.X * v2.X,
y: v1.Y * v2.Y,
z: v1.Z * v2.Z);
}
#endregion
};
};

266
sampdotnet/ClassDiagram.cd Normal file
View File

@ -0,0 +1,266 @@
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram MajorVersion="1" MinorVersion="1">
<Class Name="SAMP.API.GameMode" Collapsed="true">
<Position X="5.75" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAEAAAAIAgDAABBCCAAAAAQAAQAgEAACxAAAAA=</HashCode>
<FileName>API\Objects\GameMode.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="SAMP.API.GangZone" Collapsed="true">
<Position X="7.5" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>gCAAAACAYAAAgEIAAAAAAAAIAAAIAIQAAEEAAAAAAAA=</HashCode>
<FileName>API\Objects\GangZone.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="SAMP.API.Menu" Collapsed="true" BaseTypeListCollapsed="true">
<Position X="2.25" Y="1.5" Width="1.5" />
<TypeIdentifier>
<HashCode>BAAgAAAEAAAAgABAAAgAAAAIgABAAAAAAAAgAAAAAAA=</HashCode>
<FileName>API\Objects\Menu.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="SAMP.API.Player" Collapsed="true" BaseTypeListCollapsed="true">
<Position X="5.75" Y="1.5" Width="1.5" />
<TypeIdentifier>
<HashCode>I0ASSBAQAEhCsFhgAqmEAKeACBAcgEBIBMBgpQYHpAA=</HashCode>
<FileName>API\Objects\Player.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" Collapsed="true" />
</Class>
<Class Name="SAMP.API.PlayerCamera" Collapsed="true" BaseTypeListCollapsed="true">
<Position X="7.5" Y="1.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAQAAIAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAI=</HashCode>
<FileName>API\Objects\PlayerCamera.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" Collapsed="true" />
</Class>
<Class Name="SAMP.API.Text3D" Collapsed="true" BaseTypeListCollapsed="true">
<Position X="7.5" Y="3.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAACAAAAAAAEgAAAAhAAAAAIAAEAAEBAAAAAiAAAAAA=</HashCode>
<FileName>API\Objects\Text3D.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="SAMP.API.TextDraw" Collapsed="true" BaseTypeListCollapsed="true">
<Position X="0.5" Y="4.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAACAQgABBAAgABAEyCAAKhIUAFEAABAoAgACQADAAA=</HashCode>
<FileName>API\Objects\TextDraw.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="SAMP.API.Vehicle" Collapsed="true" BaseTypeListCollapsed="true">
<Position X="4" Y="4.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAADAAAMRAAoABiAAECAKAIAABAAABAgEgABAACAgA=</HashCode>
<FileName>API\Objects\Vehicle.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" Collapsed="true" />
</Class>
<Class Name="SAMP.API.World" Collapsed="true">
<Position X="5.75" Y="4.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAGAAIAIAIAAAAAAAAAEACjEAgCSoAAIAAAgAwQ=</HashCode>
<FileName>API\Objects\World.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="SAMP.API.Constants" Collapsed="true">
<Position X="0.5" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>API\Util\Constants.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="SAMP.API.Server" Collapsed="true">
<Position X="4" Y="3.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAQAAACAACAACAAABAAAAAAAAAAAAAAAAAAAAAACAA=</HashCode>
<FileName>API\Util\Server.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="SAMP.API.EventData.DialogResponseEventArgs" Collapsed="true">
<Position X="2.25" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAABAIACACQAAAAgAAAIAAAAAgABAgAAAAAA=</HashCode>
<FileName>API\EventData\DialogResponseEventArgs.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="SAMP.API.EventData.PlayerClickMapEventArgs" Collapsed="true">
<Position X="0.5" Y="2.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAgAAAAAAAA=</HashCode>
<FileName>API\EventData\Player\PlayerClickMapEventArgs.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="SAMP.API.EventData.PlayerCommandTextEventArgs" Collapsed="true">
<Position X="2.25" Y="2.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAIAAAAIAAIAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAA=</HashCode>
<FileName>API\EventData\Player\PlayerCommandTextEventArgs.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="SAMP.API.EventData.PlayerDisconnectEventArgs" Collapsed="true">
<Position X="4" Y="2.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAACAAA=</HashCode>
<FileName>API\EventData\Player\PlayerDisconnectEventArgs.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="SAMP.API.EventData.PlayerEnterExitModShopEventArgs" Collapsed="true">
<Position X="5.75" Y="2.5" Width="1.5" />
<TypeIdentifier>
<HashCode>BAAAAAAAAAAAAAAAAAAAAAgAACAAAAAAAAAAgAAAAAA=</HashCode>
<FileName>API\EventData\Player\PlayerEnterExitModShopEventArgs.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="SAMP.API.EventData.PlayerRequestClassEventArgs" Collapsed="true">
<Position X="7.5" Y="2.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAQAAAABAAAAIAAAAAAAAAAgAAAAAAAAAAAAA=</HashCode>
<FileName>API\EventData\Player\PlayerRequestClassEventArgs.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="SAMP.API.EventData.PlayerSpawnEventArgs" Collapsed="true">
<Position X="0.5" Y="3.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAQAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAA=</HashCode>
<FileName>API\EventData\Player\PlayerSpawnEventArgs.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="SAMP.API.EventData.PlayerTextEventArgs" Collapsed="true">
<Position X="2.25" Y="3.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAQAAIAAAAAAAAAAAAAEAAAgAAAAAAIAAAAAA=</HashCode>
<FileName>API\EventData\Player\PlayerTextEventArgs.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="SAMP.Util" Collapsed="true">
<Position X="2.25" Y="4.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAEAAAAAAAAAAAAAgAAAAAAAAACAAAAAA=</HashCode>
<FileName>API\Util\Util.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="SAMP.Core.Exceptions" Collapsed="true">
<Position X="4" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAgAAAAAAAAAAAgACACAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Core\Exceptions.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="SAMP.Core.Internal" Collapsed="true">
<Position X="0.5" Y="1.5" Width="1.5" />
<TypeIdentifier>
<HashCode>RACSAFCBDAAgAKDAhQgQIAECKxhADASgQIBIRAQAEAQ=</HashCode>
<FileName>Core\Internal.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="SAMP.Core.Natives" Collapsed="true">
<Position X="4" Y="1.5" Width="1.5" />
<TypeIdentifier>
<HashCode>/vcn3It/nfqy7rT3f/vN923h/+/vfv8479vea9f3f7w=</HashCode>
<FileName>Core\Natives.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="SAMP.API.SpawnInfo" Collapsed="true">
<Position X="5.75" Y="3.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAgAAAAAAAYAAAgBIAAACIAAAAEBABZEEAAAAQIAAA=</HashCode>
<FileName>API\Util\SpawnInfo.cs</FileName>
</TypeIdentifier>
</Class>
<Struct Name="SAMP.API.Color" Collapsed="true">
<Position X="0.5" Y="5.75" Width="1.5" />
<TypeIdentifier>
<HashCode>Y/s/AcRdQXu8I7OmoRkQ11WRFJBxxgSLiLRt/TUZl4E=</HashCode>
<FileName>API\Util\Color.cs</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="SAMP.Vector2" Collapsed="true">
<Position X="2.25" Y="5.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAIAAQAAAAEYAUAAAAACQAAAABAAAAAAAAAYAA=</HashCode>
<FileName>API\Util\Vector2.cs</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="SAMP.Vector3" Collapsed="true">
<Position X="4" Y="5.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAIAAQAAAAEYAUAAAAACQAAAABAAAAAAAAAYAE=</HashCode>
<FileName>API\Util\Vector3.cs</FileName>
</TypeIdentifier>
</Struct>
<Interface Name="SAMP.Core.ICountable" Collapsed="true">
<Position X="0.5" Y="7" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Core\Interfaces\ICountable.cs</FileName>
</TypeIdentifier>
</Interface>
<Interface Name="SAMP.Core.IScriptBase" Collapsed="true">
<Position X="2.25" Y="7" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Core\Interfaces\IScriptBase.cs</FileName>
</TypeIdentifier>
</Interface>
<Interface Name="SAMP.Core.IWorldEntity" Collapsed="true">
<Position X="4" Y="7" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Core\Interfaces\IWorldEntity.cs</FileName>
</TypeIdentifier>
</Interface>
<Enum Name="SAMP.API.Alignment" Collapsed="true">
<Position X="0.5" Y="8" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAABAAAAAAAAAACACAAAAAAAA=</HashCode>
<FileName>API\Enums\Alignment.cs</FileName>
</TypeIdentifier>
</Enum>
<Enum Name="SAMP.API.CameraMode" Collapsed="true">
<Position X="2.25" Y="8" Width="1.5" />
<TypeIdentifier>
<HashCode>BAAAwBAAAAAAEAIAAQQAAAQAAAEAAAAAAAACAAAEAIA=</HashCode>
<FileName>API\Enums\CameraMode.cs</FileName>
</TypeIdentifier>
</Enum>
<Enum Name="SAMP.API.DialogStyle" Collapsed="true">
<Position X="4" Y="8" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAIAAAAAAAAAAAAAAAAEAAAAAACAAAAAAAAAAI=</HashCode>
<FileName>API\Enums\DialogStyle.cs</FileName>
</TypeIdentifier>
</Enum>
<Enum Name="SAMP.API.DisconnectReason" Collapsed="true">
<Position X="5.75" Y="8" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAgAAAAAAAAAAAAAAAAABAAAAAAAACAAAAAAAAA=</HashCode>
<FileName>API\Enums\DisconnectReason.cs</FileName>
</TypeIdentifier>
</Enum>
<Enum Name="SAMP.API.Keys" Collapsed="true">
<Position X="7.5" Y="8" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAIAIoAUCAAAAYQAAEAiAqAEoAAACACAAIAAAAY=</HashCode>
<FileName>API\Enums\Keys.cs</FileName>
</TypeIdentifier>
</Enum>
<Enum Name="SAMP.API.PlayerState" Collapsed="true">
<Position X="0.5" Y="8.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAQACAAAAAAACAAAAAAAAAAwCAAAAAAAIEAIAA=</HashCode>
<FileName>API\Enums\PlayerState.cs</FileName>
</TypeIdentifier>
</Enum>
<Enum Name="SAMP.API.Skin" Collapsed="true">
<Position X="2.25" Y="8.75" Width="1.5" />
<TypeIdentifier>
<HashCode>t1bXfuYbJw3c99+0fb/XQdvrB4f9vt93DJHqmjNIc/0=</HashCode>
<FileName>API\Enums\Skin.cs</FileName>
</TypeIdentifier>
</Enum>
<Font Name="Segoe UI" Size="9" />
</ClassDiagram>

View File

@ -1,8 +1,13 @@
using System;
namespace SAMP.Core {
internal class Exceptions {
namespace SAMP.Core
{
internal class Exceptions
{
// API
public static Exception GameModeInitialized = new Exception("The GmaeMode has already been initialized.");
public static Exception TextDrawDestroyed = new Exception("The TextDraw has been destroyed.");
public static Exception PlayerNotConnected = new Exception("The player isn't connected.");
public static Exception PickupMaxLimit = new Exception("The maximum number of pickups has been exceeded.");
};
};

View File

@ -1,6 +1,8 @@

namespace SAMP.Core {
public interface ICountable {
namespace SAMP.Core
{
public interface ICountable
{
int ID { get; }
};
};

View File

@ -1,8 +1,7 @@

namespace SAMP.Core {
public interface IScriptBase {
namespace SAMP.Core
{
public interface IScriptBase
{
void Load();
void Unload();
};
};

View File

@ -1,6 +1,7 @@

namespace SAMP.Core {
public interface IWorldEntity {
API.Vector3 Position { get; set; }
namespace SAMP.Core
{
public interface IWorldEntity
{
Vector3 Position { get; set; }
};
};

View File

@ -4,78 +4,87 @@ using System.Runtime.InteropServices;
using System.Text;
using SAMP.API;
namespace SAMP.Core {
internal class Internal {
namespace SAMP.Core
{
internal class Internal
{
#region Class Variables
public static int
s_nDialogCounter = 0;
public static Hashtable
s_qDialogResponses = new Hashtable();
public static int _nDialogCounter = 0;
public static Hashtable _qDialogResponses = new Hashtable();
#endregion
#region C++ Callbacks
public static void OnGameModeInit() {
GameMode._OnInit();
public static void OnGameModeInit()
{
try { GameMode._OnInit(); }
catch { }
}
public static void OnGameModeExit() {
GameMode._OnExit();
public static void OnGameModeExit()
{
try { GameMode._OnExit(); }
catch { }
}
public static void OnPlayerConnect(int playerid) {
public static void OnPlayerConnect(int playerid)
{
// Instantiate the player
// This, in turn, adds itself to the collection
// Immediately call the OnConnect event.
new Player(playerid)._OnConnect();
}
public static void OnPlayerDisconnect(int playerid, int reason)
{
// Store player in a temp buffer
Player p = Player.Get(playerid);
public static void OnPlayerDisconnect(int playerid, int reason) {
Player.Get(playerid)._OnDisconnect(reason);
// Call event and destruct
p._OnDisconnect(reason);
p = null;
}
public static int OnPlayerSpawn (int playerid) {
// Pre-define a variable for cancel
bool bCancel = false;
public static int OnPlayerSpawn(int playerid)
{
// Predef a variable for cancel
bool cancel = false;
// Call event
Player.Get(playerid)._OnSpawn(ref bCancel);
Player.Get(playerid)._OnSpawn(ref cancel);
// Return the cancel bool
return bCancel ? 0 : 1;
return cancel ? 0 : 1;
}
public static void OnPlayerDeath(int playerid, int killerid, int reason) {
public static void OnPlayerDeath(int playerid, int killerid, int reason)
{
Player.Get(playerid)._OnDeath(Player.Get(killerid), reason);
}
public static void OnVehicleSpawn(int vehicleid) {
public static void OnVehicleSpawn(int vehicleid)
{
Vehicle.Get(vehicleid)._OnSpawn();
}
public static void OnVehicleDeath(int vehicleid, int killerid) {
public static void OnVehicleDeath(int vehicleid, int killerid)
{
Vehicle.Get(vehicleid)._OnDeath(killerid);
}
public static int OnPlayerText(int playerid, string text) {
public static int OnPlayerText(int playerid, string text)
{
// Call event
return Player.Get(playerid)._OnText(text);
}
public static int OnPlayerCommandText(int playerid, string cmdtext) {
// Pre-define a variable for cancel
bool bHandled = false;
public static int OnPlayerCommandText(int playerid, string cmdtext)
{
// Predef a variable for cancel
bool handled = false;
// Call event
Player.Get(playerid)._OnCommandText(cmdtext, ref bHandled);
Player.Get(playerid)._OnCommandText(cmdtext, ref handled);
// Return the handled bool
return bHandled ? 1 : 0;
return handled ? 1 : 0;
}
public static int OnPlayerRequestClass(int playerid, int classid) {
// Pre-define a variable for cancel
public static int OnPlayerRequestClass(int playerid, int classid)
{
// Predef a variable for cancel
bool cancel = false;
// Call event
@ -84,171 +93,101 @@ namespace SAMP.Core {
// Return the cancel bool
return cancel ? 0 : 1;
}
public static void OnPlayerEnterVehicle(int playerid, int vehicleid, int ispassenger) {
public static void OnPlayerEnterVehicle(int playerid, int vehicleid, int ispassenger)
{
Player.Get(playerid)._OnEnterVehicle(vehicleid, ispassenger == 1);
}
public static void OnPlayerExitVehicle(int playerid, int vehicleid) {
public static void OnPlayerExitVehicle(int playerid, int vehicleid)
{
Player.Get(playerid)._OnExitVehicle(vehicleid);
}
public static void OnPlayerStateChange(int playerid, int newstate, int oldstate) {
public static void OnPlayerStateChange(int playerid, int newstate, int oldstate)
{
Player.Get(playerid)._OnStateChange(newstate, oldstate);
}
public static void OnPlayerEnterCheckpoint (int playerid) {
public static void OnPlayerEnterCheckpoint(int playerid)
{
Player.Get(playerid)._OnEnterCheckpoint();
}
public static void OnPlayerLeaveCheckpoint(int playerid) {
public static void OnPlayerLeaveCheckpoint(int playerid)
{
Player.Get(playerid)._OnLeaveCheckpoint();
}
public static void OnPlayerEnterRaceCheckpoint(int playerid) {
public static void OnPlayerEnterRaceCheckpoint(int playerid)
{
Player.Get(playerid)._OnEnterRaceCheckpoint();
}
public static void OnPlayerLeaveRaceCheckpoint(int playerid) {
public static void OnPlayerLeaveRaceCheckpoint(int playerid)
{
Player.Get(playerid)._OnLeaveRaceCheckpoint();
}
public static int OnRconCommand(string cmd) {
public static int OnRconCommand(string cmd)
{
return Server._OnRconCommand(cmd);
}
public static int OnPlayerRequestSpawn(int playerid) {
public static int OnPlayerRequestSpawn(int playerid)
{
return Player.Get(playerid)._OnRequestSpawn();
}
public static void OnObjectMoved(int objectid) {
// TODO: Implement
public static void OnObjectMoved(int objectid) { } // TODO: Implement
public static void OnPlayerObjectMoved(int playerid, int objectid) { } // TODO: Implement
public static void OnPlayerPickUpPickup(int playerid, int pickupid)
{
Player.Get(playerid)._OnPickupPickUp(pickupid);
}
public static void OnPlayerObjectMoved(int playerid, int objectid) {
// TODO: Implement
}
public static void OnPlayerPickUpPickup(int playerid, int pickupid) {
Player.Get(playerid)._OnPickUpPickup(pickupid);
}
public static int OnVehicleMod(int playerid, int vehicleid, int componentid) {
// TODO: Implement
return 1;
}
public static void OnEnterExitModShop(int playerid, int enterexit, int interiorid) {
public static int OnVehicleMod(int playerid, int vehicleid, int componentid) { return 1; } // TODO: Implement
public static void OnEnterExitModShop(int playerid, int enterexit, int interiorid)
{
// Call event
Player.Get(playerid)._OnEnterExitModShop(enterexit, interiorid);
}
public static void OnVehiclePaintjob(int playerid, int vehicleid, int paintjobid) {
// TODO: Implement
}
public static void OnVehicleRespray(int playerid, int vehicleid, int color1, int color2) {
// TODO: Implement
}
public static void OnVehicleDamageStatusUpdate(int vehicleid, int playerid) {
// TODO: Implement
}
public static void OnUnoccupiedVehicleUpdate(int vehicleid, int playerid, int passenger_seat) {
// TODO: Implement
}
public static void OnPlayerSelectedMenuRow(int playerid, int row) {
// TODO: Implement
}
public static void OnPlayerExitedMenu(int playerid) {
// TODO: Implement
}
public static void OnPlayerInteriorChange(int playerid, int newinteriorid, int oldinteriorid) {
// TODO: Implement
}
public static int OnPlayerKeyStateChange(int playerid, int newkeys, int oldkeys) {
// TODO: Implement
return 1;
}
public static void OnRconLoginAttempt(string ip, string password, int success) {
Server._OnRconLoginAttempt(ip, password, success);
}
public static int OnPlayerUpdate(int playerid) {
return Player.Get(playerid)._OnUpdate ();
}
public static void OnPlayerStreamIn(int playerid, int forplayerid) {
Player.Get(playerid)._OnStreamIn(forplayerid);
}
public static void OnPlayerStreamOut(int playerid, int forplayerid) {
Player.Get(playerid)._OnStreamOut(forplayerid);
}
public static void OnVehicleStreamIn(int vehicleid, int forplayerid) {
Vehicle.Get(vehicleid)._OnStreamIn(forplayerid);
}
public static void OnVehicleStreamOut(int vehicleid, int forplayerid) {
Vehicle.Get(vehicleid)._OnStreamOut(forplayerid);
}
public static int OnDialogResponse(int playerid, int dialogid, int response, int listitem, string inputtext) {
// Pre-define a variable for pass-on
bool bPasson = false;
public static void OnVehiclePaintjob(int playerid, int vehicleid, int paintjobid) { } // TODO: Implement
public static void OnVehicleRespray(int playerid, int vehicleid, int color1, int color2) { } // TODO: Implement
public static void OnVehicleDamageStatusUpdate(int vehicleid, int playerid) { } // TODO: Implement
public static void OnUnoccupiedVehicleUpdate(int vehicleid, int playerid, int passenger_seat) { } // TODO: Implement
public static void OnPlayerSelectedMenuRow(int playerid, int row) { } // TODO: Implement
public static void OnPlayerExitedMenu(int playerid) { } // TODO: Implement
public static void OnPlayerInteriorChange(int playerid, int newinteriorid, int oldinteriorid) { } // TODO: Implement
public static int OnPlayerKeyStateChange(int playerid, int newkeys, int oldkeys) { return 1; } // TODO: Implement
public static void OnRconLoginAttempt(string ip, string password, int success) { } // TODO: Implement
public static int OnPlayerUpdate(int playerid) { return 1; } // TODO: Implement
public static void OnPlayerStreamIn(int playerid, int forplayerid) { } // TODO: Implement
public static void OnPlayerStreamOut(int playerid, int forplayerid) { } // TODO: Implement
public static void OnVehicleStreamIn(int vehicleid, int forplayerid) { } // TODO: Implement
public static void OnVehicleStreamOut(int vehicleid, int forplayerid) { } // TODO: Implement
public static int OnDialogResponse(int playerid, int dialogid, int response, int listitem, string inputtext)
{
// Predef a variable for pass-on
bool passon = false;
// Call event
Player.Get(playerid)._OnDialogResponse(dialogid, response, listitem, inputtext, ref bPasson);
Player.Get(playerid)._OnDialogResponse(dialogid, response, listitem, inputtext, ref passon);
// Return the pass-on int
return bPasson ? 0 : 1;
return passon ? 0 : 1;
}
public static void OnPlayerTakeDamage(int playerid, int issuerid, float amount, int weaponid) {
// TODO: Implement
}
public static void OnPlayerGiveDamage(int playerid, int damagedid, float amount, int weaponid) {
// TODO: Implement
}
public static void OnPlayerClickMap(int playerid, float fX, float fY, float fZ) {
public static void OnPlayerTakeDamage(int playerid, int issuerid, float amount, int weaponid) { } // TODO: Implement
public static void OnPlayerGiveDamage(int playerid, int damagedid, float amount, int weaponid) { } // TODO: Implement
public static void OnPlayerClickMap(int playerid, float fX, float fY, float fZ)
{
// Call event
Player.Get(playerid)._OnClickMap(fX, fY, fZ);
}
public static int OnPlayerClickTextDraw (int playerid, int clickedid) {
// TODO: Implement
return 0;
}
public static void OnPlayerClickPlayerTextDraw(int playerid, int playertextid) {
// TODO: Implement
}
public static void OnPlayerClickPlayer(int playerid, int clickedplayerid, int source) {
// TODO: Implement
}
public static void OnPlayerEditObject(int playerid, int playerobject, int objectid, int response, float fX, float fY, float fZ, float fRotX, float fRotY, float fRotZ) {
// TODO: Implement
}
public static void OnPlayerEditAttachedObject(int playerid, int response, int index, int modelid, int boneid, float fOffsetX, float fOffsetY, float fOffsetZ, float fRotX, float fRotY, float fRotZ, float fScaleX, float fScaleY, float fScaleZ) {
// TODO: Implement
}
public static void OnPlayerSelectObject(int playerid, int type, int objectid, int modelid, float fX, float fY, float fZ) {
// TODO: Implement
}
public static int OnPlayerClickTextDraw(int playerid, int clickedid) { return 0; } // TODO: Implement
public static void OnPlayerClickPlayerTextDraw(int playerid, int playertextid) { } // TODO: Implement
public static void OnPlayerClickPlayer(int playerid, int clickedplayerid, int source) { } // TODO: Implement
public static void OnPlayerEditObject(int playerid, int playerobject, int objectid, int response, float fX, float fY, float fZ, float fRotX, float fRotY, float fRotZ) { } // TODO: Implement
public static void OnPlayerEditAttachedObject(int playerid, int response, int index, int modelid, int boneid, float fOffsetX, float fOffsetY, float fOffsetZ, float fRotX, float fRotY, float fRotZ, float fScaleX, float fScaleY, float fScaleZ ) { } // TODO: Implement
public static void OnPlayerSelectObject(int playerid, int type, int objectid, int modelid, float fX, float fY, float fZ) { } // TODO: Implement
#endregion
public static string ByteArrayToString(byte[] arr) {
public static string ByteArrayToString(byte[] arr)
{
return Encoding.UTF8.GetString(arr);
}
public static string IntPtrToString(IntPtr pointer) {
public static string IntPtrToString(IntPtr pointer)
{
return Marshal.PtrToStringAuto(pointer);
}
};

File diff suppressed because it is too large Load Diff

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.6.0.0")]
[assembly: AssemblyFileVersion("0.6.0.0")]
[assembly: AssemblyVersion("0.2.0.0")]
[assembly: AssemblyFileVersion("0.2.0.0")]

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@ -10,8 +10,8 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SAMP</RootNamespace>
<AssemblyName>sampdotnet</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ReleaseVersion>0.6 BETA</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@ -42,14 +42,8 @@
<ItemGroup>
<Compile Include="API\Enums\Alignment.cs" />
<Compile Include="API\Enums\CameraMode.cs" />
<Compile Include="API\Enums\ComponentSlot.cs" />
<Compile Include="API\Enums\SpecialAction.cs" />
<Compile Include="API\Enums\WeaponType.cs" />
<Compile Include="API\Enums\Weapon.cs" />
<Compile Include="API\Enums\WeaponState.cs" />
<Compile Include="API\Enums\ComponentSlots.cs" />
<Compile Include="API\Enums\Keys.cs" />
<Compile Include="API\EventData\RconLoginAttemptEventArgs.cs" />
<Compile Include="API\EventData\Player\PlayerUpdateEventArgs.cs" />
<Compile Include="API\EventData\Player\PlayerPickUpPickupEventArgs.cs" />
<Compile Include="API\EventData\Player\PlayerStateChangeEventArgs.cs" />
<Compile Include="API\EventData\Player\PlayerExitVehicleEventArgs.cs" />
@ -60,9 +54,7 @@
<Compile Include="API\EventData\Player\PlayerClickMapEventArgs.cs" />
<Compile Include="API\EventData\Player\PlayerSpawnEventArgs.cs" />
<Compile Include="API\EventData\Player\PlayerRequestClassEventArgs.cs" />
<Compile Include="API\EventData\Player\PlayerStreamEventArgs.cs" />
<Compile Include="API\EventData\RconCommandEventArgs.cs" />
<Compile Include="API\EventData\Vehicle\VehicleStreamEventArgs.cs" />
<Compile Include="API\EventData\Vehicle\VehicleDeathEventArgs.cs" />
<Compile Include="API\Objects\GameMode.cs" />
<Compile Include="API\Objects\GangZone.cs" />
@ -80,6 +72,7 @@
<Compile Include="API\Objects\TextDraw.cs" />
<Compile Include="API\Objects\Vehicle.cs" />
<Compile Include="API\Objects\PlayerCamera.cs" />
<Compile Include="API\Util\Constants.cs" />
<Compile Include="API\Util\SpawnInfo.cs" />
<Compile Include="API\Util\Vector2.cs" />
<Compile Include="API\Util\Server.cs" />
@ -94,6 +87,10 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="API\Util\Vector3.cs" />
</ItemGroup>
<ItemGroup>
<None Include="ClassDiagram.cd" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- 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.

View File

@ -18,13 +18,12 @@
#include "Invoke.h"
#include <stdio.h>
#include <stdlib.h>
Invoke * g_Invoke;
int Invoke::callNative(const PAWN::Native * native, ...) {
if (amx_list.empty() || amx_map.find(native->name) == amx_map.end()) {
int Invoke::callNative(const PAWN::Native * native, ...)
{
if (amx_list.empty() || amx_map.find(native->name) == amx_map.end())
{
return 0;
}
@ -33,30 +32,37 @@ int Invoke::callNative(const PAWN::Native * native, ...) {
params[0] = count * sizeof(cell);
va_list input;
va_start(input, native);
for (unsigned int i = 0; i < count; ++i) {
switch (native->data[i]) {
for (unsigned int i = 0; i < count; ++i)
{
switch (native->data[i])
{
case 'd':
case 'i': {
case 'i':
{
params[i + 1] = va_arg(input, int);
}
break;
case 'f': {
case 'f':
{
float value = (float)va_arg(input, double);
params[i + 1] = amx_ftoc(value);
}
break;
case 's': {
case 's':
{
char * string = va_arg(input, char *);
amx_Allot(amx_list.front(), strlen(string) + 1, &params[i + 1], &physAddr[variables++]);
amx_SetString(physAddr[variables - 1], string, 0, 0, strlen(string) + 1);
}
break;
case 'v': {
case 'v':
{
va_arg(input, void *);
amx_Allot(amx_list.front(), 1, &params[i + 1], &physAddr[variables++]);
}
break;
case 'p': {
case 'p':
{
va_arg(input, void *);
int size = va_arg(input, int);
amx_Allot(amx_list.front(), size, &params[++i], &physAddr[variables++]);
@ -68,29 +74,36 @@ int Invoke::callNative(const PAWN::Native * native, ...) {
va_end(input);
amx_Function_t amx_Function = (amx_Function_t)amx_addr;
int value = amx_Function(amx_list.front(), params);
if (variables) {
if (variables)
{
variables = 0;
va_start(input, native);
for (unsigned int i = 0; i < count; ++i) {
switch (native->data[i]) {
case 's': {
for (unsigned int i = 0; i < count; ++i)
{
switch (native->data[i])
{
case 's':
{
amx_Release(amx_list.front(), params[i + 1]);
}
break;
case 'v': {
case 'v':
{
unsigned int * value = va_arg(input, unsigned int *), * returnValue = (unsigned int *)physAddr[variables++];
* value = * returnValue;
amx_Release(amx_list.front(), params[i + 1]);
}
break;
case 'p': {
case 'p':
{
char * text = va_arg(input, char *);
int size = va_arg(input, int);
amx_GetString(text, physAddr[variables++], 0, size);
amx_Release(amx_list.front(), params[++i]);
}
break;
default: {
default:
{
va_arg(input, void *);
}
break;
@ -101,30 +114,36 @@ int Invoke::callNative(const PAWN::Native * native, ...) {
delete [] params;
return value;
}
#include <iostream>
int Invoke::getAddresses() {
if (gotAddresses) {
int Invoke::getAddresses()
{
if (gotAddresses)
{
return 1;
}
AMX_HEADER * amx_hdr = (AMX_HEADER *)(amx_list.back())->base;
std::size_t size = sizeof(PAWN::names) / sizeof(const char *);
for (std::size_t i = 0; i < size; ++i) {
for (std::size_t i = 0; i < size; ++i)
{
amx_FindNative(amx_list.back(), PAWN::names[i], &amx_idx);
if (amx_idx != 2147483647) {
if (amx_idx != 2147483647)
{
unsigned int amx_addr = (unsigned int)((AMX_FUNCSTUB *)((char *)amx_hdr + amx_hdr->natives + amx_hdr->defsize * amx_idx))->address;
if (amx_addr) {
if (amx_map.find(PAWN::names[i]) == amx_map.end()) {
if (amx_addr)
{
if (amx_map.find(PAWN::names[i]) == amx_map.end())
{
amx_map.insert(std::make_pair(PAWN::names[i], amx_addr));
}
}
}
}
if (amx_map.size() == size) {
if (amx_map.size() == size)
{
gotAddresses = true;
return 1;
}
return 0;
}

View File

@ -18,7 +18,7 @@
#pragma once
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
#ifdef _WIN32
#include <windows.h>
#endif
#include <algorithm>
@ -32,8 +32,8 @@
#include <string>
#include <string.h>
#include <vector>
#include "SDK/amx/amx.h"
#include "SDK/plugincommon.h"
#include "SDK\amx\amx.h"
#include "SDK\plugincommon.h"
using namespace std;
@ -48,6 +48,7 @@ namespace PAWN
static const char * const names[] =
{
// a_samp.inc
#pragma region a_samp.inc
"SendClientMessage",
"SendClientMessageToAll",
"SendPlayerMessageToPlayer",
@ -146,8 +147,10 @@ namespace PAWN
"DeletePlayer3DTextLabel",
"UpdatePlayer3DTextLabelText",
"ShowPlayerDialog",
#pragma endregion
//a_players.inc
#pragma region a_players.inc
"SetSpawnInfo",
"SpawnPlayer",
"SetPlayerPos",
@ -291,8 +294,10 @@ namespace PAWN
"StopRecordingPlayerData",
"SelectTextDraw",
"CancelSelectTextDraw",
#pragma endregion
// a_vehicle.inc
#pragma region a_vehicle.inc
"CreateVehicle",
"DestroyVehicle",
"IsVehicleStreamedIn",
@ -331,8 +336,10 @@ namespace PAWN
"GetVehicleModelInfo",
"SetVehicleVirtualWorld",
"GetVehicleVirtualWorld",
#pragma endregion
//a_objects.inc
#pragma region a_objects.inc
"CreateObject",
"AttachObjectToVehicle",
"AttachObjectToObject",
@ -366,11 +373,11 @@ namespace PAWN
"SetPlayerObjectMaterial",
"SetObjectMaterialText",
"SetPlayerObjectMaterialText",
#pragma endregion
};
/* ******************************************** *
* a_samp.inc *
* ******************************************** */
// a_samp.inc
#pragma region a_samp.inc
// Util
static const Native SendClientMessage = { "SendClientMessage", "iis" };
@ -489,10 +496,10 @@ namespace PAWN
// Player GUI Dialog
static const Native ShowPlayerDialog = { "ShowPlayerDialog", "iiissss" };
#pragma endregion
/* ******************************************** *
* a_players.inc *
* ******************************************** */
// a_players.inc
#pragma region a_players.inc
// Player
static const Native SetSpawnInfo = { "SetSpawnInfo", "iiiffffiiiiii" };
@ -666,10 +673,10 @@ namespace PAWN
static const Native StopRecordingPlayerData = { "StopRecordingPlayerData", "i" };
static const Native SelectTextDraw = { "SelectTextDraw", "ii" };
static const Native CancelSelectTextDraw = { "CancelSelectTextDraw", "i" };
#pragma endregion
/* ******************************************** *
* a_vehicles.inc *
* ******************************************** */
// a_vehicles.inc
#pragma region a_vehicles.inc
// Vehicle
static const Native CreateVehicle = { "CreateVehicle", "iffffiii" };
@ -710,10 +717,10 @@ namespace PAWN
static const Native GetVehicleModelInfo = { "GetVehicleModelInfo", "iivvv" };
static const Native SetVehicleVirtualWorld = { "SetVehicleVirtualWorld", "ii" };
static const Native GetVehicleVirtualWorld = { "GetVehicleVirtualWorld", "i" };
#pragma endregion
/* ******************************************** *
* a_objects.inc *
* ******************************************** */
// a_objects.inc
#pragma region a_objects.inc
// Objects
static const Native CreateObject = { "CreateObject", "ifffffff" };
@ -749,6 +756,7 @@ namespace PAWN
static const Native SetPlayerObjectMaterial = { "SetPlayerObjectMaterial", "iiiissi" };
static const Native SetObjectMaterialText = { "SetObjectMaterialText", "isiiiiiiii" };
static const Native SetPlayerObjectMaterialText = { "SetPlayerObjectMaterialText", "iisiiiiiiii" };
#pragma endregion
};
class
@ -767,8 +775,9 @@ public:
int amx_idx;
std::list<AMX *> amx_list;
bool gotAddresses;
private:
bool gotAddresses;
std::map<std::string, unsigned int> amx_map;
};

View File

@ -1,27 +1,23 @@
#include "Mono.h"
#include <iostream>
Mono *g_Mono;
void Mono::init() {
/*#ifndef __win32__
mono_set_dirs ("../lib/", "/etc/mono");
#endif*/
// Set up domain
this->domain = mono_jit_init_version("sampdotnet", "v2.0.50727");
this->domain = mono_jit_init_version ("sampdotnet", "v2.0.50727");
// Set up assembly, image and class for Script.dll invoke
this->assembly = mono_domain_assembly_open(this->domain, "Script.dll");
this->image = mono_assembly_get_image(this->assembly);
this->klass = mono_class_from_name(this->image, "Script", "Script");
this->assembly = mono_domain_assembly_open (this->domain, "Script.dll");
this->image = mono_assembly_get_image (this->assembly);
this->klass = mono_class_from_name (this->image, "Script", "Script");
// Invoke the loading method for Script.dll
this->callMethod("Script:Load", 0);
this->callMethod("Script:Load", NULL);
// That last method invoke was the last time we'll be calling to Script.dll
this->assembly = mono_domain_assembly_open (this->domain, "sampdotnet.dll");
this->image = mono_assembly_get_image (this->assembly);
this->klass = 0; // We don't need this anymore
this->klass = NULL; // We don't need this anymore
}
MonoString* Mono::createString(const char* string) {
@ -31,10 +27,10 @@ MonoString* Mono::createString(const char* string) {
int Mono::callReturn(const char* name, void* args[]) {
// Set method parameters
MonoMethodDesc* desc = mono_method_desc_new(name, false);
MonoMethod* method = 0;
MonoMethod* method = NULL;
// Determine if we're using the Class model or Image model
if(this->klass != 0) {
if(this->klass != NULL) {
method = mono_method_desc_search_in_class(desc, this->klass);
} else {
method = mono_method_desc_search_in_image(desc, this->image);
@ -44,8 +40,8 @@ int Mono::callReturn(const char* name, void* args[]) {
mono_method_desc_free(desc);
// Invoke and return the value
MonoObject* result = mono_runtime_invoke(method, this->klass, args, 0);
int int_result = 0;
MonoObject* result = mono_runtime_invoke(method, this->klass, args, NULL);
int int_result = NULL;
int_result = *(int*)mono_object_unbox(result);
return int_result;
}
@ -53,10 +49,10 @@ int Mono::callReturn(const char* name, void* args[]) {
void Mono::callMethod(const char* name, void* args[]) {
// Set method parameters
MonoMethodDesc* desc = mono_method_desc_new(name, false);
MonoMethod* method = 0;
MonoMethod* method = NULL;
// Determine if we're using the Class model or Image model
if(this->klass != 0) {
if(this->klass != NULL) {
method = mono_method_desc_search_in_class(desc, this->klass);
} else {
method = mono_method_desc_search_in_image(desc, this->image);
@ -66,6 +62,5 @@ void Mono::callMethod(const char* name, void* args[]) {
mono_method_desc_free(desc);
// Invoke
mono_runtime_invoke(method, this->klass, args, 0);
mono_runtime_invoke(method, this->klass, args, NULL);
}

View File

@ -1,13 +1,11 @@
#ifndef MONO_H
#define MONO_H
#ifndef _MONO_H
#define _MONO_H
#include "common.h"
// includes... duh...
#include <stdio.h>
#include <iostream>
#include <mono/jit/jit.h>
#include <mono/metadata/assembly.h>
#include <mono/metadata/debug-helpers.h>
#include <mono\jit\jit.h>
#include <mono\metadata\assembly.h>
#include <mono\metadata\debug-helpers.h>
class Mono {
public:
@ -24,6 +22,4 @@ private:
extern Mono *g_Mono;
#endif // MONO_H
#endif // _MONO_H

View File

@ -1,25 +0,0 @@
Important Note:
The Visual Studio project for the C++ hook was omitted since the introduction of the Linux-ready release.
In its place, a Code::Blocks project has been created. (Code::Blocks is a cross-platform open-source IDE)
The options have been pre-set for cross-compiling on both Windows and Linux, but there is some housekeeping you'll need to do if you want to build on either:
== Building On Windows ==
- Steps -
1) Load the project Build Options
2) Edit the Linker Settings
3) Remove the lib\limono-2.0.so library from the linker
4) Rebuild the project
- Why? -
The .so library is a Linux "shared object", equivilent to a .dll on Windows. The linker has pre-set options to scan the lib/ directory for mono-2.0.dll, so we don't need to add that back in to the list.
== Building on Linux ==
- Steps
1) Load the project Build Options
2) Edit the Linker Settings
3) Under "Other linker options", omit the "def.def" flag from the list
4) Rebuild the project
- Why? -
The definition module is a Windows-specific file for the linker to export the AMX functions to the DLL. Linux does a good job at not obfuscating function names upon compiling because it doesn't require the __stdcall convention to export said functions, so we don't need a definition module for this purpose.
It also throws errors because it's not a recognised file so just go with it.

View File

@ -24,8 +24,6 @@
#ifndef AMX_H_INCLUDED
#define AMX_H_INCLUDED
#include <stdlib.h>
#if defined __linux || defined __linux__
#define __LINUX__
#endif
@ -36,9 +34,6 @@
#include "sclinux.h"
#endif
#define HAVE_STDINT_H // Too much hassle for all of the conditionals for cross-platform support.
// Let's just get on with it and assume stdint.h is available
#if defined HAVE_STDINT_H
#include <stdint.h>
#else
@ -47,10 +42,8 @@
#include <inttypes.h>
#else
#include <stdint.h>
#define HAS_STDINT_H
#endif
#elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
#if !defined _STDINT_H
/* The ISO C99 defines the int16_t and int_32t types. If the compiler got
* here, these types are probably undefined.
*/
@ -67,10 +60,10 @@
typedef int int32_t;
typedef unsigned int uint32_t;
#else
typedef long int int32_t;
typedef unsigned long int uint32_t;
typedef long int int32_t_amx;
typedef unsigned long int uint32_t_amx;
#endif
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
#if defined __WIN32__ || defined _WIN32 || defined WIN32
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#define HAVE_I64
@ -78,10 +71,9 @@
typedef long long int64_t;
typedef unsigned long long uint64_t;
#define HAVE_I64
#endif // WIN32
#endif // Unix
#endif // STDINT_H
#endif // STDC_VERSION
#endif
#endif
#endif
#define HAVE_STDINT_H
#endif
#if defined _LP64 || defined WIN64 || defined _WIN64
@ -158,8 +150,8 @@ extern "C" {
typedef uint16_t ucell;
typedef int16_t cell;
#elif PAWN_CELL_SIZE==32
typedef uint32_t ucell;
typedef int32_t cell;
typedef uint32_t_amx ucell;
typedef int32_t_amx cell;
#elif PAWN_CELL_SIZE==64
typedef uint64_t ucell;
typedef int64_t cell;
@ -228,7 +220,7 @@ typedef struct tagAMX_FUNCSTUB {
typedef struct tagFUNCSTUBNT {
ucell address PACKED;
uint32_t nameofs PACKED;
uint32_t_amx nameofs PACKED;
} PACKED AMX_FUNCSTUBNT;
/* The AMX structure is the internal structure for many functions. Not all
@ -271,23 +263,23 @@ typedef struct tagAMX {
* structure is used internaly.
*/
typedef struct tagAMX_HEADER {
int32_t size PACKED; /* size of the "file" */
int32_t_amx size PACKED; /* size of the "file" */
uint16_t magic PACKED; /* signature */
char file_version; /* file format version */
char amx_version; /* required version of the AMX */
int16_t flags PACKED;
int16_t defsize PACKED; /* size of a definition record */
int32_t cod PACKED; /* initial value of COD - code block */
int32_t dat PACKED; /* initial value of DAT - data block */
int32_t hea PACKED; /* initial value of HEA - start of the heap */
int32_t stp PACKED; /* initial value of STP - stack top */
int32_t cip PACKED; /* initial value of CIP - the instruction pointer */
int32_t publics PACKED; /* offset to the "public functions" table */
int32_t natives PACKED; /* offset to the "native functions" table */
int32_t libraries PACKED; /* offset to the table of libraries */
int32_t pubvars PACKED; /* the "public variables" table */
int32_t tags PACKED; /* the "public tagnames" table */
int32_t nametable PACKED; /* name table */
int32_t_amx cod PACKED; /* initial value of COD - code block */
int32_t_amx dat PACKED; /* initial value of DAT - data block */
int32_t_amx hea PACKED; /* initial value of HEA - start of the heap */
int32_t_amx stp PACKED; /* initial value of STP - stack top */
int32_t_amx cip PACKED; /* initial value of CIP - the instruction pointer */
int32_t_amx publics PACKED; /* offset to the "public functions" table */
int32_t_amx natives PACKED; /* offset to the "native functions" table */
int32_t_amx libraries PACKED; /* offset to the table of libraries */
int32_t_amx pubvars PACKED; /* the "public variables" table */
int32_t_amx tags PACKED; /* the "public tagnames" table */
int32_t_amx nametable PACKED; /* name table */
} PACKED AMX_HEADER;
#if PAWN_CELL_SIZE==16
@ -375,7 +367,7 @@ enum
} while (0)
uint16_t * AMXAPI amx_Align16(uint16_t *v);
uint32_t * AMXAPI amx_Align32(uint32_t *v);
uint32_t_amx * AMXAPI amx_Align32(uint32_t_amx *v);
#if defined _I64_MAX || defined HAVE_I64
uint64_t * AMXAPI amx_Align64(uint64_t *v);
#endif
@ -449,4 +441,3 @@ int AMXAPI amx_UTF8Put(char *string, char **endptr, int maxchars, cell value);
#endif
#endif /* AMX_H_INCLUDED */

View File

@ -26,8 +26,8 @@ uint16_t * AMXAPI amx_Align16(uint16_t *v)
return fn(v);
}
typedef uint32_t * AMXAPI (*amx_Align32_t)(uint32_t *v);
uint32_t * AMXAPI amx_Align32(uint32_t *v)
typedef uint32_t_amx * AMXAPI (*amx_Align32_t)(uint32_t_amx *v);
uint32_t_amx * AMXAPI amx_Align32(uint32_t_amx *v)
{
amx_Align32_t fn = ((amx_Align32_t*)pAMXFunctions)[PLUGIN_AMX_EXPORT_Align32];
return fn(v);
@ -331,4 +331,3 @@ int AMXAPI amx_UTF8Put(char *string, char **endptr, int maxchars, cell value)
//----------------------------------------------------------
// EOF

View File

@ -32,11 +32,10 @@
#endif
#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
#ifndef _MSC_VER
// #pragma message "Warning: Not using a VC++ compiler."
#pragma message "Warning: Not using a VC++ compiler."
#endif
#define PLUGIN_CALL __stdcall
// #define PLUGIN_CALL __cdecl
#define PLUGIN_EXPORT PLUGIN_EXTERN_C __declspec( dllexport )
#define PLUGIN_EXPORT PLUGIN_EXTERN_C
#else
#error "You must define one of WIN32, LINUX or FREEBSD"
#endif

View File

@ -0,0 +1,157 @@
#include "a_samp.h"
int CreateObject(int modelid, float x, float y, float z, float rx, float ry, float rz, float drawdistance) {
return g_Invoke->callNative(&PAWN::CreateObject, modelid, x, y, z, rx, ry, rz, drawdistance);
}
void AttachObjectToVehicle(int objectid, int vehicleid, float offsetx, float offsety, float offsetz, float rotx, float roty, float rotz) {
g_Invoke->callNative(&PAWN::AttachObjectToVehicle, objectid, vehicleid, offsetx, offsety, offsetz, rotx, roty, rotz);
}
void AttachObjectToObject(int objectid, int attachtoid, float offsetx, float offsety, float offsetz, float rotx, float roty, float rotz, int SyncRotation) {
g_Invoke->callNative(&PAWN::AttachObjectToObject, objectid, attachtoid, offsetx, offsety, offsetz, rotx, roty, rotz, SyncRotation);
}
void AttachObjectToPlayer(int objectid, int playerid, float offsetx, float offsety, float offsetz, float rotx, float roty, float rotz) {
g_Invoke->callNative(&PAWN::AttachObjectToPlayer, objectid, playerid, offsetx, offsety, offsetz, rotx, roty, rotz);
}
void SetObjectPos(int objectid, float x, float y, float z) {
g_Invoke->callNative(&PAWN::SetObjectPos, objectid, x, y, z);
}
void GetObjectPos(int objectid, float& x, float& y, float& z) {
float _x = NULL;
float _y = NULL;
float _z = NULL;
g_Invoke->callNative(&PAWN::GetObjectPos, objectid, &_x, &_y, &_z);
x = _x;
y = _y;
z = _z;
}
void SetObjectRot(int objectid, float rotx, float roty, float rotz) {
g_Invoke->callNative(&PAWN::SetObjectRot, objectid, rotx, roty, rotz);
}
void GetObjectRot(int objectid, float& rotx, float& roty, float& rotz) {
float _rotx = NULL;
float _roty = NULL;
float _rotz = NULL;
g_Invoke->callNative(&PAWN::GetObjectRot, objectid, &_rotx, &_roty, &_rotz);
rotx = _rotx;
roty = _roty;
rotz = _rotz;
}
int IsValidObject(int objectid) {
return g_Invoke->callNative(&PAWN::IsValidObject, objectid);
}
void DestroyObject(int objectid) {
g_Invoke->callNative(&PAWN::DestroyObject, objectid);
}
void MoveObject(int objectid, float x, float y, float z, float speed, float rotx, float roty, float rotz) {
g_Invoke->callNative(&PAWN::MoveObject, objectid, x, y, z, speed, rotx, roty, rotz);
}
void StopObject(int objectid) {
g_Invoke->callNative(&PAWN::StopObject, objectid);
}
int IsObjectMoving(int objectid) {
return g_Invoke->callNative(&PAWN::IsObjectMoving, objectid);
}
void EditObject(int playerid, int objectid) {
g_Invoke->callNative(&PAWN::EditObject, playerid, objectid);
}
void EditPlayerObject(int playerid, int objectid) {
g_Invoke->callNative(&PAWN::EditPlayerObject, playerid, objectid);
}
void SelectObject(int playerid) {
g_Invoke->callNative(&PAWN::SelectObject, playerid);
}
void CancelEdit(int playerid) {
g_Invoke->callNative(&PAWN::CancelEdit, playerid);
}
int CreatePlayerObject(int playerid, int modelid, float x, float y, float z, float rx, float ry, float rz, float drawdistance) {
return g_Invoke->callNative(&PAWN::CreatePlayerObject, playerid, modelid, x, y, z, rx, ry, rz, drawdistance);
}
void AttachPlayerObjectToVehicle(int playerid, int objectid, int vehicleid, float foffsetx, float foffsety, float foffsetz, float frotx, float froty, float rotz) {
g_Invoke->callNative(&PAWN::AttachPlayerObjectToVehicle, playerid, objectid, vehicleid, foffsetx, foffsety, foffsetz, frotx, froty, rotz);
}
void SetPlayerObjectPos(int playerid, int objectid, float x, float y, float z) {
g_Invoke->callNative(&PAWN::SetPlayerObjectPos, playerid, objectid, x, y, z);
}
void GetPlayerObjectPos(int playerid, int objectid, float& x, float& y, float& z) {
float _x = NULL;
float _y = NULL;
float _z = NULL;
g_Invoke->callNative(&PAWN::GetPlayerObjectPos, playerid, objectid, &_x, &_y, &_z);
x = _x;
y = _y;
z = _z;
}
void SetPlayerObjectRot(int playerid, int objectid, float rotx, float roty, float rotz) {
g_Invoke->callNative(&PAWN::SetPlayerObjectRot, playerid, objectid, rotx, roty, rotz);
}
void GetPlayerObjectRot(int playerid, int objectid, float& rotx, float& roty, float& rotz) {
float _rotx = NULL;
float _roty = NULL;
float _rotz = NULL;
g_Invoke->callNative(&PAWN::GetPlayerObjectRot, playerid, objectid, &_rotx, &_roty, &_rotz);
rotx = _rotx;
roty = _roty;
rotz = _rotz;
}
void IsValidPlayerObject(int playerid, int objectid) {
g_Invoke->callNative(&PAWN::IsValidPlayerObject, playerid, objectid);
}
void DestroyPlayerObject(int playerid, int objectid) {
g_Invoke->callNative(&PAWN::DestroyPlayerObject, playerid, objectid);
}
void MovePlayerObject(int playerid, int objectid, float x, float y, float z, float speed, float rotx, float roty, float rotz) {
g_Invoke->callNative(&PAWN::MovePlayerObject, playerid, objectid, x, y, z, speed, rotx, roty, rotz);
}
void StopPlayerObject(int playerid, int objectid) {
g_Invoke->callNative(&PAWN::StopPlayerObject, playerid, objectid);
}
void IsPlayerObjectMoving(int playerid, int objectid) {
g_Invoke->callNative(&PAWN::IsPlayerObjectMoving, playerid, objectid);
}
void AttachPlayerObjectToPlayer(int objectplayer, int objectid, int attachplayer, float offsetx, float offsety, float offsetz, float rx, float ry, float rz) {
g_Invoke->callNative(&PAWN::AttachPlayerObjectToPlayer, objectplayer, objectid, attachplayer, offsetx, offsety, offsetz, rx, ry, rz);
}
void SetObjectMaterial(int objectid, int materialindex, int modelid, char* txdname, char* texturename, int materialcolor) {
g_Invoke->callNative(&PAWN::SetObjectMaterial, objectid, materialindex, modelid, txdname, texturename, materialcolor);
}
void SetPlayerObjectMaterial(int playerid, int objectid, int materialindex, int modelid, char* txdname, char* texturename, int materialcolor) {
g_Invoke->callNative(&PAWN::SetPlayerObjectMaterial, playerid, objectid, materialindex, modelid, txdname, texturename, materialcolor);
}
void SetObjectMaterialText(int objectid, char* text, int materialindex, int materialsize, char* fontface, int fontsize, int bold, unsigned int fontcolor, int backcolor, int textalignment) {
g_Invoke->callNative(&PAWN::SetObjectMaterialText, objectid, text, materialindex, materialsize, fontface, fontsize, bold, fontcolor, backcolor, textalignment);
}
void SetPlayerObjectMaterialText(int playerid, int objectid, char* text, int materialindex, int materialsize, char* fontface, int fontsize, int bold, unsigned int fontcolor, int backcolor, int textalignment) {
g_Invoke->callNative(&PAWN::SetPlayerObjectMaterialText, playerid, objectid, text, materialindex, materialsize, fontface, fontsize, bold, fontcolor, backcolor, textalignment);
}

View File

@ -0,0 +1,38 @@
#ifndef _A_OBJECTS_H
#define _A_OBJECTS_H
int CreateObject(int modelid, float x, float y, float z, float rx, float ry, float rz, float drawdistance=0.0);
void AttachObjectToVehicle(int objectid, int vehicleid, float offsetx, float offsety, float offsetz, float rotx, float roty, float rotz);
void AttachObjectToObject(int objectid, int attachtoid, float offsetx, float offsety, float offsetz, float rotx, float roty, float rotz, int syncrotation=1);
void AttachObjectToPlayer(int objectid, int playerid, float offsetx, float offsety, float offsetz, float rotx, float roty, float rotz);
void SetObjectPos(int objectid, float x, float y, float z);
void GetObjectPos(int objectid, float& x, float& y, float& z);
void SetObjectRot(int objectid, float rotx, float roty, float rotz);
void GetObjectRot(int objectid, float& rotx, float& roty, float& rotz);
int IsValidObject(int objectid);
void DestroyObject(int objectid);
void MoveObject(int objectid, float x, float y, float z, float speed, float rotx=-1000.0, float roty=-1000.0, float rotz=-1000.0);
void StopObject(int objectid);
int IsObjectMoving(int objectid);
void EditObject(int playerid, int objectid);
void EditPlayerObject(int playerid, int objectid);
void SelectObject(int playerid);
void CancelEdit(int playerid);
int CreatePlayerObject(int playerid, int modelid, float x, float y, float z, float rx, float ry, float rz, float drawdistance=0.0);
void AttachPlayerObjectToVehicle(int playerid, int objectid, int vehicleid, float foffsetx, float foffsety, float foffsetz, float frotx, float froty, float rotz);
void SetPlayerObjectPos(int playerid, int objectid, float x, float y, float z);
void GetPlayerObjectPos(int playerid, int objectid, float& x, float& y, float& z);
void SetPlayerObjectRot(int playerid, int objectid, float rotx, float roty, float rotz);
void GetPlayerObjectRot(int playerid, int objectid, float& rotx, float& roty, float& rotz);
void IsValidPlayerObject(int playerid, int objectid);
void DestroyPlayerObject(int playerid, int objectid);
void MovePlayerObject(int playerid, int objectid, float x, float y, float z, float speed, float rotx=-1000.0, float roty=-1000.0, float rotz=-1000.0);
void StopPlayerObject(int playerid, int objectid);
void IsPlayerObjectMoving(int playerid, int objectid);
void AttachPlayerObjectToPlayer(int objectplayer, int objectid, int attachplayer, float offsetx, float offsety, float offsetz, float rx, float ry, float rz);
void SetObjectMaterial(int objectid, int materialindex, int modelid, char* txdname, char* texturename, int materialcolor=0);
void SetPlayerObjectMaterial(int playerid, int objectid, int materialindex, int modelid, char* txdname, char* texturename, int materialcolor=0);
void SetObjectMaterialText(int objectid, char* text, int materialindex=0, int materialsize=90, char* fontface="arial", int fontsize=24, int bold=1, unsigned int fontcolor=0xffffffff, int backcolor=0, int textalignment=0);
void SetPlayerObjectMaterialText(int playerid, int objectid, char* text, int materialindex=0, int materialsize=90, char* fontface="arial", int fontsize=24, int bold=1, unsigned int fontcolor=0xffffffff, int backcolor=0, int textalignment=0);
#endif //_A_OBJECTS_H

View File

@ -1,37 +1,37 @@
#include "a_samp.h"
void _samp_SetSpawnInfo(int playerid, int team, int skin, float x, float y, float z, float rotation, int weapon1, int weapon1_ammo, int weapon2, int weapon2_ammo, int weapon3, int weapon3_ammo) {
void SetSpawnInfo(int playerid, int team, int skin, float x, float y, float z, float rotation, int weapon1, int weapon1_ammo, int weapon2, int weapon2_ammo, int weapon3, int weapon3_ammo) {
g_Invoke->callNative(&PAWN::SetSpawnInfo, playerid, team, skin, x, y, z, rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
}
void _samp_SpawnPlayer(int playerid) {
void SpawnPlayer(int playerid) {
g_Invoke->callNative(&PAWN::SpawnPlayer, playerid);
}
void _samp_SetPlayerPos(int playerid, float x, float y, float z) {
void SetPlayerPos(int playerid, float x, float y, float z) {
g_Invoke->callNative(&PAWN::SetPlayerPos, playerid, x, y, z);
}
void _samp_SetPlayerPosFindZ(int playerid, float x, float y, float z) {
void SetPlayerPosFindZ(int playerid, float x, float y, float z) {
g_Invoke->callNative(&PAWN::SetPlayerPosFindZ, playerid, x, y, z);
}
void _samp_GetPlayerPos(int playerid, float& x, float& y, float& z) {
float _x = 0.0;
float _y = 0.0;
float _z = 0.0;
void GetPlayerPos(int playerid, float& x, float& y, float& z) {
float _x = NULL;
float _y = NULL;
float _z = NULL;
g_Invoke->callNative(&PAWN::GetPlayerPos, playerid, &_x, &_y, &_z);
x = _x;
y = _y;
z = _z;
}
void _samp_SetPlayerFacingAngle(int playerid, float ang) {
void SetPlayerFacingAngle(int playerid, float ang) {
g_Invoke->callNative(&PAWN::SetPlayerFacingAngle, playerid, ang);
}
void _samp_GetPlayerFacingAngle(int playerid, float& ang) {
float _ang = 0.0;
void GetPlayerFacingAngle(int playerid, float& ang) {
float _ang = NULL;
g_Invoke->callNative(&PAWN::GetPlayerFacingAngle, playerid, &_ang);
ang = _ang;
}
@ -44,575 +44,576 @@ void _samp_GetPlayerFacingAngle(int playerid, float& ang) {
return (float)g_Invoke->callNative(&PAWN::GetPlayerDistanceFromPoint, playerid, x, y, z);
}*/
int _samp_IsPlayerStreamedIn(int playerid, int forplayerid) {
int IsPlayerStreamedIn(int playerid, int forplayerid) {
return g_Invoke->callNative(&PAWN::IsPlayerStreamedIn, playerid, forplayerid);
}
void _samp_SetPlayerInterior(int playerid, int interiorid) {
void SetPlayerInterior(int playerid, int interiorid) {
g_Invoke->callNative(&PAWN::SetPlayerInterior, playerid, interiorid);
}
int _samp_GetPlayerInterior(int playerid) {
int GetPlayerInterior(int playerid) {
return g_Invoke->callNative(&PAWN::GetPlayerInterior, playerid);
}
void _samp_SetPlayerHealth(int playerid, float health) {
void SetPlayerHealth(int playerid, float health) {
g_Invoke->callNative(&PAWN::SetPlayerHealth, playerid, health);
}
void _samp_GetPlayerHealth(int playerid, float& health) {
float _health = 0.0;
void GetPlayerHealth(int playerid, float& health) {
float _health = NULL;
g_Invoke->callNative(&PAWN::GetPlayerHealth, playerid, &_health);
health = _health;
}
void _samp_SetPlayerArmour(int playerid, float armour) {
void SetPlayerArmour(int playerid, float armour) {
g_Invoke->callNative(&PAWN::SetPlayerArmour, playerid, armour);
}
void _samp_GetPlayerArmour(int playerid, float& armour) {
float _armour = 0.0;
void GetPlayerArmour(int playerid, float& armour) {
float _armour = NULL;
g_Invoke->callNative(&PAWN::GetPlayerArmour, playerid, &_armour);
armour = _armour;
}
void _samp_SetPlayerAmmo(int playerid, int weaponslot, int ammo) {
void SetPlayerAmmo(int playerid, int weaponslot, int ammo) {
g_Invoke->callNative(&PAWN::SetPlayerAmmo, playerid, weaponslot, ammo);
}
int _samp_GetPlayerAmmo(int playerid) {
int GetPlayerAmmo(int playerid) {
return g_Invoke->callNative(&PAWN::GetPlayerAmmo, playerid);
}
int _samp_GetPlayerWeaponState(int playerid) {
int GetPlayerWeaponState(int playerid) {
return g_Invoke->callNative(&PAWN::GetPlayerWeaponState, playerid);
}
int _samp_GetPlayerTargetPlayer(int playerid) {
int GetPlayerTargetPlayer(int playerid) {
return g_Invoke->callNative(&PAWN::GetPlayerTargetPlayer, playerid);
}
void _samp_SetPlayerTeam(int playerid, int teamid) {
void SetPlayerTeam(int playerid, int teamid) {
g_Invoke->callNative(&PAWN::SetPlayerTeam, playerid, teamid);
}
int _samp_GetPlayerTeam(int playerid) {
int GetPlayerTeam(int playerid) {
return g_Invoke->callNative(&PAWN::GetPlayerTeam, playerid);
}
void _samp_SetPlayerScore(int playerid, int score) {
void SetPlayerScore(int playerid, int score) {
g_Invoke->callNative(&PAWN::SetPlayerScore, playerid, score);
}
int _samp_GetPlayerScore(int playerid) {
int GetPlayerScore(int playerid) {
return g_Invoke->callNative(&PAWN::GetPlayerScore, playerid);
}
int _samp_GetPlayerDrunkLevel(int playerid) {
int GetPlayerDrunkLevel(int playerid) {
return g_Invoke->callNative(&PAWN::GetPlayerDrunkLevel, playerid);
}
void _samp_SetPlayerDrunkLevel(int playerid, int level) {
void SetPlayerDrunkLevel(int playerid, int level) {
g_Invoke->callNative(&PAWN::SetPlayerDrunkLevel, playerid, level);
}
void _samp_SetPlayerColor(int playerid, unsigned int color) {
void SetPlayerColor(int playerid, unsigned int color) {
g_Invoke->callNative(&PAWN::SetPlayerColor, playerid, color);
}
unsigned int _samp_GetPlayerColor(int playerid) {
int GetPlayerColor(int playerid) {
return g_Invoke->callNative(&PAWN::GetPlayerColor, playerid);
}
void _samp_SetPlayerSkin(int playerid, int skinid) {
void SetPlayerSkin(int playerid, int skinid) {
g_Invoke->callNative(&PAWN::SetPlayerSkin, playerid, skinid);
}
int _samp_GetPlayerSkin(int playerid) {
int GetPlayerSkin(int playerid) {
return g_Invoke->callNative(&PAWN::GetPlayerSkin, playerid);
}
void _samp_GivePlayerWeapon(int playerid, int weaponid, int ammo) {
void GivePlayerWeapon(int playerid, int weaponid, int ammo) {
g_Invoke->callNative(&PAWN::GivePlayerWeapon, playerid, weaponid, ammo);
}
void _samp_ResetPlayerWeapons(int playerid) {
void ResetPlayerWeapons(int playerid) {
g_Invoke->callNative(&PAWN::ResetPlayerWeapons, playerid);
}
void _samp_SetPlayerArmedWeapon(int playerid, int weaponid) {
void SetPlayerArmedWeapon(int playerid, int weaponid) {
g_Invoke->callNative(&PAWN::SetPlayerArmedWeapon, playerid, weaponid);
}
void _samp_GetPlayerWeaponData(int playerid, int slot, int& weapons, int& ammo) {
int _weapons = 0;
int _ammo = 0;
void GetPlayerWeaponData(int playerid, int slot, int& weapons, int& ammo) {
int _weapons = NULL;
int _ammo = NULL;
g_Invoke->callNative(&PAWN::GetPlayerWeaponData, playerid, slot, &_weapons, &_ammo);
weapons = _weapons;
ammo = _ammo;
}
void _samp_GivePlayerMoney(int playerid, int money) {
void GivePlayerMoney(int playerid, int money) {
g_Invoke->callNative(&PAWN::GivePlayerMoney, playerid, money);
}
void _samp_ResetPlayerMoney(int playerid) {
void ResetPlayerMoney(int playerid) {
g_Invoke->callNative(&PAWN::ResetPlayerMoney, playerid);
}
void _samp_SetPlayerName(int playerid, char* name) {
void SetPlayerName(int playerid, char* name) {
g_Invoke->callNative(&PAWN::SetPlayerName, playerid, name);
}
int _samp_GetPlayerMoney(int playerid) {
int GetPlayerMoney(int playerid) {
return g_Invoke->callNative(&PAWN::GetPlayerMoney, playerid);
}
int _samp_GetPlayerState(int playerid) {
int GetPlayerState(int playerid) {
return g_Invoke->callNative(&PAWN::GetPlayerState, playerid);
}
void _samp_GetPlayerIp(int playerid, char* name, int len) {
void GetPlayerIp(int playerid, char* name, int len) {
g_Invoke->callNative(&PAWN::GetPlayerIp, playerid, name, len);
}
int _samp_GetPlayerPing(int playerid) {
int GetPlayerPing(int playerid) {
return g_Invoke->callNative(&PAWN::GetPlayerPing, playerid);
}
int _samp_GetPlayerWeapon(int playerid) {
int GetPlayerWeapon(int playerid) {
return g_Invoke->callNative(&PAWN::GetPlayerWeapon, playerid);
}
void _samp_GetPlayerKeys(int playerid, int& keys, int& updown, int& leftright) {
int _keys = 0;
int _updown = 0;
int _leftright = 0;
void GetPlayerKeys(int playerid, int& keys, int& updown, int& leftright) {
int _keys = NULL;
int _updown = NULL;
int _leftright = NULL;
g_Invoke->callNative(&PAWN::GetPlayerKeys, playerid, &_keys, &_updown, &_leftright);
keys = _keys;
updown = _updown;
leftright = _leftright;
}
void _samp_GetPlayerName(int playerid, char* name, int len) {
g_Invoke->callNative(&PAWN::GetPlayerName, playerid, name, len);
void GetPlayerName(int playerid, char* name, int len) {
char _name[MAX_PLAYER_NAME];
g_Invoke->callNative(&PAWN::GetPlayerName, playerid, _name, sizeof(_name));
strncpy_s(name, len, _name, _TRUNCATE);
}
void _samp_SetPlayerTime(int playerid, int hour, int minute) {
void SetPlayerTime(int playerid, int hour, int minute) {
g_Invoke->callNative(&PAWN::SetPlayerTime, playerid, hour, minute);
}
void _samp_GetPlayerTime(int playerid, int& hour, int& minute) {
int _hour = 0;
int _minute = 0;
void GetPlayerTime(int playerid, int& hour, int& minute) {
int _hour = NULL;
int _minute = NULL;
g_Invoke->callNative(&PAWN::GetPlayerTime, playerid, &_hour, &_minute);
hour = _hour;
minute = _minute;
}
void _samp_TogglePlayerClock(int playerid, int toggle) {
void TogglePlayerClock(int playerid, int toggle) {
g_Invoke->callNative(&PAWN::TogglePlayerClock, playerid, toggle);
}
void _samp_SetPlayerWeather(int playerid, int weather) {
void SetPlayerWeather(int playerid, int weather) {
g_Invoke->callNative(&PAWN::SetPlayerWeather, playerid, weather);
}
void _samp_ForceClassSelection(int playerid) {
void ForceClassSelection(int playerid) {
g_Invoke->callNative(&PAWN::ForceClassSelection, playerid);
}
void _samp_SetPlayerWantedLevel(int playerid, int level) {
void SetPlayerWantedLevel(int playerid, int level) {
g_Invoke->callNative(&PAWN::SetPlayerWantedLevel, playerid, level);
}
int _samp_GetPlayerWantedLevel(int playerid) {
int GetPlayerWantedLevel(int playerid) {
return g_Invoke->callNative(&PAWN::GetPlayerWantedLevel, playerid);
}
void _samp_SetPlayerFightingStyle(int playerid, int style) {
void SetPlayerFightingStyle(int playerid, int style) {
g_Invoke->callNative(&PAWN::SetPlayerFightingStyle, playerid, style);
}
int _samp_GetPlayerFightingStyle(int playerid) {
int GetPlayerFightingStyle(int playerid) {
return g_Invoke->callNative(&PAWN::GetPlayerFightingStyle, playerid);
}
void _samp_SetPlayerVelocity(int playerid, float x, float y, float z) {
void SetPlayerVelocity(int playerid, float x, float y, float z) {
g_Invoke->callNative(&PAWN::SetPlayerVelocity, playerid, x, y, z);
}
void _samp_GetPlayerVelocity(int playerid, float& x, float& y, float& z) {
float _x = 0.0;
float _y = 0.0;
float _z = 0.0;
void GetPlayerVelocity(int playerid, float& x, float& y, float& z) {
float _x = NULL;
float _y = NULL;
float _z = NULL;
g_Invoke->callNative(&PAWN::GetPlayerVelocity, playerid, &_x, &_y, &_z);
x = _x;
y = _y;
z = _z;
}
void _samp_PlayCrimeReportForPlayer(int playerid, int suspectid, int crime) {
void PlayCrimeReportForPlayer(int playerid, int suspectid, int crime) {
g_Invoke->callNative(&PAWN::PlayCrimeReportForPlayer, playerid, suspectid, crime);
}
void _samp_PlayAudioStreamForPlayer(int playerid, char* url, float posx , float posy , float posz , float distance , int usepos ) {
void PlayAudioStreamForPlayer(int playerid, char* url, float posx , float posy , float posz , float distance , int usepos ) {
g_Invoke->callNative(&PAWN::PlayAudioStreamForPlayer, playerid, url, posx = 0.0, posy = 0.0, posz = 0.0, distance = 50.0, usepos = 0);
}
void _samp_StopAudioStreamForPlayer(int playerid) {
void StopAudioStreamForPlayer(int playerid) {
g_Invoke->callNative(&PAWN::StopAudioStreamForPlayer, playerid);
}
void _samp_SetPlayerShopName(int playerid, char* shopname) {
void SetPlayerShopName(int playerid, char* shopname) {
g_Invoke->callNative(&PAWN::SetPlayerShopName, playerid, shopname);
}
void _samp_SetPlayerSkillLevel(int playerid, int skill, int level) {
void SetPlayerSkillLevel(int playerid, int skill, int level) {
g_Invoke->callNative(&PAWN::SetPlayerSkillLevel, playerid, skill, level);
}
int _samp_GetPlayerSurfingVehicleID(int playerid) {
int GetPlayerSurfingVehicleID(int playerid) {
return g_Invoke->callNative(&PAWN::GetPlayerSurfingVehicleID, playerid);
}
int _samp_GetPlayerSurfingObjectID(int playerid) {
int GetPlayerSurfingObjectID(int playerid) {
return g_Invoke->callNative(&PAWN::GetPlayerSurfingObjectID, playerid);
}
void _samp_RemoveBuildingForPlayer(int playerid, int modelid, float fx, float fy, float fz, float fradius) {
void RemoveBuildingForPlayer(int playerid, int modelid, float fx, float fy, float fz, float fradius) {
g_Invoke->callNative(&PAWN::RemoveBuildingForPlayer, playerid, modelid, fx, fy, fz, fradius);
}
void _samp_SetPlayerAttachedObject(int playerid, int index, int modelid, int bone, float foffsetx , float foffsety , float foffsetz , float frotx , float froty , float frotz , float fscalex , float fscaley , float fscalez , int materialcolor1 , int materialcolor2 ) {
void SetPlayerAttachedObject(int playerid, int index, int modelid, int bone, float foffsetx , float foffsety , float foffsetz , float frotx , float froty , float frotz , float fscalex , float fscaley , float fscalez , int materialcolor1 , int materialcolor2 ) {
g_Invoke->callNative(&PAWN::SetPlayerAttachedObject, playerid, index, modelid, bone, foffsetx = 0.0, foffsety = 0.0, foffsetz = 0.0, frotx = 0.0, froty = 0.0, frotz = 0.0, fscalex = 1.0, fscaley = 1.0, fscalez = 1.0, materialcolor1 = 0, materialcolor2 = 0);
}
void _samp_RemovePlayerAttachedObject(int playerid, int index) {
void RemovePlayerAttachedObject(int playerid, int index) {
g_Invoke->callNative(&PAWN::RemovePlayerAttachedObject, playerid, index);
}
void _samp_IsPlayerAttachedObjectSlotUsed(int playerid, int index) {
void IsPlayerAttachedObjectSlotUsed(int playerid, int index) {
g_Invoke->callNative(&PAWN::IsPlayerAttachedObjectSlotUsed, playerid, index);
}
void _samp_EditAttachedObject(int playerid, int index) {
void EditAttachedObject(int playerid, int index) {
g_Invoke->callNative(&PAWN::EditAttachedObject, playerid, index);
}
int _samp_CreatePlayerTextDraw(int playerid, float x, float y, char* text) {
int CreatePlayerTextDraw(int playerid, float x, float y, char* text) {
return g_Invoke->callNative(&PAWN::CreatePlayerTextDraw, playerid, x, y, text);
}
void _samp_PlayerTextDrawDestroy(int playerid, int text) {
void PlayerTextDrawDestroy(int playerid, int text) {
g_Invoke->callNative(&PAWN::PlayerTextDrawDestroy, playerid, text);
}
void _samp_PlayerTextDrawLetterSize(int playerid, int text, float x, float y) {
void PlayerTextDrawLetterSize(int playerid, int text, float x, float y) {
g_Invoke->callNative(&PAWN::PlayerTextDrawLetterSize, playerid, text, x, y);
}
void _samp_PlayerTextDrawTextSize(int playerid, int text, float x, float y) {
void PlayerTextDrawTextSize(int playerid, int text, float x, float y) {
g_Invoke->callNative(&PAWN::PlayerTextDrawTextSize, playerid, text, x, y);
}
void _samp_PlayerTextDrawAlignment(int playerid, int text, int alignment) {
void PlayerTextDrawAlignment(int playerid, int text, int alignment) {
g_Invoke->callNative(&PAWN::PlayerTextDrawAlignment, playerid, text, alignment);
}
void _samp_PlayerTextDrawColor(int playerid, int text, unsigned int color) {
void PlayerTextDrawColor(int playerid, int text, unsigned int color) {
g_Invoke->callNative(&PAWN::PlayerTextDrawColor, playerid, text, color);
}
void _samp_PlayerTextDrawUseBox(int playerid, int text, int use) {
void PlayerTextDrawUseBox(int playerid, int text, int use) {
g_Invoke->callNative(&PAWN::PlayerTextDrawUseBox, playerid, text, use);
}
void _samp_PlayerTextDrawBoxColor(int playerid, int text, unsigned int color) {
void PlayerTextDrawBoxColor(int playerid, int text, unsigned int color) {
g_Invoke->callNative(&PAWN::PlayerTextDrawBoxColor, playerid, text, color);
}
void _samp_PlayerTextDrawSetShadow(int playerid, int text, int size) {
void PlayerTextDrawSetShadow(int playerid, int text, int size) {
g_Invoke->callNative(&PAWN::PlayerTextDrawSetShadow, playerid, text, size);
}
void _samp_PlayerTextDrawSetOutline(int playerid, int text, int size) {
void PlayerTextDrawSetOutline(int playerid, int text, int size) {
g_Invoke->callNative(&PAWN::PlayerTextDrawSetOutline, playerid, text, size);
}
void _samp_PlayerTextDrawBackgroundColor(int playerid, int text, unsigned int color) {
void PlayerTextDrawBackgroundColor(int playerid, int text, unsigned int color) {
g_Invoke->callNative(&PAWN::PlayerTextDrawBackgroundColor, playerid, text, color);
}
void _samp_PlayerTextDrawFont(int playerid, int text, int font) {
void PlayerTextDrawFont(int playerid, int text, int font) {
g_Invoke->callNative(&PAWN::PlayerTextDrawFont, playerid, text, font);
}
void _samp_PlayerTextDrawSetProportional(int playerid, int text, int set) {
void PlayerTextDrawSetProportional(int playerid, int text, int set) {
g_Invoke->callNative(&PAWN::PlayerTextDrawSetProportional, playerid, text, set);
}
void _samp_PlayerTextDrawSetSelectable(int playerid, int text, int set) {
void PlayerTextDrawSetSelectable(int playerid, int text, int set) {
g_Invoke->callNative(&PAWN::PlayerTextDrawSetSelectable, playerid, text, set);
}
void _samp_PlayerTextDrawShow(int playerid, int text) {
void PlayerTextDrawShow(int playerid, int text) {
g_Invoke->callNative(&PAWN::PlayerTextDrawShow, playerid, text);
}
void _samp_PlayerTextDrawHide(int playerid, int text) {
void PlayerTextDrawHide(int playerid, int text) {
g_Invoke->callNative(&PAWN::PlayerTextDrawHide, playerid, text);
}
void _samp_PlayerTextDrawSetString(int playerid, int text, char* string) {
void PlayerTextDrawSetString(int playerid, int text, char* string) {
g_Invoke->callNative(&PAWN::PlayerTextDrawSetString, playerid, text, string);
}
void _samp_SetPVarInt(int playerid, char* varname, int int_value) {
void SetPVarInt(int playerid, char* varname, int int_value) {
g_Invoke->callNative(&PAWN::SetPVarInt, playerid, varname, int_value);
}
void _samp_GetPVarInt(int playerid, char* varname) {
void GetPVarInt(int playerid, char* varname) {
g_Invoke->callNative(&PAWN::GetPVarInt, playerid, varname);
}
void _samp_SetPVarString(int playerid, char* varname, char* string_value) {
void SetPVarString(int playerid, char* varname, char* string_value) {
g_Invoke->callNative(&PAWN::SetPVarString, playerid, varname, string_value);
}
void _samp_GetPVarString(int playerid, char* varname, char* string_return, int len) {
void GetPVarString(int playerid, char* varname, char* string_return, int len) {
g_Invoke->callNative(&PAWN::GetPVarString, playerid, varname, string_return, len);
}
void _samp_SetPVarFloat(int playerid, char* varname, float float_value) {
void SetPVarFloat(int playerid, char* varname, float float_value) {
g_Invoke->callNative(&PAWN::SetPVarFloat, playerid, varname, float_value);
}
float _samp_GetPVarFloat(int playerid, char* varname) {
float GetPVarFloat(int playerid, char* varname) {
return (float)g_Invoke->callNative(&PAWN::GetPVarFloat, playerid, varname);
}
void _samp_DeletePVar(int playerid, char* varname) {
void DeletePVar(int playerid, char* varname) {
g_Invoke->callNative(&PAWN::DeletePVar, playerid, varname);
}
int _samp_GetPVarsUpperIndex(int playerid) {
int GetPVarsUpperIndex(int playerid) {
return g_Invoke->callNative(&PAWN::GetPVarsUpperIndex, playerid);
}
void _samp_GetPVarNameAtIndex(int playerid, int index, char* ret_varname, int ret_len) {
void GetPVarNameAtIndex(int playerid, int index, char* ret_varname, int ret_len) {
g_Invoke->callNative(&PAWN::GetPVarNameAtIndex, playerid, index, ret_varname, ret_len);
}
int _samp_GetPVarType(int playerid, char* varname) {
int GetPVarType(int playerid, char* varname) {
return g_Invoke->callNative(&PAWN::GetPVarType, playerid, varname);
}
void _samp_SetPlayerChatBubble(int playerid, char* text, unsigned int color, float drawdistance, int expiretime) {
void SetPlayerChatBubble(int playerid, char* text, unsigned int color, float drawdistance, int expiretime) {
g_Invoke->callNative(&PAWN::SetPlayerChatBubble, playerid, text, color, drawdistance, expiretime);
}
void _samp_PutPlayerInVehicle(int playerid, int vehicleid, int seatid) {
void PutPlayerInVehicle(int playerid, int vehicleid, int seatid) {
g_Invoke->callNative(&PAWN::PutPlayerInVehicle, playerid, vehicleid, seatid);
}
int _samp_GetPlayerVehicleID(int playerid) {
int GetPlayerVehicleID(int playerid) {
return g_Invoke->callNative(&PAWN::GetPlayerVehicleID, playerid);
}
int _samp_GetPlayerVehicleSeat(int playerid) {
int GetPlayerVehicleSeat(int playerid) {
return g_Invoke->callNative(&PAWN::GetPlayerVehicleSeat, playerid);
}
void _samp_RemovePlayerFromVehicle(int playerid) {
void RemovePlayerFromVehicle(int playerid) {
g_Invoke->callNative(&PAWN::RemovePlayerFromVehicle, playerid);
}
void _samp_TogglePlayerControllable(int playerid, int toggle) {
void TogglePlayerControllable(int playerid, int toggle) {
g_Invoke->callNative(&PAWN::TogglePlayerControllable, playerid, toggle);
}
void _samp_PlayerPlaySound(int playerid, int soundid, float x, float y, float z) {
void PlayerPlaySound(int playerid, int soundid, float x, float y, float z) {
g_Invoke->callNative(&PAWN::PlayerPlaySound, playerid, soundid, x, y, z);
}
void _samp_ApplyAnimation(int playerid, char* animlib, char* animname, float fdelta, int loop, int lockx, int locky, int freeze, int time, int forcesync ) {
void ApplyAnimation(int playerid, char* animlib, char* animname, float fdelta, int loop, int lockx, int locky, int freeze, int time, int forcesync ) {
g_Invoke->callNative(&PAWN::ApplyAnimation, playerid, animlib, animname, fdelta, loop, lockx, locky, freeze, time, forcesync = 0);
}
void _samp_ClearAnimations(int playerid, int forcesync ) {
void ClearAnimations(int playerid, int forcesync ) {
g_Invoke->callNative(&PAWN::ClearAnimations, playerid, forcesync = 0);
}
int _samp_GetPlayerAnimationIndex(int playerid) {
int GetPlayerAnimationIndex(int playerid) {
return g_Invoke->callNative(&PAWN::GetPlayerAnimationIndex, playerid);
}
void _samp_GetAnimationName(int index, char* animlib, int len1, char* animname, int len2) {
void GetAnimationName(int index, char* animlib, int len1, char* animname, int len2) {
g_Invoke->callNative(&PAWN::GetAnimationName, index, animlib, len1, animname, len2);
}
int _samp_GetPlayerSpecialAction(int playerid) {
int GetPlayerSpecialAction(int playerid) {
return g_Invoke->callNative(&PAWN::GetPlayerSpecialAction, playerid);
}
void _samp_SetPlayerSpecialAction(int playerid, int actionid) {
void SetPlayerSpecialAction(int playerid, int actionid) {
g_Invoke->callNative(&PAWN::SetPlayerSpecialAction, playerid, actionid);
}
void _samp_SetPlayerCheckpoint(int playerid, float x, float y, float z, float size) {
void SetPlayerCheckpoint(int playerid, float x, float y, float z, float size) {
g_Invoke->callNative(&PAWN::SetPlayerCheckpoint, playerid, x, y, z, size);
}
void _samp_DisablePlayerCheckpoint(int playerid) {
void DisablePlayerCheckpoint(int playerid) {
g_Invoke->callNative(&PAWN::DisablePlayerCheckpoint, playerid);
}
void _samp_SetPlayerRaceCheckpoint(int playerid, int type, float x, float y, float z, float nextx, float nexty, float nextz, float size) {
void SetPlayerRaceCheckpoint(int playerid, int type, float x, float y, float z, float nextx, float nexty, float nextz, float size) {
g_Invoke->callNative(&PAWN::SetPlayerRaceCheckpoint, playerid, type, x, y, z, nextx, nexty, nextz, size);
}
void _samp_DisablePlayerRaceCheckpoint(int playerid) {
void DisablePlayerRaceCheckpoint(int playerid) {
g_Invoke->callNative(&PAWN::DisablePlayerRaceCheckpoint, playerid);
}
void _samp_SetPlayerWorldBounds(int playerid, float x_max, float x_min, float y_max, float y_min) {
void SetPlayerWorldBounds(int playerid, float x_max, float x_min, float y_max, float y_min) {
g_Invoke->callNative(&PAWN::SetPlayerWorldBounds, playerid, x_max, x_min, y_max, y_min);
}
void _samp_SetPlayerMarkerForPlayer(int playerid, int showplayerid, unsigned int color) {
void SetPlayerMarkerForPlayer(int playerid, int showplayerid, unsigned int color) {
g_Invoke->callNative(&PAWN::SetPlayerMarkerForPlayer, playerid, showplayerid, color);
}
void _samp_ShowPlayerNameTagForPlayer(int playerid, int showplayerid, int show) {
void ShowPlayerNameTagForPlayer(int playerid, int showplayerid, int show) {
g_Invoke->callNative(&PAWN::ShowPlayerNameTagForPlayer, playerid, showplayerid, show);
}
void _samp_SetPlayerMapIcon(int playerid, int iconid, float x, float y, float z, int markertype, unsigned int color, int style) {
void SetPlayerMapIcon(int playerid, int iconid, float x, float y, float z, int markertype, unsigned int color, int style) {
g_Invoke->callNative(&PAWN::SetPlayerMapIcon, playerid, iconid, x, y, z, markertype, color, style);
}
void _samp_RemovePlayerMapIcon(int playerid, int iconid) {
void RemovePlayerMapIcon(int playerid, int iconid) {
g_Invoke->callNative(&PAWN::RemovePlayerMapIcon, playerid, iconid);
}
void _samp_AllowPlayerTeleport(int playerid, int allow) {
void AllowPlayerTeleport(int playerid, int allow) {
g_Invoke->callNative(&PAWN::AllowPlayerTeleport, playerid, allow);
}
void _samp_SetPlayerCameraPos(int playerid, float x, float y, float z) {
void SetPlayerCameraPos(int playerid, float x, float y, float z) {
g_Invoke->callNative(&PAWN::SetPlayerCameraPos, playerid, x, y, z);
}
void _samp_SetPlayerCameraLookAt(int playerid, float x, float y, float z, int cut) {
void SetPlayerCameraLookAt(int playerid, float x, float y, float z, int cut) {
g_Invoke->callNative(&PAWN::SetPlayerCameraLookAt, playerid, x, y, z, cut);
}
void _samp_SetCameraBehindPlayer(int playerid) {
void SetCameraBehindPlayer(int playerid) {
g_Invoke->callNative(&PAWN::SetCameraBehindPlayer, playerid);
}
void _samp_GetPlayerCameraPos(int playerid, float& x, float& y, float& z) {
float _x = 0.0;
float _y = 0.0;
float _z = 0.0;
void GetPlayerCameraPos(int playerid, float& x, float& y, float& z) {
float _x = NULL;
float _y = NULL;
float _z = NULL;
g_Invoke->callNative(&PAWN::GetPlayerCameraPos, playerid, &_x, &_y, &_z);
x = _x;
y = _y;
z = _z;
}
void _samp_GetPlayerCameraFrontVector(int playerid, float& x, float& y, float& z) {
float _x = 0.0;
float _y = 0.0;
float _z = 0.0;
void GetPlayerCameraFrontVector(int playerid, float& x, float& y, float& z) {
float _x = NULL;
float _y = NULL;
float _z = NULL;
g_Invoke->callNative(&PAWN::GetPlayerCameraFrontVector, playerid, &_x, &_y, &_z);
x = _x;
y = _y;
z = _z;
}
int _samp_GetPlayerCameraMode(int playerid) {
int GetPlayerCameraMode(int playerid) {
return g_Invoke->callNative(&PAWN::GetPlayerCameraMode, playerid);
}
void _samp_AttachCameraToObject(int playerid, int objectid) {
void AttachCameraToObject(int playerid, int objectid) {
g_Invoke->callNative(&PAWN::AttachCameraToObject, playerid, objectid);
}
void _samp_AttachCameraToPlayerObject(int playerid, int playerobjectid) {
void AttachCameraToPlayerObject(int playerid, int playerobjectid) {
g_Invoke->callNative(&PAWN::AttachCameraToPlayerObject, playerid, playerobjectid);
}
void _samp_InterpolateCameraPos(int playerid, float fromx, float fromy, float fromz, float tox, float toy, float toz, int time, int cut) {
void InterpolateCameraPos(int playerid, float fromx, float fromy, float fromz, float tox, float toy, float toz, int time, int cut) {
g_Invoke->callNative(&PAWN::InterpolateCameraPos, playerid, fromx, fromy, fromz, tox, toy, toz, time, cut);
}
void _samp_InterpolateCameraLookAt(int playerid, float fromx, float fromy, float fromz, float tox, float toy, float toz, int time, int cut) {
void InterpolateCameraLookAt(int playerid, float fromx, float fromy, float fromz, float tox, float toy, float toz, int time, int cut) {
g_Invoke->callNative(&PAWN::InterpolateCameraLookAt, playerid, fromx, fromy, fromz, tox, toy, toz, time, cut);
}
int _samp_IsPlayerConnected(int playerid) {
int IsPlayerConnected(int playerid) {
return g_Invoke->callNative(&PAWN::IsPlayerConnected, playerid);
}
int _samp_IsPlayerInVehicle(int playerid, int vehicleid) {
int IsPlayerInVehicle(int playerid, int vehicleid) {
return g_Invoke->callNative(&PAWN::IsPlayerInVehicle, playerid, vehicleid);
}
int _samp_IsPlayerInAnyVehicle(int playerid) {
int IsPlayerInAnyVehicle(int playerid) {
return g_Invoke->callNative(&PAWN::IsPlayerInAnyVehicle, playerid);
}
int _samp_IsPlayerInCheckpoint(int playerid) {
int IsPlayerInCheckpoint(int playerid) {
return g_Invoke->callNative(&PAWN::IsPlayerInCheckpoint, playerid);
}
int _samp_IsPlayerInRaceCheckpoint(int playerid) {
int IsPlayerInRaceCheckpoint(int playerid) {
return g_Invoke->callNative(&PAWN::IsPlayerInRaceCheckpoint, playerid);
}
void _samp_SetPlayerVirtualWorld(int playerid, int worldid) {
void SetPlayerVirtualWorld(int playerid, int worldid) {
g_Invoke->callNative(&PAWN::SetPlayerVirtualWorld, playerid, worldid);
}
int _samp_GetPlayerVirtualWorld(int playerid) {
int GetPlayerVirtualWorld(int playerid) {
return g_Invoke->callNative(&PAWN::GetPlayerVirtualWorld, playerid);
}
void _samp_EnableStuntBonusForPlayer(int playerid, int enable) {
void EnableStuntBonusForPlayer(int playerid, int enable) {
g_Invoke->callNative(&PAWN::EnableStuntBonusForPlayer, playerid, enable);
}
void _samp_EnableStuntBonusForAll(int enable) {
void EnableStuntBonusForAll(int enable) {
g_Invoke->callNative(&PAWN::EnableStuntBonusForAll, enable);
}
void _samp_TogglePlayerSpectating(int playerid, int toggle) {
void TogglePlayerSpectating(int playerid, int toggle) {
g_Invoke->callNative(&PAWN::TogglePlayerSpectating, playerid, toggle);
}
void _samp_PlayerSpectatePlayer(int playerid, int targetplayerid, int mode) {
void PlayerSpectatePlayer(int playerid, int targetplayerid, int mode) {
g_Invoke->callNative(&PAWN::PlayerSpectatePlayer, playerid, targetplayerid, mode);
}
void _samp_PlayerSpectateVehicle(int playerid, int targetvehicleid, int mode) {
void PlayerSpectateVehicle(int playerid, int targetvehicleid, int mode) {
g_Invoke->callNative(&PAWN::PlayerSpectateVehicle, playerid, targetvehicleid, mode);
}
void _samp_StartRecordingPlayerData(int playerid, int recordtype, char* recordname) {
void StartRecordingPlayerData(int playerid, int recordtype, char* recordname) {
g_Invoke->callNative(&PAWN::StartRecordingPlayerData, playerid, recordtype, recordname);
}
void _samp_StopRecordingPlayerData(int playerid) {
void StopRecordingPlayerData(int playerid) {
g_Invoke->callNative(&PAWN::StopRecordingPlayerData, playerid);
}
void _samp_SelectTextDraw(int playerid, int hovercolor) {
void SelectTextDraw(int playerid, int hovercolor) {
g_Invoke->callNative(&PAWN::SelectTextDraw, playerid, hovercolor);
}
void _samp_CancelSelectTextDraw(int playerid) {
void CancelSelectTextDraw(int playerid) {
g_Invoke->callNative(&PAWN::CancelSelectTextDraw, playerid);
}

148
sampdotnethook/a_players.h Normal file
View File

@ -0,0 +1,148 @@
#ifndef A_PLAYERS_H
#define A_PLAYERS_H
void SetSpawnInfo(int playerid, int team, int skin, float x, float y, float z, float rotation, int weapon1, int weapon1_ammo, int weapon2, int weapon2_ammo, int weapon3, int weapon3_ammo);
void SpawnPlayer(int playerid);
void SetPlayerPos(int playerid, float x, float y, float z);
void SetPlayerPosFindZ(int playerid, float x, float y, float z);
void GetPlayerPos(int playerid, float& x, float& y, float& z);
void SetPlayerFacingAngle(int playerid, float ang);
void GetPlayerFacingAngle(int playerid, float& ang);
//void IsPlayerInRangeOfPoint(int playerid, float range, float x, float y, float z);
//float GetPlayerDistanceFromPoint(int playerid, float x, float y, float z);
int IsPlayerStreamedIn(int playerid, int forplayerid);
void SetPlayerInterior(int playerid, int interiorid);
int GetPlayerInterior(int playerid);
void SetPlayerHealth(int playerid, float health);
void GetPlayerHealth(int playerid, float& health);
void SetPlayerArmour(int playerid, float armour);
void GetPlayerArmour(int playerid, float& armour);
void SetPlayerAmmo(int playerid, int weaponslot, int ammo);
int GetPlayerAmmo(int playerid);
int GetPlayerWeaponState(int playerid);
int GetPlayerTargetPlayer(int playerid);
void SetPlayerTeam(int playerid, int teamid);
int GetPlayerTeam(int playerid);
void SetPlayerScore(int playerid, int score);
int GetPlayerScore(int playerid);
int GetPlayerDrunkLevel(int playerid);
void SetPlayerDrunkLevel(int playerid, int level);
void SetPlayerColor(int playerid, int color);
int GetPlayerColor(int playerid);
void SetPlayerSkin(int playerid, int skinid);
int GetPlayerSkin(int playerid);
void GivePlayerWeapon(int playerid, int weaponid, int ammo);
void ResetPlayerWeapons(int playerid);
void SetPlayerArmedWeapon(int playerid, int weaponid);
void GetPlayerWeaponData(int playerid, int slot, int& weapons, int& ammo);
void GivePlayerMoney(int playerid, int money);
void ResetPlayerMoney(int playerid);
void SetPlayerName(int playerid, char* name);
int GetPlayerMoney(int playerid);
int GetPlayerState(int playerid);
void GetPlayerIp(int playerid, char* name, int len);
int GetPlayerPing(int playerid);
int GetPlayerWeapon(int playerid);
void GetPlayerKeys(int playerid, int& keys, int& updown, int& leftright);
void GetPlayerName(int playerid, char* name, int len);
void SetPlayerTime(int playerid, int hour, int minute);
void GetPlayerTime(int playerid, int& hour, int& minute);
void TogglePlayerClock(int playerid, int toggle);
void SetPlayerWeather(int playerid, int weather);
void ForceClassSelection(int playerid);
void SetPlayerWantedLevel(int playerid, int level);
int GetPlayerWantedLevel(int playerid);
void SetPlayerFightingStyle(int playerid, int style);
int GetPlayerFightingStyle(int playerid);
void SetPlayerVelocity(int playerid, float x, float y, float z);
void GetPlayerVelocity(int playerid, float& x, float& y, float& z);
void PlayCrimeReportForPlayer(int playerid, int suspectid, int crime);
void PlayAudioStreamForPlayer(int playerid, char* url, float posx=0.0, float posy=0.0, float posz=0.0, float distance=50.0, int usepos=0);
void StopAudioStreamForPlayer(int playerid);
void SetPlayerShopName(int playerid, char* shopname);
void SetPlayerSkillLevel(int playerid, int skill, int level);
int GetPlayerSurfingVehicleID(int playerid);
int GetPlayerSurfingObjectID(int playerid);
void RemoveBuildingForPlayer(int playerid, int modelid, float fx, float fy, float fz, float fradius);
void SetPlayerAttachedObject(int playerid, int index, int modelid, int bone, float foffsetx=0.0, float foffsety=0.0, float foffsetz=0.0, float frotx=0.0, float froty=0.0, float frotz=0.0, float fscalex=1.0, float fscaley=1.0, float fscalez=1.0, int materialcolor1=0, int materialcolor2=0);
void RemovePlayerAttachedObject(int playerid, int index);
void IsPlayerAttachedObjectSlotUsed(int playerid, int index);
void EditAttachedObject(int playerid, int index);
int CreatePlayerTextDraw(int playerid, float x, float y, char* text);
void PlayerTextDrawDestroy(int playerid, int text);
void PlayerTextDrawLetterSize(int playerid, int text, float x, float y);
void PlayerTextDrawTextSize(int playerid, int text, float x, float y);
void PlayerTextDrawAlignment(int playerid, int text, int alignment);
void PlayerTextDrawColor(int playerid, int text, int color);
void PlayerTextDrawUseBox(int playerid, int text, int use);
void PlayerTextDrawBoxColor(int playerid, int text, int color);
void PlayerTextDrawSetShadow(int playerid, int text, int size);
void PlayerTextDrawSetOutline(int playerid, int text, int size);
void PlayerTextDrawBackgroundColor(int playerid, int text, int color);
void PlayerTextDrawFont(int playerid, int text, int font);
void PlayerTextDrawSetProportional(int playerid, int text, int set);
void PlayerTextDrawSetSelectable(int playerid, int text, int set);
void PlayerTextDrawShow(int playerid, int text);
void PlayerTextDrawHide(int playerid, int text);
void PlayerTextDrawSetString(int playerid, int text, char* string);
void SetPVarInt(int playerid, char* varname, int int_value);
void GetPVarInt(int playerid, char* varname);
void SetPVarString(int playerid, char* varname, char* string_value);
void GetPVarString(int playerid, char* varname, char* string_return, int len);
void SetPVarFloat(int playerid, char* varname, float float_value);
float GetPVarFloat(int playerid, char* varname);
void DeletePVar(int playerid, char* varname);
int GetPVarsUpperIndex(int playerid);
void GetPVarNameAtIndex(int playerid, int index, char* ret_varname, int ret_len);
int GetPVarType(int playerid, char* varname);
void SetPlayerChatBubble(int playerid, char* text, int color, float drawdistance, int expiretime);
void PutPlayerInVehicle(int playerid, int vehicleid, int seatid);
int GetPlayerVehicleID(int playerid);
int GetPlayerVehicleSeat(int playerid);
void RemovePlayerFromVehicle(int playerid);
void TogglePlayerControllable(int playerid, int toggle);
void PlayerPlaySound(int playerid, int soundid, float x, float y, float z);
void ApplyAnimation(int playerid, char* animlib, char* animname, float fdelta, int loop, int lockx, int locky, int freeze, int time, int forcesync=0);
void ClearAnimations(int playerid, int forcesync=0);
int GetPlayerAnimationIndex(int playerid);
void GetAnimationName(int index, char* animlib, int len1, char* animname, int len2);
int GetPlayerSpecialAction(int playerid);
void SetPlayerSpecialAction(int playerid, int actionid);
void SetPlayerCheckpoint(int playerid, float x, float y, float z, float size);
void DisablePlayerCheckpoint(int playerid);
void SetPlayerRaceCheckpoint(int playerid, int type, float x, float y, float z, float nextx, float nexty, float nextz, float size);
void DisablePlayerRaceCheckpoint(int playerid);
void SetPlayerWorldBounds(int playerid, float x_max, float x_min, float y_max, float y_min);
void SetPlayerMarkerForPlayer(int playerid, int showplayerid, int color);
void ShowPlayerNameTagForPlayer(int playerid, int showplayerid, int show);
void SetPlayerMapIcon(int playerid, int iconid, float x, float y, float z, int markertype, int color, int style=0);
void RemovePlayerMapIcon(int playerid, int iconid);
void AllowPlayerTeleport(int playerid, int allow);
void SetPlayerCameraPos(int playerid, float x, float y, float z);
void SetPlayerCameraLookAt(int playerid, float x, float y, float z, int cut=2);
void SetCameraBehindPlayer(int playerid);
void GetPlayerCameraPos(int playerid, float& x, float& y, float& z);
void GetPlayerCameraFrontVector(int playerid, float& x, float& y, float& z);
int GetPlayerCameraMode(int playerid);
void AttachCameraToObject(int playerid, int objectid);
void AttachCameraToPlayerObject(int playerid, int playerobjectid);
void InterpolateCameraPos(int playerid, float fromx, float fromy, float fromz, float tox, float toy, float toz, int time, int cut=2);
void InterpolateCameraLookAt(int playerid, float fromx, float fromy, float fromz, float tox, float toy, float toz, int time, int cut=2);
int IsPlayerConnected(int playerid);
int IsPlayerInVehicle(int playerid, int vehicleid);
int IsPlayerInAnyVehicle(int playerid);
int IsPlayerInCheckpoint(int playerid);
int IsPlayerInRaceCheckpoint(int playerid);
void SetPlayerVirtualWorld(int playerid, int worldid);
int GetPlayerVirtualWorld(int playerid);
void EnableStuntBonusForPlayer(int playerid, int enable);
void EnableStuntBonusForAll(int enable);
void TogglePlayerSpectating(int playerid, int toggle);
void PlayerSpectatePlayer(int playerid, int targetplayerid, int mode=1);
void PlayerSpectateVehicle(int playerid, int targetvehicleid, int mode=1);
void StartRecordingPlayerData(int playerid, int recordtype, char* recordname);
void StopRecordingPlayerData(int playerid);
void SelectTextDraw(int playerid, int hovercolor);
void CancelSelectTextDraw(int playerid);
#endif // A_PLAYERS_H

View File

@ -1,406 +1,403 @@
#include "a_samp.h"
void _samp_SendClientMessage(int playerid, unsigned int color, char* message) {
void SendClientMessage(int playerid, unsigned int color, char* message) {
g_Invoke->callNative(&PAWN::SendClientMessage, playerid, color, message);
}
void _samp_SendClientMessageToAll(unsigned int color, char* message) {
void SendClientMessageToAll(unsigned int color, char* message) {
g_Invoke->callNative(&PAWN::SendClientMessageToAll, color, message);
}
void _samp_SendPlayerMessageToPlayer(int playerid, int senderid, char* message) {
void SendPlayerMessageToPlayer(int playerid, int senderid, char* message) {
g_Invoke->callNative(&PAWN::SendPlayerMessageToPlayer, playerid, senderid, message);
}
void _samp_SendPlayerMessageToAll(int senderid, char* message) {
void SendPlayerMessageToAll(int senderid, char* message) {
g_Invoke->callNative(&PAWN::SendPlayerMessageToAll, senderid, message);
}
void _samp_SendDeathMessage(int killer, int killee, int weapon) {
void SendDeathMessage(int killer, int killee, int weapon) {
g_Invoke->callNative(&PAWN::SendDeathMessage, killer, killee, weapon);
}
void _samp_GameTextForAll(char* string, int time, int style) {
void GameTextForAll(char* string, int time, int style) {
g_Invoke->callNative(&PAWN::GameTextForAll, string, time, style);
}
void _samp_GameTextForPlayer(int playerid, char* string, int time, int style) {
void GameTextForPlayer(int playerid, char* string, int time, int style) {
g_Invoke->callNative(&PAWN::GameTextForPlayer, playerid, string, time, style);
}
int _samp_GetTickCount() {
int _GetTickCount() {
return g_Invoke->callNative(&PAWN::GetTickCount);
}
int _samp_GetMaxPlayers() {
int GetMaxPlayers() {
return g_Invoke->callNative(&PAWN::GetMaxPlayers);
}
void _samp_SetGameModeText(char* string) {
void SetGameModeText(char* string) {
g_Invoke->callNative(&PAWN::SetGameModeText, string);
}
void _samp_SetTeamCount(int count) { // No effect
void SetTeamCount(int count) { // No effect
g_Invoke->callNative(&PAWN::SetTeamCount, count);
}
int _samp_AddPlayerClass(int modelid, float spawn_x, float spawn_y, float spawn_z, float z_angle, int weapon1, int weapon1_ammo, int weapon2, int weapon2_ammo, int weapon3, int weapon3_ammo) {
int AddPlayerClass(int modelid, float spawn_x, float spawn_y, float spawn_z, float z_angle, int weapon1, int weapon1_ammo, int weapon2, int weapon2_ammo, int weapon3, int weapon3_ammo) {
return g_Invoke->callNative(&PAWN::AddPlayerClass, modelid, spawn_x, spawn_y, spawn_z, z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
}
int _samp_AddPlayerClassEx(int teamid, int modelid, float spawn_x, float spawn_y, float spawn_z, float z_angle, int weapon1, int weapon1_ammo, int weapon2, int weapon2_ammo, int weapon3, int weapon3_ammo) {
int AddPlayerClassEx(int teamid, int modelid, float spawn_x, float spawn_y, float spawn_z, float z_angle, int weapon1, int weapon1_ammo, int weapon2, int weapon2_ammo, int weapon3, int weapon3_ammo) {
return g_Invoke->callNative(&PAWN::AddPlayerClassEx, teamid, modelid, spawn_x, spawn_y, spawn_z, z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
}
int _samp_AddStaticVehicle(int modelid, float spawn_x, float spawn_y, float spawn_z, float z_angle, int color1, int color2) {
int AddStaticVehicle(int modelid, float spawn_x, float spawn_y, float spawn_z, float z_angle, int color1, int color2) {
return g_Invoke->callNative(&PAWN::AddStaticVehicle, modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2);
}
int _samp_AddStaticVehicleEx(int modelid, float spawn_x, float spawn_y, float spawn_z, float z_angle, int color1, int color2, int respawn_delay) {
int AddStaticVehicleEx(int modelid, float spawn_x, float spawn_y, float spawn_z, float z_angle, int color1, int color2, int respawn_delay) {
return g_Invoke->callNative(&PAWN::AddStaticVehicleEx, modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2, respawn_delay);
}
int _samp_AddStaticPickup(int model, int type, float x, float y, float z, int virtualworld) {
int AddStaticPickup(int model, int type, float x, float y, float z, int virtualworld) {
return g_Invoke->callNative(&PAWN::AddStaticPickup, model, type, x, y, z, virtualworld);
}
int _samp_CreatePickup(int model, int type, float x, float y, float z, int virtualworld) {
int CreatePickup(int model, int type, float x, float y, float z, int virtualworld) {
return g_Invoke->callNative(&PAWN::CreatePickup, model, type, x, y, z, virtualworld);
}
void _samp_DestroyPickup(int pickup) {
void DestroyPickup(int pickup) {
g_Invoke->callNative(&PAWN::DestroyPickup, pickup);
}
void _samp_ShowNameTags(int show) {
void ShowNameTags(int show) {
g_Invoke->callNative(&PAWN::ShowNameTags, show);
}
void _samp_ShowPlayerMarkers(int mode) {
void ShowPlayerMarkers(int mode) {
g_Invoke->callNative(&PAWN::ShowPlayerMarkers, mode);
}
void _samp_GameModeExit() {
void GameModeExit() {
g_Invoke->callNative(&PAWN::GameModeExit);
}
void _samp_SetWorldTime(int hour) {
void SetWorldTime(int hour) {
g_Invoke->callNative(&PAWN::SetWorldTime, hour);
}
void _samp_GetWeaponName(int weaponid, char* weapon, int len) {
void GetWeaponName(int weaponid, char* weapon, int len) {
char _weapon[50];
g_Invoke->callNative(&PAWN::GetWeaponName, weaponid, _weapon, len);
strncpy(_weapon, weapon, len);
strncpy_s(weapon, len, _weapon, _TRUNCATE);
}
void _samp_EnableTirePopping(int enable) { // Deprecated
void EnableTirePopping(int enable) { // Deprecated
g_Invoke->callNative(&PAWN::EnableTirePopping, enable);
}
void _samp_AllowInteriorWeapons(int allow) {
void AllowInteriorWeapons(int allow) {
g_Invoke->callNative(&PAWN::AllowInteriorWeapons, allow);
}
void _samp_SetWeather(int weatherid) {
void SetWeather(int weatherid) {
g_Invoke->callNative(&PAWN::SetWeather, weatherid);
}
void _samp_SetGravity(float gravity) {
void SetGravity(float gravity) {
g_Invoke->callNative(&PAWN::SetGravity, gravity);
}
void _samp_AllowAdminTeleport(int allow) { // Deprecated
void AllowAdminTeleport(int allow) { // Deprecated
g_Invoke->callNative(&PAWN::AllowAdminTeleport, allow);
}
void _samp_SetDeathDropAmount(int amount) { // Deprecated
void SetDeathDropAmount(int amount) { // Deprecated
g_Invoke->callNative(&PAWN::SetDeathDropAmount, amount);
}
void _samp_CreateExplosion(float x, float y, float z, int type, float radius) {
void CreateExplosion(float x, float y, float z, int type, float radius) {
g_Invoke->callNative(&PAWN::CreateExplosion, x, y, z, type, radius);
}
void _samp_EnableZoneNames(int enable) {
void EnableZoneNames(int enable) {
g_Invoke->callNative(&PAWN::EnableZoneNames, enable);
}
void _samp_UsePlayerPedAnims() {
void UsePlayerPedAnims() {
g_Invoke->callNative(&PAWN::UsePlayerPedAnims);
}
void _samp_DisableInteriorEnterExits() {
void DisableInteriorEnterExits() {
g_Invoke->callNative(&PAWN::DisableInteriorEnterExits);
}
void _samp_SetNameTagDrawDistance(float distance) {
void SetNameTagDrawDistance(float distance) {
g_Invoke->callNative(&PAWN::SetNameTagDrawDistance, distance);
}
void _samp_DisableNameTagLOS() {
void DisableNameTagLOS() {
g_Invoke->callNative(&PAWN::DisableNameTagLOS);
}
void _samp_LimitGlobalChatRadius(float chat_radius) {
void LimitGlobalChatRadius(float chat_radius) {
g_Invoke->callNative(&PAWN::LimitGlobalChatRadius, chat_radius);
}
void _samp_LimitPlayerMarkerRadius(float marker_radius) {
void LimitPlayerMarkerRadius(float marker_radius) {
g_Invoke->callNative(&PAWN::LimitPlayerMarkerRadius, marker_radius);
}
void _samp_ConnectNPC(char* name, char* script) {
void ConnectNPC(char* name, char* script) {
g_Invoke->callNative(&PAWN::ConnectNPC, name, script);
}
int _samp_IsPlayerNPC(int playerid) {
int IsPlayerNPC(int playerid) {
return g_Invoke->callNative(&PAWN::IsPlayerNPC, playerid);
}
int _samp_IsPlayerAdmin(int playerid) {
int IsPlayerAdmin(int playerid) {
return g_Invoke->callNative(&PAWN::IsPlayerAdmin, playerid);
}
void _samp_Kick(int playerid) {
void Kick(int playerid) {
g_Invoke->callNative(&PAWN::Kick, playerid);
}
void _samp_Ban(int playerid) {
void Ban(int playerid) {
g_Invoke->callNative(&PAWN::Ban, playerid);
}
void _samp_BanEx(int playerid, char* reason) {
void BanEx(int playerid, char* reason) {
g_Invoke->callNative(&PAWN::BanEx, playerid, reason);
}
void _samp_SendRconCommand(char* command) {
void SendRconCommand(char* command) {
g_Invoke->callNative(&PAWN::SendRconCommand, command);
}
void _samp_GetServerVarAsString(char* varname, char* buffer, int len) {
void GetServerVarAsString(char* varname, char* buffer, int len) {
char _buffer[1024];
g_Invoke->callNative(&PAWN::GetServerVarAsString, varname, _buffer, len);
strncpy(_buffer, buffer, len);
strncpy_s(buffer, len, _buffer, _TRUNCATE);
}
int _samp_GetServerVarAsInt(char* varname) {
int GetServerVarAsInt(char* varname) {
return g_Invoke->callNative(&PAWN::GetServerVarAsInt, varname);
}
int _samp_GetServerVarAsBool(char* varname) {
int GetServerVarAsBool(char* varname) {
return g_Invoke->callNative(&PAWN::GetServerVarAsBool, varname);
}
void _samp_GetPlayerNetworkStats(int playerid, char* retstr, int retstr_size) {
void GetPlayerNetworkStats(int playerid, char* retstr, int retstr_size) {
char _retstr[1024];
g_Invoke->callNative(&PAWN::GetPlayerNetworkStats, playerid, _retstr, retstr_size);
strncpy(_retstr, retstr, retstr_size);
strncpy_s(retstr, retstr_size, _retstr, _TRUNCATE);
}
void _samp_GetNetworkStats(char* retstr, int retstr_size) {
void GetNetworkStats(char* retstr, int retstr_size) {
char _retstr[1024];
g_Invoke->callNative(&PAWN::GetNetworkStats, _retstr, retstr_size);
strncpy(_retstr, retstr, retstr_size);
strncpy_s(retstr, retstr_size, _retstr, _TRUNCATE);
}
int _samp_GetPlayerVersion(int playerid, char* version, int len) {
void GetPlayerVersion(int playerid, char* version, int len) {
char _version[10];
int iRet = g_Invoke->callNative(&PAWN::GetPlayerVersion, playerid, _version, len);
strncpy(_version, version, len);
return iRet;
g_Invoke->callNative(&PAWN::GetPlayerVersion, playerid, _version, len);
strncpy_s(version, len, _version, _TRUNCATE);
}
int _samp_CreateMenu(char* title, int columns, float x, float y, float col1width, float col2width ) {
int CreateMenu(char* title, int columns, float x, float y, float col1width, float col2width ) {
return g_Invoke->callNative(&PAWN::CreateMenu, title, columns, x, y, col1width, col2width);
}
int _samp_DestroyMenu(int menuid) {
int DestroyMenu(int menuid) {
return g_Invoke->callNative(&PAWN::DestroyMenu, menuid);
}
void _samp_AddMenuItem(int menuid, int column, char* menutext) {
void AddMenuItem(int menuid, int column, char* menutext) {
g_Invoke->callNative(&PAWN::AddMenuItem, menuid, column, menutext);
}
void _samp_SetMenuColumnHeader(int menuid, int column, char* columnheader) {
void SetMenuColumnHeader(int menuid, int column, char* columnheader) {
g_Invoke->callNative(&PAWN::SetMenuColumnHeader, menuid, column, columnheader);
}
void _samp_ShowMenuForPlayer(int menuid, int playerid) {
void ShowMenuForPlayer(int menuid, int playerid) {
g_Invoke->callNative(&PAWN::ShowMenuForPlayer, menuid, playerid);
}
void _samp_HideMenuForPlayer(int menuid, int playerid) {
void HideMenuForPlayer(int menuid, int playerid) {
g_Invoke->callNative(&PAWN::HideMenuForPlayer, menuid, playerid);
}
int _samp_IsValidMenu(int menuid) {
int IsValidMenu(int menuid) {
return g_Invoke->callNative(&PAWN::IsValidMenu, menuid);
}
void _samp_DisableMenu(int menuid) {
void DisableMenu(int menuid) {
g_Invoke->callNative(&PAWN::DisableMenu, menuid);
}
void _samp_DisableMenuRow(int menuid, int row) {
void DisableMenuRow(int menuid, int row) {
g_Invoke->callNative(&PAWN::DisableMenuRow, menuid, row);
}
int _samp_GetPlayerMenu(int playerid) {
int GetPlayerMenu(int playerid) {
return g_Invoke->callNative(&PAWN::GetPlayerMenu, playerid);
}
int _samp_TextDrawCreate(float x, float y, char* text) {
int TextDrawCreate(float x, float y, char* text) {
return g_Invoke->callNative(&PAWN::TextDrawCreate, x, y, text);
}
void _samp_TextDrawDestroy(int text) {
void TextDrawDestroy(int text) {
g_Invoke->callNative(&PAWN::TextDrawDestroy, text);
}
void _samp_TextDrawLetterSize(int text, float x, float y) {
void TextDrawLetterSize(int text, float x, float y) {
g_Invoke->callNative(&PAWN::TextDrawLetterSize, text, x, y);
}
void _samp_TextDrawTextSize(int text, float x, float y) {
void TextDrawTextSize(int text, float x, float y) {
g_Invoke->callNative(&PAWN::TextDrawTextSize, text, x, y);
}
void _samp_TextDrawAlignment(int text, int alignment) {
void TextDrawAlignment(int text, int alignment) {
g_Invoke->callNative(&PAWN::TextDrawAlignment, text, alignment);
}
void _samp_TextDrawColor(int text, unsigned int color) {
void TextDrawColor(int text, unsigned int color) {
g_Invoke->callNative(&PAWN::TextDrawColor, text, color);
}
void _samp_TextDrawUseBox(int text, int use) {
void TextDrawUseBox(int text, int use) {
g_Invoke->callNative(&PAWN::TextDrawUseBox, text, use);
}
void _samp_TextDrawBoxColor(int text, unsigned int color) {
void TextDrawBoxColor(int text, unsigned int color) {
g_Invoke->callNative(&PAWN::TextDrawBoxColor, text, color);
}
void _samp_TextDrawSetShadow(int text, int size) {
void TextDrawSetShadow(int text, int size) {
g_Invoke->callNative(&PAWN::TextDrawSetShadow, text, size);
}
void _samp_TextDrawSetOutline(int text, int size) {
void TextDrawSetOutline(int text, int size) {
g_Invoke->callNative(&PAWN::TextDrawSetOutline, text, size);
}
void _samp_TextDrawBackgroundColor(int text, unsigned int color) {
void TextDrawBackgroundColor(int text, unsigned int color) {
g_Invoke->callNative(&PAWN::TextDrawBackgroundColor, text, color);
}
void _samp_TextDrawFont(int text, int font) {
void TextDrawFont(int text, int font) {
g_Invoke->callNative(&PAWN::TextDrawFont, text, font);
}
void _samp_TextDrawSetProportional(int text, int set) {
void TextDrawSetProportional(int text, int set) {
g_Invoke->callNative(&PAWN::TextDrawSetProportional, text, set);
}
void _samp_TextDrawSetSelectable(int text, int set) {
void TextDrawSetSelectable(int text, int set) {
g_Invoke->callNative(&PAWN::TextDrawSetSelectable, text, set);
}
void _samp_TextDrawShowForPlayer(int playerid, int text) {
void TextDrawShowForPlayer(int playerid, int text) {
g_Invoke->callNative(&PAWN::TextDrawShowForPlayer, playerid, text);
}
void _samp_TextDrawHideForPlayer(int playerid, int text) {
void TextDrawHideForPlayer(int playerid, int text) {
g_Invoke->callNative(&PAWN::TextDrawHideForPlayer, playerid, text);
}
void _samp_TextDrawShowForAll(int text) {
void TextDrawShowForAll(int text) {
g_Invoke->callNative(&PAWN::TextDrawShowForAll, text);
}
void _samp_TextDrawHideForAll(int text) {
void TextDrawHideForAll(int text) {
g_Invoke->callNative(&PAWN::TextDrawHideForAll, text);
}
void _samp_TextDrawSetString(int text, char* string) {
void TextDrawSetString(int text, char* string) {
g_Invoke->callNative(&PAWN::TextDrawSetString, text, string);
}
int _samp_GangZoneCreate(float minx, float miny, float maxx, float maxy) {
int GangZoneCreate(float minx, float miny, float maxx, float maxy) {
return g_Invoke->callNative(&PAWN::GangZoneCreate, minx, miny, maxx, maxy);
}
void _samp_GangZoneDestroy(int zone) {
void GangZoneDestroy(int zone) {
g_Invoke->callNative(&PAWN::GangZoneDestroy, zone);
}
void _samp_GangZoneShowForPlayer(int playerid, int zone, unsigned int color) {
void GangZoneShowForPlayer(int playerid, int zone, unsigned int color) {
g_Invoke->callNative(&PAWN::GangZoneShowForPlayer, playerid, zone, color);
}
int _samp_GangZoneShowForAll(int zone, unsigned int color) {
int GangZoneShowForAll(int zone, unsigned int color) {
return g_Invoke->callNative(&PAWN::GangZoneShowForAll, zone, color);
}
void _samp_GangZoneHideForPlayer(int playerid, int zone) {
void GangZoneHideForPlayer(int playerid, int zone) {
g_Invoke->callNative(&PAWN::GangZoneHideForPlayer, playerid, zone);
}
void _samp_GangZoneHideForAll(int zone) {
void GangZoneHideForAll(int zone) {
g_Invoke->callNative(&PAWN::GangZoneHideForAll, zone);
}
void _samp_GangZoneFlashForPlayer(int playerid, int zone, unsigned int flashcolor) {
void GangZoneFlashForPlayer(int playerid, int zone, unsigned int flashcolor) {
g_Invoke->callNative(&PAWN::GangZoneFlashForPlayer, playerid, zone, flashcolor);
}
void _samp_GangZoneFlashForAll(int zone, unsigned int flashcolor) {
void GangZoneFlashForAll(int zone, unsigned int flashcolor) {
g_Invoke->callNative(&PAWN::GangZoneFlashForAll, zone, flashcolor);
}
void _samp_GangZoneStopFlashForPlayer(int playerid, int zone) {
void GangZoneStopFlashForPlayer(int playerid, int zone) {
g_Invoke->callNative(&PAWN::GangZoneStopFlashForPlayer, playerid, zone);
}
void _samp_GangZoneStopFlashForAll(int zone) {
void GangZoneStopFlashForAll(int zone) {
g_Invoke->callNative(&PAWN::GangZoneStopFlashForAll, zone);
}
int _samp_Create3DTextLabel(char* text, unsigned int color, float x, float y, float z, float drawdistance, int virtualworld, int testLOS) {
int Create3DTextLabel(char* text, unsigned int color, float x, float y, float z, float drawdistance, int virtualworld, int testLOS) {
return g_Invoke->callNative(&PAWN::Create3DTextLabel, text, color, x, y, z, drawdistance, virtualworld, testLOS);
}
int _samp_Delete3DTextLabel(int id) {
int Delete3DTextLabel(int id) {
return g_Invoke->callNative(&PAWN::Delete3DTextLabel, id);
}
void _samp_Attach3DTextLabelToPlayer(int id, int playerid, float offsetx, float offsety, float offsetz) {
void Attach3DTextLabelToPlayer(int id, int playerid, float offsetx, float offsety, float offsetz) {
g_Invoke->callNative(&PAWN::Attach3DTextLabelToPlayer, id, playerid, offsetx, offsety, offsetz);
}
void _samp_Attach3DTextLabelToVehicle(int id, int vehicleid, float offsetx, float offsety, float offsetz) {
void Attach3DTextLabelToVehicle(int id, int vehicleid, float offsetx, float offsety, float offsetz) {
g_Invoke->callNative(&PAWN::Attach3DTextLabelToVehicle, id, vehicleid, offsetx, offsety, offsetz);
}
void _samp_Update3DTextLabelText(int id, unsigned int color, char* text) {
void Update3DTextLabelText(int id, unsigned int color, char* text) {
g_Invoke->callNative(&PAWN::Update3DTextLabelText, id, color, text);
}
int _samp_CreatePlayer3DTextLabel(int playerid, char* text, unsigned int color, float x, float y, float z, float drawdistance, int attachedplayer, int attachedvehicle, int testLOS) {
int CreatePlayer3DTextLabel(int playerid, char* text, unsigned int color, float x, float y, float z, float drawdistance, int attachedplayer, int attachedvehicle, int testLOS) {
return g_Invoke->callNative(&PAWN::CreatePlayer3DTextLabel, playerid, text, color, x, y, z, drawdistance, attachedplayer, attachedvehicle, testLOS);
}
void _samp_DeletePlayer3DTextLabel(int playerid, int id) {
void DeletePlayer3DTextLabel(int playerid, int id) {
g_Invoke->callNative(&PAWN::DeletePlayer3DTextLabel, playerid, id);
}
void _samp_UpdatePlayer3DTextLabelText(int playerid, int id, unsigned int color, char* text) {
void UpdatePlayer3DTextLabelText(int playerid, int id, unsigned int color, char* text) {
g_Invoke->callNative(&PAWN::UpdatePlayer3DTextLabelText, playerid, id, color, text);
}
void _samp_ShowPlayerDialog(int playerid, int dialogid, int style, char* caption, char* info, char* button1, char* button2) {
void ShowPlayerDialog(int playerid, int dialogid, int style, char* caption, char* info, char* button1, char* button2) {
g_Invoke->callNative(&PAWN::ShowPlayerDialog, playerid, dialogid, style, caption, info, button1, button2);
}

153
sampdotnethook/a_samp.h Normal file
View File

@ -0,0 +1,153 @@
#ifndef A_SAMP_H
#define A_SAMP_H
#include <stdio.h>
#include "SDK\amx\amx.h"
#include "SDK\plugincommon.h"
#include "Invoke.h"
#include "a_players.h"
#include "a_vehicles.h"
#include "a_objects.h"
// Limits and internal constants
#define MAX_PLAYER_NAME (24)
#define MAX_PLAYERS (500)
#define MAX_VEHICLES (2000)
#define INVALID_PLAYER_ID (0xFFFF)
#define INVALID_VEHICLE_ID (0xFFFF)
#define NO_TEAM (255)
#define MAX_OBJECTS (1000)
#define INVALID_OBJECT_ID (0xFFFF)
#define MAX_GANG_ZONES (1024)
#define MAX_TEXT_DRAWS (2048)
#define MAX_PLAYER_TEXT_DRAWS (256)
#define MAX_MENUS (128)
#define MAX_3DTEXT_GLOBAL (1024)
#define MAX_3DTEXT_PLAYER (1024)
#define MAX_PICKUPS (4096)
#define INVALID_MENU (0xFF)
#define INVALID_TEXT_DRAW (0xFFFF)
#define INVALID_GANG_ZONE (-1)
#define INVALID_3DTEXT_ID (0xFFFF)
// Util
void SendClientMessage(int playerid, unsigned int color, char* message);
void SendClientMessageToAll(unsigned int color, char* message);
void SendPlayerMessageToPlayer(int playerid, int senderid, char* message);
void SendPlayerMessageToAll(int senderid, char* message);
void SendDeathMessage(int killer, int killee, int weapon);
void GameTextForAll(char* string, int time, int style);
void GameTextForPlayer(int playerid, char* string, int time, int style);
int _GetTickCount();
int GetMaxPlayers();
// Game
void SetGameModeText(char* string);
void SetTeamCount(int count); // No effect
int AddPlayerClass(int modelid, float spawn_x, float spawn_y, float spawn_z, float z_angle, int weapon1, int weapon1_ammo, int weapon2, int weapon2_ammo, int weapon3, int weapon3_ammo);
int AddPlayerClassEx(int teamid, int modelid, float spawn_x, float spawn_y, float spawn_z, float z_angle, int weapon1, int weapon1_ammo, int weapon2, int weapon2_ammo, int weapon3, int weapon3_ammo);
int AddStaticVehicle(int modelid, float spawn_x, float spawn_y, float spawn_z, float z_angle, int color1, int color2);
int AddStaticVehicleEx(int modelid, float spawn_x, float spawn_y, float spawn_z, float z_angle, int color1, int color2, int respawn_delay);
int AddStaticPickup(int model, int type, float x, float y, float z, int virtualworld=0);
int CreatePickup(int model, int type, float x, float y, float z, int virtualworld=0);
void DestroyPickup(int pickup);
void ShowNameTags(int show);
void ShowPlayerMarkers(int mode);
void GameModeExit();
void SetWorldTime(int hour);
void GetWeaponName(int weaponid, char* weapon, int len);
void EnableTirePopping(int enable); // Deprecated
void AllowInteriorWeapons(int allow);
void SetWeather(int weatherid);
void SetGravity(float gravity);
void AllowAdminTeleport(int allow); // Deprecated
void SetDeathDropAmount(int amount); // Deprecated
void CreateExplosion(float x, float y, float z, int type, float radius);
void EnableZoneNames(int enable);
void UsePlayerPedAnims();
void DisableInteriorEnterExits();
void SetNameTagDrawDistance(float distance);
void DisableNameTagLOS();
void LimitGlobalChatRadius(float chat_radius);
void LimitPlayerMarkerRadius(float marker_radius);
// Npc
void ConnectNPC(char* name, char* script);
int IsPlayerNPC(int playerid);
// Admin
int IsPlayerAdmin(int playerid);
void Kick(int playerid);
void Ban(int playerid);
void BanEx(int playerid, char* reason);
void SendRconCommand(char* command);
void GetServerVarAsString(char* varname, char* buffer, int len);
int GetServerVarAsInt(char* varname);
int GetServerVarAsBool(char* varname);
void GetPlayerNetworkStats(int playerid, char* retstr, int retstr_size);
void GetNetworkStats(char* retstr, int retstr_size);
void GetPlayerVersion(int playerid, char* version, int len);
// Menu
int CreateMenu(char* title, int columns, float x, float y, float col1width, float col2width=0.0);
int DestroyMenu(int menuid);
void AddMenuItem(int menuid, int column, char* menutext);
void SetMenuColumnHeader(int menuid, int column, char* columnheader);
void ShowMenuForPlayer(int menuid, int playerid);
void HideMenuForPlayer(int menuid, int playerid);
int IsValidMenu(int menuid);
void DisableMenu(int menuid);
void DisableMenuRow(int menuid, int row);
int GetPlayerMenu(int playerid);
// Text Draw
int TextDrawCreate(float x, float y, char* text);
void TextDrawDestroy(int text);
void TextDrawLetterSize(int text, float x, float y);
void TextDrawTextSize(int text, float x, float y);
void TextDrawAlignment(int text, int alignment);
void TextDrawColor(int text, unsigned int color);
void TextDrawUseBox(int text, int use);
void TextDrawBoxColor(int text, int color);
void TextDrawSetShadow(int text, int size);
void TextDrawSetOutline(int text, int size);
void TextDrawBackgroundColor(int text, unsigned int color);
void TextDrawFont(int text, int font);
void TextDrawSetProportional(int text, int set);
void TextDrawSetSelectable(int text, int set);
void TextDrawShowForPlayer(int playerid, int text);
void TextDrawHideForPlayer(int playerid, int text);
void TextDrawShowForAll(int text);
void TextDrawHideForAll(int text);
void TextDrawSetString(int text, char* string);
// Gang Zones
int GangZoneCreate(float minx, float miny, float maxx, float maxy);
void GangZoneDestroy(int zone);
void GangZoneShowForPlayer(int playerid, int zone, unsigned int color);
int GangZoneShowForAll(int zone, unsigned int color);
void GangZoneHideForPlayer(int playerid, int zone);
void GangZoneHideForAll(int zone);
void GangZoneFlashForPlayer(int playerid, int zone, unsigned int flashcolor);
void GangZoneFlashForAll(int zone, unsigned int flashcolor);
void GangZoneStopFlashForPlayer(int playerid, int zone);
void GangZoneStopFlashForAll(int zone);
// Global 3D Text Labels
int Create3DTextLabel(char* text, int color, float x, float y, float z, float drawdistance, int virtualworld, int testlos=0);
int Delete3DTextLabel(int id);
void Attach3DTextLabelToPlayer(int id, int playerid, float offsetx, float offsety, float offsetz);
void Attach3DTextLabelToVehicle(int id, int vehicleid, float offsetx, float offsety, float offsetz);
void Update3DTextLabelText(int id, int color, char* text);
// Per-player 3D Text Labels
int CreatePlayer3DTextLabel(int playerid, char* text, int color, float x, float y, float z, float drawdistance, int attachedplayer=INVALID_PLAYER_ID, int attachedvehicle=INVALID_VEHICLE_ID, int testlos=0);
void DeletePlayer3DTextLabel(int playerid, int id);
void UpdatePlayer3DTextLabelText(int playerid, int id, int color, char* text);
// Player GUI Dialog
void ShowPlayerDialog(int playerid, int dialogid, int style, char* caption, char* info, char* button1, char* button2);
#endif // A_SAMP_H

View File

@ -1,42 +1,42 @@
#include "a_samp.h"
int _samp_CreateVehicle(int vehicletype, float x, float y, float z, float rotation, int color1, int color2, int respawn_delay) {
int CreateVehicle(int vehicletype, float x, float y, float z, float rotation, int color1, int color2, int respawn_delay) {
return g_Invoke->callNative(&PAWN::CreateVehicle, vehicletype, x, y, z, rotation, color1, color2, respawn_delay);
}
void _samp_DestroyVehicle(int vehicleid) {
void DestroyVehicle(int vehicleid) {
g_Invoke->callNative(&PAWN::DestroyVehicle, vehicleid);
}
void _samp_IsVehicleStreamedIn(int vehicleid, int forplayerid) {
void IsVehicleStreamedIn(int vehicleid, int forplayerid) {
g_Invoke->callNative(&PAWN::IsVehicleStreamedIn, vehicleid, forplayerid);
}
void _samp_GetVehiclePos(int vehicleid, float& x, float& y, float& z) {
float _x = 0.0;
float _y = 0.0;
float _z = 0.0;
void GetVehiclePos(int vehicleid, float& x, float& y, float& z) {
float _x = NULL;
float _y = NULL;
float _z = NULL;
g_Invoke->callNative(&PAWN::GetVehiclePos, vehicleid, &_x, &_y, &_z);
x = _x;
y = _y;
z = _z;
}
void _samp_SetVehiclePos(int vehicleid, float x, float y, float z) {
void SetVehiclePos(int vehicleid, float x, float y, float z) {
g_Invoke->callNative(&PAWN::SetVehiclePos, vehicleid, x, y, z);
}
void _samp_GetVehicleZAngle(int vehicleid, float& z_angle) {
float _z_angle = 0.0;
void GetVehicleZAngle(int vehicleid, float& z_angle) {
float _z_angle = NULL;
g_Invoke->callNative(&PAWN::GetVehicleZAngle, vehicleid, &_z_angle);
z_angle = _z_angle;
}
void _samp_GetVehicleRotationQuat(int vehicleid, float& w, float& x, float& y, float& z) {
float _w = 0.0;
float _x = 0.0;
float _y = 0.0;
float _z = 0.0;
void GetVehicleRotationQuat(int vehicleid, float& w, float& x, float& y, float& z) {
float _w = NULL;
float _x = NULL;
float _y = NULL;
float _z = NULL;
g_Invoke->callNative(&PAWN::GetVehicleRotationQuat, vehicleid, &_w, &_x, &_y, &_z);
w = _w;
x = _x;
@ -44,34 +44,34 @@ void _samp_GetVehicleRotationQuat(int vehicleid, float& w, float& x, float& y, f
z = _z;
}
void _samp_GetVehicleDistanceFromPoint(int vehicleid, float x, float y, float z) {
void GetVehicleDistanceFromPoint(int vehicleid, float x, float y, float z) {
g_Invoke->callNative(&PAWN::GetVehicleDistanceFromPoint, vehicleid, x, y, z);
}
void _samp_SetVehicleZAngle(int vehicleid, float z_angle) {
void SetVehicleZAngle(int vehicleid, float z_angle) {
g_Invoke->callNative(&PAWN::SetVehicleZAngle, vehicleid, z_angle);
}
void _samp_SetVehicleParamsForPlayer(int vehicleid, int playerid, int objective, int doorslocked) {
void SetVehicleParamsForPlayer(int vehicleid, int playerid, int objective, int doorslocked) {
g_Invoke->callNative(&PAWN::SetVehicleParamsForPlayer, vehicleid, playerid, objective, doorslocked);
}
void _samp_ManualVehicleEngineAndLights() {
void ManualVehicleEngineAndLights() {
//g_Invoke->callNative(&PAWN::ManualVehicleEngineAndLights);
}
void _samp_SetVehicleParamsEx(int vehicleid, int engine, int lights, int alarm, int doors, int bonnet, int boot, int objective) {
void SetVehicleParamsEx(int vehicleid, int engine, int lights, int alarm, int doors, int bonnet, int boot, int objective) {
g_Invoke->callNative(&PAWN::SetVehicleParamsEx, vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
}
void _samp_GetVehicleParamsEx(int vehicleid, int& engine, int& lights, int& alarm, int& doors, int& bonnet, int& boot, int& objective) {
int _engine = 0;
int _lights = 0;
int _alarm = 0;
int _doors = 0;
int _bonnet = 0;
int _boot = 0;
int _objective = 0;
void GetVehicleParamsEx(int vehicleid, int& engine, int& lights, int& alarm, int& doors, int& bonnet, int& boot, int& objective) {
int _engine = NULL;
int _lights = NULL;
int _alarm = NULL;
int _doors = NULL;
int _bonnet = NULL;
int _boot = NULL;
int _objective = NULL;
g_Invoke->callNative(&PAWN::GetVehicleParamsEx, vehicleid, &_engine, &_lights, &_alarm, &_doors, &_bonnet, &_boot, &_objective);
engine = _engine;
lights = _lights;
@ -82,99 +82,99 @@ void _samp_GetVehicleParamsEx(int vehicleid, int& engine, int& lights, int& alar
objective = _objective;
}
void _samp_SetVehicleToRespawn(int vehicleid) {
void SetVehicleToRespawn(int vehicleid) {
g_Invoke->callNative(&PAWN::SetVehicleToRespawn, vehicleid);
}
void _samp_LinkVehicleToInterior(int vehicleid, int interiorid) {
void LinkVehicleToInterior(int vehicleid, int interiorid) {
g_Invoke->callNative(&PAWN::LinkVehicleToInterior, vehicleid, interiorid);
}
void _samp_AddVehicleComponent(int vehicleid, int componentid) {
void AddVehicleComponent(int vehicleid, int componentid) {
g_Invoke->callNative(&PAWN::AddVehicleComponent, vehicleid, componentid);
}
void _samp_RemoveVehicleComponent(int vehicleid, int componentid) {
void RemoveVehicleComponent(int vehicleid, int componentid) {
g_Invoke->callNative(&PAWN::RemoveVehicleComponent, vehicleid, componentid);
}
void _samp_ChangeVehicleColor(int vehicleid, int color1, int color2) {
void ChangeVehicleColor(int vehicleid, int color1, int color2) {
g_Invoke->callNative(&PAWN::ChangeVehicleColor, vehicleid, color1, color2);
}
void _samp_ChangeVehiclePaintjob(int vehicleid, int paintjobid) {
void ChangeVehiclePaintjob(int vehicleid, int paintjobid) {
g_Invoke->callNative(&PAWN::ChangeVehiclePaintjob, vehicleid, paintjobid);
}
void _samp_SetVehicleHealth(int vehicleid, float health) {
void SetVehicleHealth(int vehicleid, float health) {
g_Invoke->callNative(&PAWN::SetVehicleHealth, vehicleid, health);
}
void _samp_GetVehicleHealth(int vehicleid, float& health) {
float _health = 0.0;
void GetVehicleHealth(int vehicleid, float& health) {
float _health = NULL;
g_Invoke->callNative(&PAWN::GetVehicleHealth, vehicleid, &_health);
health = _health;
}
void _samp_AttachTrailerToVehicle(int trailerid, int vehicleid) {
void AttachTrailerToVehicle(int trailerid, int vehicleid) {
g_Invoke->callNative(&PAWN::AttachTrailerToVehicle, trailerid, vehicleid);
}
void _samp_DetachTrailerFromVehicle(int vehicleid) {
void DetachTrailerFromVehicle(int vehicleid) {
g_Invoke->callNative(&PAWN::DetachTrailerFromVehicle, vehicleid);
}
int _samp_IsTrailerAttachedToVehicle(int vehicleid) {
int IsTrailerAttachedToVehicle(int vehicleid) {
return g_Invoke->callNative(&PAWN::IsTrailerAttachedToVehicle, vehicleid);
}
int _samp_GetVehicleTrailer(int vehicleid) {
int GetVehicleTrailer(int vehicleid) {
return g_Invoke->callNative(&PAWN::GetVehicleTrailer, vehicleid);
}
void _samp_SetVehicleNumberPlate(int vehicleid, char* numberplate) {
void SetVehicleNumberPlate(int vehicleid, char* numberplate) {
g_Invoke->callNative(&PAWN::SetVehicleNumberPlate, vehicleid, numberplate);
}
int _samp_GetVehicleModel(int vehicleid) {
int GetVehicleModel(int vehicleid) {
return g_Invoke->callNative(&PAWN::GetVehicleModel, vehicleid);
}
int _samp_GetVehicleComponentInSlot(int vehicleid, int slot) {
int GetVehicleComponentInSlot(int vehicleid, int slot) {
return g_Invoke->callNative(&PAWN::GetVehicleComponentInSlot, vehicleid, slot);
}
int _samp_GetVehicleComponentType(int component) {
int GetVehicleComponentType(int component) {
return g_Invoke->callNative(&PAWN::GetVehicleComponentType, component);
}
void _samp_RepairVehicle(int vehicleid) {
void RepairVehicle(int vehicleid) {
g_Invoke->callNative(&PAWN::RepairVehicle, vehicleid);
}
void _samp_GetVehicleVelocity(int vehicleid, float& x, float& y, float& z) {
float _x = 0.0;
float _y = 0.0;
float _z = 0.0;
void GetVehicleVelocity(int vehicleid, float& x, float& y, float& z) {
float _x = NULL;
float _y = NULL;
float _z = NULL;
g_Invoke->callNative(&PAWN::GetVehicleVelocity, vehicleid, &_x, &_y, &_z);
x = _x;
y = _y;
z = _z;
}
void _samp_SetVehicleVelocity(int vehicleid, float x, float y, float z) {
void SetVehicleVelocity(int vehicleid, float x, float y, float z) {
g_Invoke->callNative(&PAWN::SetVehicleVelocity, vehicleid, x, y, z);
}
void _samp_SetVehicleAngularVelocity(int vehicleid, float x, float y, float z) {
void SetVehicleAngularVelocity(int vehicleid, float x, float y, float z) {
g_Invoke->callNative(&PAWN::SetVehicleAngularVelocity, vehicleid, x, y, z);
}
void _samp_GetVehicleDamageStatus(int vehicleid, int& panels, int& doors, int& lights, int& tires) {
int _panels = 0;
int _doors = 0;
int _lights = 0;
int _tires = 0;
void GetVehicleDamageStatus(int vehicleid, int& panels, int& doors, int& lights, int& tires) {
int _panels = NULL;
int _doors = NULL;
int _lights = NULL;
int _tires = NULL;
g_Invoke->callNative(&PAWN::GetVehicleDamageStatus, vehicleid, &_panels, &_doors, &_lights, &_tires);
panels = _panels;
doors = _doors;
@ -182,25 +182,24 @@ void _samp_GetVehicleDamageStatus(int vehicleid, int& panels, int& doors, int& l
tires = _tires;
}
void _samp_UpdateVehicleDamageStatus(int vehicleid, int panels, int doors, int lights, int tires) {
void UpdateVehicleDamageStatus(int vehicleid, int panels, int doors, int lights, int tires) {
g_Invoke->callNative(&PAWN::UpdateVehicleDamageStatus, vehicleid, panels, doors, lights, tires);
}
void _samp_GetVehicleModelInfo(int vehiclemodel, int infotype, float& x, float& y, float& z) {
float _x = 0.0;
float _y = 0.0;
float _z = 0.0;
void GetVehicleModelInfo(int vehiclemodel, int infotype, float& x, float& y, float& z) {
float _x = NULL;
float _y = NULL;
float _z = NULL;
g_Invoke->callNative(&PAWN::GetVehicleModelInfo, vehiclemodel, infotype, &_x, &_y, &_z);
x = _x;
y = _y;
z = _z;
}
void _samp_SetVehicleVirtualWorld(int vehicleid, int worldid) {
void SetVehicleVirtualWorld(int vehicleid, int worldid) {
g_Invoke->callNative(&PAWN::SetVehicleVirtualWorld, vehicleid, worldid);
}
int _samp_GetVehicleVirtualWorld(int vehicleid) {
int GetVehicleVirtualWorld(int vehicleid) {
return g_Invoke->callNative(&PAWN::GetVehicleVirtualWorld, vehicleid);
}

View File

@ -0,0 +1,43 @@
#ifndef _A_VEHICLES_H
#define _A_VEHICLES_H
int CreateVehicle(int vehicletype, float x, float y, float z, float rotation, int color1, int color2, int respawn_delay);
void DestroyVehicle(int vehicleid);
void IsVehicleStreamedIn(int vehicleid, int forplayerid);
void GetVehiclePos(int vehicleid, float& x, float& y, float& z);
void SetVehiclePos(int vehicleid, float x, float y, float z);
void GetVehicleZAngle(int vehicleid, float& z_angle);
void GetVehicleRotationQuat(int vehicleid, float& w, float& x, float& y, float& z);
void GetVehicleDistanceFromPoint(int vehicleid, float x, float y, float z);
void SetVehicleZAngle(int vehicleid, float z_angle);
void SetVehicleParamsForPlayer(int vehicleid, int playerid, int objective, int doorslocked);
void ManualVehicleEngineAndLights(int );
void SetVehicleParamsEx(int vehicleid, int engine, int lights, int alarm, int doors, int bonnet, int boot, int objective);
void GetVehicleParamsEx(int vehicleid, int& engine, int& lights, int& alarm, int& doors, int& bonnet, int& boot, int& objective);
void SetVehicleToRespawn(int vehicleid);
void LinkVehicleToInterior(int vehicleid, int interiorid);
void AddVehicleComponent(int vehicleid, int componentid);
void RemoveVehicleComponent(int vehicleid, int componentid);
void ChangeVehicleColor(int vehicleid, int color1, int color2);
void ChangeVehiclePaintjob(int vehicleid, int paintjobid);
void SetVehicleHealth(int vehicleid, float health);
void GetVehicleHealth(int vehicleid, float& health);
void AttachTrailerToVehicle(int trailerid, int vehicleid);
void DetachTrailerFromVehicle(int vehicleid);
int IsTrailerAttachedToVehicle(int vehicleid);
int GetVehicleTrailer(int vehicleid);
void SetVehicleNumberPlate(int vehicleid, char* numberplate);
int GetVehicleModel(int vehicleid);
int GetVehicleComponentInSlot(int vehicleid, int slot);
int GetVehicleComponentType(int component);
void RepairVehicle(int vehicleid);
void GetVehicleVelocity(int vehicleid, float& x, float& y, float& z);
void SetVehicleVelocity(int vehicleid, float x, float y, float z);
void SetVehicleAngularVelocity(int vehicleid, float x, float y, float z);
void GetVehicleDamageStatus(int vehicleid, int& panels, int& doors, int& lights, int& tires);
void UpdateVehicleDamageStatus(int vehicleid, int panels, int doors, int lights, int tires);
void GetVehicleModelInfo(int vehiclemodel, int infotype, float& x, float& y, float& z);
void SetVehicleVirtualWorld(int vehicleid, int worldid);
int GetVehicleVirtualWorld(int vehicleid);
#endif //_A_VEHICLES_H

View File

@ -1,21 +1,21 @@
#include "callbacks.h"
#include "Mono.h"
#include <stdio.h>
#include <stdlib.h>
#pragma region OnGameModeInit()
// PAWN native: native CBOnGameModeInit();
cell AMX_NATIVE_CALL CBOnGameModeInit(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnGameModeInit", 0);
g_Mono->callMethod("Internal:OnGameModeInit", NULL);
return 1;
}
#pragma endregion
#pragma region OnGameModeExit()
// PAWN native: native CBOnGameModeExit();
cell AMX_NATIVE_CALL CBOnGameModeExit(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnGameModeExit", 0);
g_Mono->callMethod("Internal:OnGameModeExit", NULL);
return 1;
}
#pragma endregion
#pragma region OnPlayerConnect(playerid)
// PAWN native: native CBOnPlayerConnect(playerid);
cell AMX_NATIVE_CALL CBOnPlayerConnect(AMX *amx, cell *params) {
// Create variables to store the arguments
@ -27,7 +27,8 @@ cell AMX_NATIVE_CALL CBOnPlayerConnect(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnPlayerConnect", args);
return 1;
}
#pragma endregion
#pragma region OnPlayerDisconnect(playerid, reason)
// PAWN native: native CBOnPlayerDisconnect(playerid, reason);
cell AMX_NATIVE_CALL CBOnPlayerDisconnect(AMX *amx, cell *params) {
// Create variables to store the arguments
@ -43,7 +44,8 @@ cell AMX_NATIVE_CALL CBOnPlayerDisconnect(AMX *amx, cell *params) {
return 1;
}
#pragma endregion
#pragma region OnPlayerSpawn(playerid)
// PAWN native: native CBOnPlayerSpawn(playerid);
cell AMX_NATIVE_CALL CBOnPlayerSpawn(AMX *amx, cell *params) {
// Create variables to store the arguments
@ -54,7 +56,8 @@ cell AMX_NATIVE_CALL CBOnPlayerSpawn(AMX *amx, cell *params) {
// Call the method and return result
return g_Mono->callReturn("Internal:OnPlayerSpawn", args);
}
#pragma endregion
#pragma region OnPlayerDeath(playerid, killerid, reason)
// PAWN native: native CBOnPlayerDeath(playerid, killerid, reason);
cell AMX_NATIVE_CALL CBOnPlayerDeath(AMX *amx, cell *params) {
void *args[3];
@ -69,7 +72,8 @@ cell AMX_NATIVE_CALL CBOnPlayerDeath(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnPlayerDeath", args);
return 1;
}
#pragma endregion
#pragma region OnVehicleSpawn(vehicleid)
// PAWN native: native CBOnVehicleSpawn(vehicleid);
cell AMX_NATIVE_CALL CBOnVehicleSpawn(AMX *amx, cell *params) {
void *args[1];
@ -79,7 +83,8 @@ cell AMX_NATIVE_CALL CBOnVehicleSpawn(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnVehicleSpawn", args);
return 1;
}
#pragma endregion
#pragma region OnVehicleDeath(vehicleid, killerid)
// PAWN native: native CBOnVehicleDeath(vehicleid, killerid);
cell AMX_NATIVE_CALL CBOnVehicleDeath(AMX *amx, cell *params) {
void *args[2];
@ -92,14 +97,15 @@ cell AMX_NATIVE_CALL CBOnVehicleDeath(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnVehicleDeath", args);
return 1;
}
#pragma endregion
#pragma region OnPlayerText(playerid, text[])
// PAWN native: native CBOnPlayerText(playerid, text[]);
cell AMX_NATIVE_CALL CBOnPlayerText(AMX *amx, cell *params) {
// Define some variables
int
len = 0,
ret = 0;
cell *addr = 0;
len = NULL,
ret = NULL;
cell *addr = NULL;
// Get address and string length
amx_GetAddr(amx, params[2], &addr);
@ -128,14 +134,15 @@ cell AMX_NATIVE_CALL CBOnPlayerText(AMX *amx, cell *params) {
return ret;
}
#pragma endregion
#pragma region OnPlayerCommandText(playerid, cmdtext[])
// PAWN native: native CBOnPlayerCommandText(playerid, cmdtext[]);
cell AMX_NATIVE_CALL CBOnPlayerCommandText(AMX *amx, cell *params) {
// Define some variables
int
len = 0,
ret = 0;
cell *addr = 0;
len = NULL,
ret = NULL;
cell *addr = NULL;
// Get address and string length
amx_GetAddr(amx, params[2], &addr);
@ -164,7 +171,8 @@ cell AMX_NATIVE_CALL CBOnPlayerCommandText(AMX *amx, cell *params) {
// Return 'ret'
return ret;
}
#pragma endregion
#pragma region OnPlayerRequestClass(playerid, classid)
// PAWN native: native CBOnPlayerRequestClass(playerid, classid);
cell AMX_NATIVE_CALL CBOnPlayerRequestClass(AMX *amx, cell *params) {
// Create variables to store the arguments
@ -178,7 +186,8 @@ cell AMX_NATIVE_CALL CBOnPlayerRequestClass(AMX *amx, cell *params) {
// Call the method and return result
return g_Mono->callReturn("Internal:OnPlayerRequestClass", args);
}
#pragma endregion
#pragma region OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
// PAWN native: native CBOnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
cell AMX_NATIVE_CALL CBOnPlayerEnterVehicle(AMX *amx, cell *params) {
void *args[3];
@ -193,7 +202,8 @@ cell AMX_NATIVE_CALL CBOnPlayerEnterVehicle(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnPlayerEnterVehicle", args);
return 1;
}
#pragma endregion
#pragma region OnPlayerExitVehicle(playerid, vehicleid)
// PAWN native: native CBOnPlayerExitVehicle(playerid, vehicleid);
cell AMX_NATIVE_CALL CBOnPlayerExitVehicle(AMX *amx, cell *params) {
void *args[1];
@ -206,7 +216,8 @@ cell AMX_NATIVE_CALL CBOnPlayerExitVehicle(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnPlayerExitVehicle", args);
return 1;
}
#pragma endregion
#pragma region OnPlayerStateChange(playerid, newstate, oldstate)
// PAWN native: native CBOnPlayerStateChange(playerid, newstate, oldstate);
cell AMX_NATIVE_CALL CBOnPlayerStateChange(AMX *amx, cell *params) {
void *args[3];
@ -221,7 +232,8 @@ cell AMX_NATIVE_CALL CBOnPlayerStateChange(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnPlayerStateChange", args);
return 1;
}
#pragma endregion
#pragma region OnPlayerEnterCheckpoint(playerid)
// PAWN native: native CBOnPlayerEnterCheckpoint(playerid);
cell AMX_NATIVE_CALL CBOnPlayerEnterCheckpoint(AMX *amx, cell *params) {
void *args[1];
@ -231,7 +243,8 @@ cell AMX_NATIVE_CALL CBOnPlayerEnterCheckpoint(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnPlayerEnterCheckpoint", args);
return 1;
}
#pragma endregion
#pragma region OnPlayerLeaveCheckpoint(playerid)
// PAWN native: native CBOnPlayerLeaveCheckpoint(playerid);
cell AMX_NATIVE_CALL CBOnPlayerLeaveCheckpoint(AMX *amx, cell *params) {
void *args[1];
@ -241,7 +254,8 @@ cell AMX_NATIVE_CALL CBOnPlayerLeaveCheckpoint(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnPlayerLeaveCheckpoint", args);
return 1;
}
#pragma endregion
#pragma region OnPlayerEnterRaceCheckpoint(playerid)
// PAWN native: native CBOnPlayerEnterRaceCheckpoint(playerid);
cell AMX_NATIVE_CALL CBOnPlayerEnterRaceCheckpoint(AMX *amx, cell *params) {
void *args[1];
@ -251,7 +265,8 @@ cell AMX_NATIVE_CALL CBOnPlayerEnterRaceCheckpoint(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnPlayerEnterRaceCheckpoint", args);
return 1;
}
#pragma endregion
#pragma region OnPlayerLeaveRaceCheckpoint(playerid)
// PAWN native: native CBOnPlayerLeaveRaceCheckpoint(playerid);
cell AMX_NATIVE_CALL CBOnPlayerLeaveRaceCheckpoint(AMX *amx, cell *params) {
void *args[1];
@ -261,14 +276,15 @@ cell AMX_NATIVE_CALL CBOnPlayerLeaveRaceCheckpoint(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnPlayerLeaveRaceCheckpoint", args);
return 1;
}
#pragma endregion
#pragma region OnRconCommand(cmd[])
// PAWN native: native CBOnRconCommand(cmd[]);
cell AMX_NATIVE_CALL CBOnRconCommand(AMX *amx, cell *params) {
// Define some variables
int
len = 0,
ret = 0;
cell *addr = 0;
len = NULL,
ret = NULL;
cell *addr = NULL;
// Get address and string length
amx_GetAddr(amx, params[1], &addr);
@ -296,7 +312,8 @@ cell AMX_NATIVE_CALL CBOnRconCommand(AMX *amx, cell *params) {
return ret;
}
#pragma endregion
#pragma region OnPlayerRequestSpawn(playerid)
// PAWN native: native CBOnPlayerRequestSpawn(playerid);
cell AMX_NATIVE_CALL CBOnPlayerRequestSpawn(AMX *amx, cell *params) {
void *args[1];
@ -305,7 +322,8 @@ cell AMX_NATIVE_CALL CBOnPlayerRequestSpawn(AMX *amx, cell *params) {
return g_Mono->callReturn("Internal:OnPlayerRequestSpawn", args);
}
#pragma endregion
#pragma region OnObjectMoved(objectid)
// PAWN native: native CBOnObjectMoved(objectid);
cell AMX_NATIVE_CALL CBOnObjectMoved(AMX *amx, cell *params) {
// Set arguments
@ -317,7 +335,8 @@ cell AMX_NATIVE_CALL CBOnObjectMoved(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnObjectMoved", args);
return 1;
}
#pragma endregion
#pragma region OnPlayerObjectMoved(playerid, objectid)
// PAWN native: native CBOnPlayerObjectMoved(playerid, objectid);
cell AMX_NATIVE_CALL CBOnPlayerObjectMoved(AMX *amx, cell *params) {
void *args[2];
@ -330,7 +349,8 @@ cell AMX_NATIVE_CALL CBOnPlayerObjectMoved(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnPlayerObjectMoved", args);
return 1;
}
#pragma endregion
#pragma region OnPlayerPickUpPickup(playerid, pickupid)
// PAWN native: native CBOnPlayerPickUpPickup(playerid, pickupid);
cell AMX_NATIVE_CALL CBOnPlayerPickUpPickup(AMX *amx, cell *params) {
void *args[1];
@ -343,7 +363,8 @@ cell AMX_NATIVE_CALL CBOnPlayerPickUpPickup(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnPlayerPickUpPickup", args);
return 1;
}
#pragma endregion
#pragma region OnVehicleMod(playerid, vehicleid, componentid)
// PAWN native: native CBOnVehicleMod(playerid, vehicleid, componentid);
cell AMX_NATIVE_CALL CBOnVehicleMod(AMX *amx, cell *params) {
void *args[3];
@ -357,7 +378,8 @@ cell AMX_NATIVE_CALL CBOnVehicleMod(AMX *amx, cell *params) {
return g_Mono->callReturn("Internal:OnVehicleMod", args);
}
#pragma endregion
#pragma region OnEnterExitModShop(playerid, enterexit, interiorid)
// PAWN native: native CBOnEnterExitModShop(playerid, enterexit, interiorid);
cell AMX_NATIVE_CALL CBOnEnterExitModShop(AMX *amx, cell *params) {
void *args[3];
@ -373,7 +395,8 @@ cell AMX_NATIVE_CALL CBOnEnterExitModShop(AMX *amx, cell *params) {
return g_Mono->callReturn("Internal:OnEnterExitModShop", args);
}
#pragma endregion
#pragma region OnVehiclePaintjob(playerid, vehicleid, paintjobid)
// PAWN native: native CBOnVehiclePaintjob(playerid, vehicleid, paintjobid);
cell AMX_NATIVE_CALL CBOnVehiclePaintjob(AMX *amx, cell *params) {
void *args[3];
@ -388,7 +411,8 @@ cell AMX_NATIVE_CALL CBOnVehiclePaintjob(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnVehiclePaintjob", args);
return 1;
}
#pragma endregion
#pragma region OnVehicleRespray(playerid, vehicleid, color1, color2)
// PAWN native: native CBOnVehicleRespray(playerid, vehicleid, color1, color2);
cell AMX_NATIVE_CALL CBOnVehicleRespray(AMX *amx, cell *params) {
void *args[4];
@ -405,7 +429,8 @@ cell AMX_NATIVE_CALL CBOnVehicleRespray(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnVehicleRespray", args);
return 1;
}
#pragma endregion
#pragma region OnVehicleDamageStatusUpdate(vehicleid, playerid)
// PAWN native: native CBOnVehicleDamageStatusUpdate(vehicleid, playerid);
cell AMX_NATIVE_CALL CBOnVehicleDamageStatusUpdate(AMX *amx, cell *params) {
void *args[2];
@ -418,7 +443,8 @@ cell AMX_NATIVE_CALL CBOnVehicleDamageStatusUpdate(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnVehicleDamageStatusUpdate", args);
return 1;
}
#pragma endregion
#pragma region OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat)
// PAWN native: native CBOnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat);
cell AMX_NATIVE_CALL CBOnUnoccupiedVehicleUpdate(AMX *amx, cell *params) {
void *args[3];
@ -433,7 +459,8 @@ cell AMX_NATIVE_CALL CBOnUnoccupiedVehicleUpdate(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnUnoccupiedVehicleUpdate", args);
return 1;
}
#pragma endregion
#pragma region OnPlayerSelectedMenuRow(playerid, row)
// PAWN native: native CBOnPlayerSelectedMenuRow(playerid, row);
cell AMX_NATIVE_CALL CBOnPlayerSelectedMenuRow(AMX *amx, cell *params) {
void *args[2];
@ -446,7 +473,8 @@ cell AMX_NATIVE_CALL CBOnPlayerSelectedMenuRow(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnPlayerSelectedMenuRow", args);
return 1;
}
#pragma endregion
#pragma region OnPlayerExitedMenu(playerid)
// PAWN native: native CBOnPlayerExitedMenu(playerid);
cell AMX_NATIVE_CALL CBOnPlayerExitedMenu(AMX *amx, cell *params) {
void *args[1];
@ -456,7 +484,8 @@ cell AMX_NATIVE_CALL CBOnPlayerExitedMenu(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnPlayerExitedMenu", args);
return 1;
}
#pragma endregion
#pragma region OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
// PAWN native: native CBOnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid);
cell AMX_NATIVE_CALL CBOnPlayerInteriorChange(AMX *amx, cell *params) {
void *args[3];
@ -471,7 +500,8 @@ cell AMX_NATIVE_CALL CBOnPlayerInteriorChange(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnPlayerInteriorChange", args);
return 1;
}
#pragma endregion
#pragma region OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
// PAWN native: native CBOnPlayerKeyStateChange(playerid, newkeys, oldkeys);
cell AMX_NATIVE_CALL CBOnPlayerKeyStateChange(AMX *amx, cell *params) {
void *args[3];
@ -485,12 +515,13 @@ cell AMX_NATIVE_CALL CBOnPlayerKeyStateChange(AMX *amx, cell *params) {
return g_Mono->callReturn("Internal:OnPlayerKeyStateChange", args);
}
#pragma endregion
#pragma region OnRconLoginAttempt(ip[], password[], success)
// PAWN native: native CBOnRconLoginAttempt(ip[], password[], success);
cell AMX_NATIVE_CALL CBOnRconLoginAttempt(AMX *amx, cell *params) {
int success = params[3];
int len[2] = { 0, 0 };
cell *addr[2] = { 0, 0 };
int len[2] = { NULL, NULL };
cell *addr[2] = { NULL, NULL };
MonoString *ip, *password;
@ -522,7 +553,8 @@ cell AMX_NATIVE_CALL CBOnRconLoginAttempt(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnRconLoginAttempt", args);
return 1;
}
#pragma endregion
#pragma region OnPlayerUpdate(playerid)
// PAWN native: native CBOnPlayerUpdate(playerid);
cell AMX_NATIVE_CALL CBOnPlayerUpdate(AMX *amx, cell *params) {
void *args[1];
@ -531,7 +563,8 @@ cell AMX_NATIVE_CALL CBOnPlayerUpdate(AMX *amx, cell *params) {
return g_Mono->callReturn("Internal:OnPlayerUpdate", args);
}
#pragma endregion
#pragma region OnPlayerStreamIn(playerid, forplayerid)
// PAWN native: native CBOnPlayerStreamIn(playerid, forplayerid);
cell AMX_NATIVE_CALL CBOnPlayerStreamIn(AMX *amx, cell *params) {
void *args[2];
@ -544,7 +577,8 @@ cell AMX_NATIVE_CALL CBOnPlayerStreamIn(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnPlayerStreamIn", args);
return 1;
}
#pragma endregion
#pragma region OnPlayerStreamOut(playerid, forplayerid)
// PAWN native: native CBOnPlayerStreamOut(playerid, forplayerid);
cell AMX_NATIVE_CALL CBOnPlayerStreamOut(AMX *amx, cell *params) {
void *args[2];
@ -557,7 +591,8 @@ cell AMX_NATIVE_CALL CBOnPlayerStreamOut(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnPlayerStreamOut", args);
return 1;
}
#pragma endregion
#pragma region OnVehicleStreamIn(vehicleid, forplayerid)
// PAWN native: native CBOnVehicleStreamIn(vehicleid, forplayerid);
cell AMX_NATIVE_CALL CBOnVehicleStreamIn(AMX *amx, cell *params) {
void *args[2];
@ -570,7 +605,8 @@ cell AMX_NATIVE_CALL CBOnVehicleStreamIn(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnVehicleStreamIn", args);
return 1;
}
#pragma endregion
#pragma region OnVehicleStreamOut(vehicleid, forplayerid)
// PAWN native: native CBOnVehicleStreamOut(vehicleid, forplayerid);
cell AMX_NATIVE_CALL CBOnVehicleStreamOut(AMX *amx, cell *params) {
void *args[2];
@ -583,12 +619,13 @@ cell AMX_NATIVE_CALL CBOnVehicleStreamOut(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnVehicleStreamOut", args);
return 1;
}
#pragma endregion
#pragma region OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
// PAWN native: native CBOnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
cell AMX_NATIVE_CALL CBOnDialogResponse(AMX *amx, cell *params) {
// Create some variables
int len = 0;
cell *addr = 0;
int len = NULL;
cell *addr = NULL;
// Get address and string length
@ -609,7 +646,7 @@ cell AMX_NATIVE_CALL CBOnDialogResponse(AMX *amx, cell *params) {
args[1] = &dialogid;
args[2] = &response;
args[3] = &listitem;
args[4] = 0;
args[4] = NULL;
if(len) {
// Create a buffer variable
@ -627,7 +664,8 @@ cell AMX_NATIVE_CALL CBOnDialogResponse(AMX *amx, cell *params) {
return g_Mono->callReturn("Internal:OnDialogResponse", args);
}
#pragma endregion
#pragma region OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
// PAWN native: native CBOnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid);
cell AMX_NATIVE_CALL CBOnPlayerTakeDamage(AMX *amx, cell *params) {
void *args[4];
@ -644,7 +682,8 @@ cell AMX_NATIVE_CALL CBOnPlayerTakeDamage(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnPlayerTakeDamage", args);
return 1;
}
#pragma endregion
#pragma region OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
// PAWN native: native CBOnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid);
cell AMX_NATIVE_CALL CBOnPlayerGiveDamage(AMX *amx, cell *params) {
void *args[4];
@ -661,7 +700,8 @@ cell AMX_NATIVE_CALL CBOnPlayerGiveDamage(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnPlayerGiveDamage", args);
return 1;
}
#pragma endregion
#pragma region OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
// PAWN native: native CBOnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ);
cell AMX_NATIVE_CALL CBOnPlayerClickMap(AMX *amx, cell *params) {
void *args[4];
@ -679,7 +719,8 @@ cell AMX_NATIVE_CALL CBOnPlayerClickMap(AMX *amx, cell *params) {
return 1;
}
#pragma endregion
#pragma region OnPlayerClickTextDraw(playerid, Text:clickedid)
// PAWN native: native CBOnPlayerClickTextDraw(playerid, Text:clickedid);
cell AMX_NATIVE_CALL CBOnPlayerClickTextDraw(AMX *amx, cell *params) {
void *args[2];
@ -691,7 +732,8 @@ cell AMX_NATIVE_CALL CBOnPlayerClickTextDraw(AMX *amx, cell *params) {
return g_Mono->callReturn("Internal:OnPlayerClickTextDraw", args);
}
#pragma endregion
#pragma region OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
// PAWN native: native CBOnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid);
cell AMX_NATIVE_CALL CBOnPlayerClickPlayerTextDraw(AMX *amx, cell *params) {
void *args[2];
@ -704,7 +746,8 @@ cell AMX_NATIVE_CALL CBOnPlayerClickPlayerTextDraw(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnPlayerClickPlayerTextDraw", args);
return 1;
}
#pragma endregion
#pragma region OnPlayerClickPlayer(playerid, clickedplayerid, source)
// PAWN native: native CBOnPlayerClickPlayer(playerid, clickedplayerid, source);
cell AMX_NATIVE_CALL CBOnPlayerClickPlayer(AMX *amx, cell *params) {
void *args[3];
@ -719,7 +762,8 @@ cell AMX_NATIVE_CALL CBOnPlayerClickPlayer(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnPlayerClickPlayer", args);
return 1;
}
#pragma endregion
#pragma region OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ);
// PAWN native: native CBOnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ);
cell AMX_NATIVE_CALL CBOnPlayerEditObject(AMX *amx, cell *params) {
void *args[10];
@ -750,7 +794,8 @@ cell AMX_NATIVE_CALL CBOnPlayerEditObject(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnPlayerEditObject", args);
return 1;
}
#pragma endregion
#pragma region OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid,Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ,Float:fRotX, Float:fRotY, Float:fRotZ,Float:fScaleX, Float:fScaleY, Float:fScaleZ);
// PAWN native: native CBOnPlayerEditAttachedObject(playerid, response, index, modelid, boneid,Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ,Float:fRotX, Float:fRotY, Float:fRotZ,Float:fScaleX, Float:fScaleY, Float:fScaleZ);
cell AMX_NATIVE_CALL CBOnPlayerEditAttachedObject(AMX *amx, cell *params) {
void *args[14];
@ -778,7 +823,7 @@ cell AMX_NATIVE_CALL CBOnPlayerEditAttachedObject(AMX *amx, cell *params) {
args[4] = &boneid;
args[5] = &fOffsetX;
args[6] = &fOffsetY;
args[7] = &fOffsetZ;
args[7] = &fOffsetY;
args[8] = &fRotX;
args[9] = &fRotY;
args[10] = &fRotZ;
@ -789,7 +834,8 @@ cell AMX_NATIVE_CALL CBOnPlayerEditAttachedObject(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnPlayerEditAttachedObject", args);
return 1;
}
#pragma endregion
#pragma region OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ)
// PAWN native: native CBOnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ);
cell AMX_NATIVE_CALL CBOnPlayerSelectObject(AMX *amx, cell *params) {
void *args[7];
@ -814,3 +860,4 @@ cell AMX_NATIVE_CALL CBOnPlayerSelectObject(AMX *amx, cell *params) {
g_Mono->callMethod("Internal:OnPlayerSelectObject", args);
return 1;
}
#pragma endregion

View File

@ -3,7 +3,6 @@
#include "a_samp.h"
extern "C" {
cell AMX_NATIVE_CALL CBOnGameModeInit(AMX *amx, cell *params);
cell AMX_NATIVE_CALL CBOnGameModeExit(AMX *amx, cell *params);
cell AMX_NATIVE_CALL CBOnPlayerConnect(AMX *amx, cell *params);
@ -53,6 +52,5 @@ cell AMX_NATIVE_CALL CBOnPlayerClickPlayer(AMX *amx, cell *params);
cell AMX_NATIVE_CALL CBOnPlayerEditObject(AMX *amx, cell *params);
cell AMX_NATIVE_CALL CBOnPlayerEditAttachedObject(AMX *amx, cell *params);
cell AMX_NATIVE_CALL CBOnPlayerSelectObject(AMX *amx, cell *params);
}
#endif // _CALLBACKS_H
#endif // _CALLBACKS_H

View File

@ -1,6 +1,330 @@
EXPORTS
; AMX
Supports
Load
Unload
AmxLoad
AmxUnload
fnlogprintf
; a_samp.inc
SendClientMessage
SendClientMessageToAll
SendPlayerMessageToPlayer
SendPlayerMessageToAll
SendDeathMessage
GameTextForAll
GameTextForPlayer
_GetTickCount
GetMaxPlayers
SetGameModeText
SetTeamCount
AddPlayerClass
AddPlayerClassEx
AddStaticVehicle
AddStaticVehicleEx
AddStaticPickup
CreatePickup
DestroyPickup
ShowNameTags
ShowPlayerMarkers
GameModeExit
SetWorldTime
GetWeaponName
EnableTirePopping
AllowInteriorWeapons
SetWeather
SetGravity
AllowAdminTeleport
SetDeathDropAmount
CreateExplosion
EnableZoneNames
UsePlayerPedAnims
DisableInteriorEnterExits
SetNameTagDrawDistance
DisableNameTagLOS
LimitGlobalChatRadius
LimitPlayerMarkerRadius
ConnectNPC
IsPlayerNPC
IsPlayerAdmin
Kick
Ban
BanEx
SendRconCommand
GetServerVarAsString
GetServerVarAsInt
GetServerVarAsBool
GetPlayerNetworkStats
GetNetworkStats
GetPlayerVersion
CreateMenu
DestroyMenu
AddMenuItem
SetMenuColumnHeader
ShowMenuForPlayer
HideMenuForPlayer
IsValidMenu
DisableMenu
DisableMenuRow
GetPlayerMenu
TextDrawCreate
TextDrawDestroy
TextDrawLetterSize
TextDrawTextSize
TextDrawAlignment
TextDrawColor
TextDrawUseBox
TextDrawBoxColor
TextDrawSetShadow
TextDrawSetOutline
TextDrawBackgroundColor
TextDrawFont
TextDrawSetProportional
TextDrawSetSelectable
TextDrawShowForPlayer
TextDrawHideForPlayer
TextDrawShowForAll
TextDrawHideForAll
TextDrawSetString
GangZoneCreate
GangZoneDestroy
GangZoneShowForPlayer
GangZoneShowForAll
GangZoneHideForPlayer
GangZoneHideForAll
GangZoneFlashForPlayer
GangZoneFlashForAll
GangZoneStopFlashForPlayer
GangZoneStopFlashForAll
Create3DTextLabel
Delete3DTextLabel
Attach3DTextLabelToPlayer
Attach3DTextLabelToVehicle
Update3DTextLabelText
CreatePlayer3DTextLabel
DeletePlayer3DTextLabel
UpdatePlayer3DTextLabelText
ShowPlayerDialog
; a_players.inc
SetSpawnInfo
SpawnPlayer
SetPlayerPos
SetPlayerPosFindZ
GetPlayerPos
SetPlayerFacingAngle
GetPlayerFacingAngle
;IsPlayerInRangeOfPoint
;GetPlayerDistanceFromPoint
IsPlayerStreamedIn
SetPlayerInterior
GetPlayerInterior
SetPlayerHealth
GetPlayerHealth
SetPlayerArmour
GetPlayerArmour
SetPlayerAmmo
GetPlayerAmmo
GetPlayerWeaponState
GetPlayerTargetPlayer
SetPlayerTeam
GetPlayerTeam
SetPlayerScore
GetPlayerScore
GetPlayerDrunkLevel
SetPlayerDrunkLevel
SetPlayerColor
GetPlayerColor
SetPlayerSkin
GetPlayerSkin
GivePlayerWeapon
ResetPlayerWeapons
SetPlayerArmedWeapon
GetPlayerWeaponData
GivePlayerMoney
ResetPlayerMoney
SetPlayerName
GetPlayerMoney
GetPlayerState
GetPlayerIp
GetPlayerPing
GetPlayerWeapon
GetPlayerKeys
GetPlayerName
SetPlayerTime
GetPlayerTime
TogglePlayerClock
SetPlayerWeather
ForceClassSelection
SetPlayerWantedLevel
GetPlayerWantedLevel
SetPlayerFightingStyle
GetPlayerFightingStyle
SetPlayerVelocity
GetPlayerVelocity
PlayCrimeReportForPlayer
PlayAudioStreamForPlayer
StopAudioStreamForPlayer
SetPlayerShopName
SetPlayerSkillLevel
GetPlayerSurfingVehicleID
GetPlayerSurfingObjectID
RemoveBuildingForPlayer
SetPlayerAttachedObject
RemovePlayerAttachedObject
IsPlayerAttachedObjectSlotUsed
EditAttachedObject
CreatePlayerTextDraw
PlayerTextDrawDestroy
PlayerTextDrawLetterSize
PlayerTextDrawTextSize
PlayerTextDrawAlignment
PlayerTextDrawColor
PlayerTextDrawUseBox
PlayerTextDrawBoxColor
PlayerTextDrawSetShadow
PlayerTextDrawSetOutline
PlayerTextDrawBackgroundColor
PlayerTextDrawFont
PlayerTextDrawSetProportional
PlayerTextDrawSetSelectable
PlayerTextDrawShow
PlayerTextDrawHide
PlayerTextDrawSetString
SetPVarInt
GetPVarInt
SetPVarString
GetPVarString
SetPVarFloat
GetPVarFloat
DeletePVar
GetPVarsUpperIndex
GetPVarNameAtIndex
GetPVarType
SetPlayerChatBubble
PutPlayerInVehicle
GetPlayerVehicleID
GetPlayerVehicleSeat
RemovePlayerFromVehicle
TogglePlayerControllable
PlayerPlaySound
ApplyAnimation
ClearAnimations
GetPlayerAnimationIndex
GetAnimationName
GetPlayerSpecialAction
SetPlayerSpecialAction
SetPlayerCheckpoint
DisablePlayerCheckpoint
SetPlayerRaceCheckpoint
DisablePlayerRaceCheckpoint
SetPlayerWorldBounds
SetPlayerMarkerForPlayer
ShowPlayerNameTagForPlayer
SetPlayerMapIcon
RemovePlayerMapIcon
AllowPlayerTeleport
SetPlayerCameraPos
SetPlayerCameraLookAt
SetCameraBehindPlayer
GetPlayerCameraPos
GetPlayerCameraFrontVector
GetPlayerCameraMode
AttachCameraToObject
AttachCameraToPlayerObject
InterpolateCameraPos
InterpolateCameraLookAt
IsPlayerConnected
IsPlayerInVehicle
IsPlayerInAnyVehicle
IsPlayerInCheckpoint
IsPlayerInRaceCheckpoint
SetPlayerVirtualWorld
GetPlayerVirtualWorld
EnableStuntBonusForPlayer
EnableStuntBonusForAll
TogglePlayerSpectating
PlayerSpectatePlayer
PlayerSpectateVehicle
StartRecordingPlayerData
StopRecordingPlayerData
SelectTextDraw
CancelSelectTextDraw
; a_vehicles.inc
CreateVehicle
DestroyVehicle
IsVehicleStreamedIn
GetVehiclePos
SetVehiclePos
GetVehicleZAngle
GetVehicleRotationQuat
GetVehicleDistanceFromPoint
SetVehicleZAngle
SetVehicleParamsForPlayer
ManualVehicleEngineAndLights
SetVehicleParamsEx
GetVehicleParamsEx
SetVehicleToRespawn
LinkVehicleToInterior
AddVehicleComponent
RemoveVehicleComponent
ChangeVehicleColor
ChangeVehiclePaintjob
SetVehicleHealth
GetVehicleHealth
AttachTrailerToVehicle
DetachTrailerFromVehicle
IsTrailerAttachedToVehicle
GetVehicleTrailer
SetVehicleNumberPlate
GetVehicleModel
GetVehicleComponentInSlot
GetVehicleComponentType
RepairVehicle
GetVehicleVelocity
SetVehicleVelocity
SetVehicleAngularVelocity
GetVehicleDamageStatus
UpdateVehicleDamageStatus
GetVehicleModelInfo
SetVehicleVirtualWorld
GetVehicleVirtualWorld
; a_objects.inc
CreateObject
AttachObjectToVehicle
AttachObjectToObject
AttachObjectToPlayer
SetObjectPos
GetObjectPos
SetObjectRot
GetObjectRot
IsValidObject
DestroyObject
MoveObject
StopObject
IsObjectMoving
EditObject
EditPlayerObject
SelectObject
CancelEdit
CreatePlayerObject
AttachPlayerObjectToVehicle
SetPlayerObjectPos
GetPlayerObjectPos
SetPlayerObjectRot
GetPlayerObjectRot
IsValidPlayerObject
DestroyPlayerObject
MovePlayerObject
StopPlayerObject
IsPlayerObjectMoving
AttachPlayerObjectToPlayer
SetObjectMaterial
SetPlayerObjectMaterial
SetObjectMaterialText
SetPlayerObjectMaterialText

View File

@ -1,61 +0,0 @@
/*
* Author:
* Dietmar Maurer (dietmar@ximian.com)
*
* (C) 2001, 2002, 2003 Ximian, Inc.
*/
#ifndef _MONO_JIT_JIT_H_
#define _MONO_JIT_JIT_H_
#include "../metadata/appdomain.h"
MONO_BEGIN_DECLS
MonoDomain *
mono_jit_init (const char *file);
MonoDomain *
mono_jit_init_version (const char *root_domain_name, const char *runtime_version);
int
mono_jit_exec (MonoDomain *domain, MonoAssembly *assembly,
int argc, char *argv[]);
void
mono_jit_cleanup (MonoDomain *domain);
mono_bool
mono_jit_set_trace_options (const char* options);
void
mono_set_signal_chaining (mono_bool chain_signals);
void
mono_jit_set_aot_only (mono_bool aot_only);
/* Allow embedders to decide wherther to actually obey breakpoint instructions
* in specific methods (works for both break IL instructions and Debugger.Break ()
* method calls).
*/
typedef enum {
/* the default is to always obey the breakpoint */
MONO_BREAK_POLICY_ALWAYS,
/* a nop is inserted instead of a breakpoint */
MONO_BREAK_POLICY_NEVER,
/* the breakpoint is executed only if the program has ben started under
* the debugger (that is if a debugger was attached at the time the method
* was compiled).
*/
MONO_BREAK_POLICY_ON_DBG
} MonoBreakPolicy;
typedef MonoBreakPolicy (*MonoBreakPolicyFunc) (MonoMethod *method);
void mono_set_break_policy (MonoBreakPolicyFunc policy_callback);
void
mono_jit_parse_options (int argc, char * argv[]);
MONO_END_DECLS
#endif

View File

@ -1,218 +0,0 @@
/*
* appdomain.h: AppDomain functions
*
* Author:
* Dietmar Maurer (dietmar@ximian.com)
*
* (C) 2001 Ximian, Inc.
*/
#ifndef _MONO_METADATA_APPDOMAIN_H_
#define _MONO_METADATA_APPDOMAIN_H_
#include "../utils/mono-publib.h"
#include "object.h"
#include "reflection.h"
MONO_BEGIN_DECLS
typedef void (*MonoThreadStartCB) (intptr_t tid, void* stack_start,
void* func);
typedef void (*MonoThreadAttachCB) (intptr_t tid, void* stack_start);
typedef struct _MonoAppDomain MonoAppDomain;
typedef struct _MonoJitInfo MonoJitInfo;
typedef void (*MonoDomainFunc) (MonoDomain *domain, void* user_data);
MonoDomain*
mono_init (const char *filename);
MonoDomain *
mono_init_from_assembly (const char *domain_name, const char *filename);
MonoDomain *
mono_init_version (const char *domain_name, const char *version);
MonoDomain*
mono_get_root_domain (void);
void
mono_runtime_init (MonoDomain *domain, MonoThreadStartCB start_cb,
MonoThreadAttachCB attach_cb);
void
mono_runtime_cleanup (MonoDomain *domain);
void
mono_install_runtime_cleanup (MonoDomainFunc func);
void
mono_runtime_quit (void);
void
mono_runtime_set_shutting_down (void);
mono_bool
mono_runtime_is_shutting_down (void);
const char*
mono_check_corlib_version (void);
MonoDomain *
mono_domain_create (void);
MonoDomain *
mono_domain_create_appdomain (char *friendly_name, char *configuration_file);
MonoDomain *
mono_domain_get (void);
MonoDomain *
mono_domain_get_by_id (int32_t domainid);
int32_t
mono_domain_get_id (MonoDomain *domain);
mono_bool
mono_domain_set (MonoDomain *domain, mono_bool force);
void
mono_domain_set_internal (MonoDomain *domain);
void
mono_domain_unload (MonoDomain *domain);
void
mono_domain_try_unload (MonoDomain *domain, MonoObject **exc);
mono_bool
mono_domain_is_unloading (MonoDomain *domain);
MonoDomain *
mono_domain_from_appdomain (MonoAppDomain *appdomain);
void
mono_domain_foreach (MonoDomainFunc func, void* user_data);
MonoAssembly *
mono_domain_assembly_open (MonoDomain *domain, const char *name);
mono_bool
mono_domain_finalize (MonoDomain *domain, uint32_t timeout);
void
mono_domain_free (MonoDomain *domain, mono_bool force);
mono_bool
mono_domain_has_type_resolve (MonoDomain *domain);
MonoReflectionAssembly *
mono_domain_try_type_resolve (MonoDomain *domain, char *name, MonoObject *tb);
mono_bool
mono_domain_owns_vtable_slot (MonoDomain *domain, void* vtable_slot);
void
mono_context_init (MonoDomain *domain);
void
mono_context_set (MonoAppContext *new_context);
MonoAppContext *
mono_context_get (void);
MonoJitInfo *
mono_jit_info_table_find (MonoDomain *domain, char *addr);
/* MonoJitInfo accessors */
void*
mono_jit_info_get_code_start (MonoJitInfo* ji);
int
mono_jit_info_get_code_size (MonoJitInfo* ji);
MonoMethod*
mono_jit_info_get_method (MonoJitInfo* ji);
MonoImage*
mono_get_corlib (void);
MonoClass*
mono_get_object_class (void);
MonoClass*
mono_get_byte_class (void);
MonoClass*
mono_get_void_class (void);
MonoClass*
mono_get_boolean_class (void);
MonoClass*
mono_get_sbyte_class (void);
MonoClass*
mono_get_int16_class (void);
MonoClass*
mono_get_uint16_class (void);
MonoClass*
mono_get_int32_class (void);
MonoClass*
mono_get_uint32_class (void);
MonoClass*
mono_get_intptr_class (void);
MonoClass*
mono_get_uintptr_class (void);
MonoClass*
mono_get_int64_class (void);
MonoClass*
mono_get_uint64_class (void);
MonoClass*
mono_get_single_class (void);
MonoClass*
mono_get_double_class (void);
MonoClass*
mono_get_char_class (void);
MonoClass*
mono_get_string_class (void);
MonoClass*
mono_get_enum_class (void);
MonoClass*
mono_get_array_class (void);
MonoClass*
mono_get_thread_class (void);
MonoClass*
mono_get_exception_class (void);
void
mono_security_enable_core_clr (void);
typedef mono_bool (*MonoCoreClrPlatformCB) (const char *image_name);
void
mono_security_set_core_clr_platform_callback (MonoCoreClrPlatformCB callback);
MONO_END_DECLS
#endif /* _MONO_METADATA_APPDOMAIN_H_ */

View File

@ -1,111 +0,0 @@
#ifndef _MONONET_METADATA_ASSEMBLY_H_
#define _MONONET_METADATA_ASSEMBLY_H_
#include "image.h"
MONO_BEGIN_DECLS
void mono_assemblies_init (void);
void mono_assemblies_cleanup (void);
MonoAssembly *mono_assembly_open (const char *filename,
MonoImageOpenStatus *status);
MonoAssembly *mono_assembly_open_full (const char *filename,
MonoImageOpenStatus *status,
mono_bool refonly);
MonoAssembly* mono_assembly_load (MonoAssemblyName *aname,
const char *basedir,
MonoImageOpenStatus *status);
MonoAssembly* mono_assembly_load_full (MonoAssemblyName *aname,
const char *basedir,
MonoImageOpenStatus *status,
mono_bool refonly);
MonoAssembly* mono_assembly_load_from (MonoImage *image, const char *fname,
MonoImageOpenStatus *status);
MonoAssembly* mono_assembly_load_from_full (MonoImage *image, const char *fname,
MonoImageOpenStatus *status,
mono_bool refonly);
MonoAssembly* mono_assembly_load_with_partial_name (const char *name, MonoImageOpenStatus *status);
MonoAssembly* mono_assembly_loaded (MonoAssemblyName *aname);
MonoAssembly* mono_assembly_loaded_full (MonoAssemblyName *aname, mono_bool refonly);
void mono_assembly_get_assemblyref (MonoImage *image, int index, MonoAssemblyName *aname);
void mono_assembly_load_reference (MonoImage *image, int index);
void mono_assembly_load_references (MonoImage *image, MonoImageOpenStatus *status);
MonoImage* mono_assembly_load_module (MonoAssembly *assembly, uint32_t idx);
void mono_assembly_close (MonoAssembly *assembly);
void mono_assembly_setrootdir (const char *root_dir);
MONO_CONST_RETURN char *mono_assembly_getrootdir (void);
void mono_assembly_foreach (MonoFunc func, void* user_data);
void mono_assembly_set_main (MonoAssembly *assembly);
MonoAssembly *mono_assembly_get_main (void);
MonoImage *mono_assembly_get_image (MonoAssembly *assembly);
mono_bool mono_assembly_fill_assembly_name (MonoImage *image, MonoAssemblyName *aname);
mono_bool mono_assembly_names_equal (MonoAssemblyName *l, MonoAssemblyName *r);
char* mono_stringify_assembly_name (MonoAssemblyName *aname);
/* Installs a function which is called each time a new assembly is loaded. */
typedef void (*MonoAssemblyLoadFunc) (MonoAssembly *assembly, void* user_data);
void mono_install_assembly_load_hook (MonoAssemblyLoadFunc func, void* user_data);
/*
* Installs a new function which is used to search the list of loaded
* assemblies for a given assembly name.
*/
typedef MonoAssembly *(*MonoAssemblySearchFunc) (MonoAssemblyName *aname, void* user_data);
void mono_install_assembly_search_hook (MonoAssemblySearchFunc func, void* user_data);
void mono_install_assembly_refonly_search_hook (MonoAssemblySearchFunc func, void* user_data);
MonoAssembly* mono_assembly_invoke_search_hook (MonoAssemblyName *aname);
/*
* Installs a new search function which is used as a last resort when loading
* an assembly fails. This could invoke AssemblyResolve events.
*/
void
mono_install_assembly_postload_search_hook (MonoAssemblySearchFunc func, void* user_data);
void
mono_install_assembly_postload_refonly_search_hook (MonoAssemblySearchFunc func, void* user_data);
/* Installs a function which is called before a new assembly is loaded
* The hook are invoked from last hooked to first. If any of them returns
* a non-null value, that will be the value returned in mono_assembly_load */
typedef MonoAssembly * (*MonoAssemblyPreLoadFunc) (MonoAssemblyName *aname,
char **assemblies_path,
void* user_data);
void mono_install_assembly_preload_hook (MonoAssemblyPreLoadFunc func,
void* user_data);
void mono_install_assembly_refonly_preload_hook (MonoAssemblyPreLoadFunc func,
void* user_data);
void mono_assembly_invoke_load_hook (MonoAssembly *ass);
MonoAssemblyName* mono_assembly_name_new (const char *name);
const char* mono_assembly_name_get_name (MonoAssemblyName *aname);
const char* mono_assembly_name_get_culture (MonoAssemblyName *aname);
uint16_t mono_assembly_name_get_version (MonoAssemblyName *aname,
uint16_t *minor, uint16_t *build, uint16_t *revision);
mono_byte* mono_assembly_name_get_pubkeytoken (MonoAssemblyName *aname);
void mono_assembly_name_free (MonoAssemblyName *aname);
typedef struct {
const char *name;
const unsigned char *data;
const unsigned int size;
} MonoBundledAssembly;
void mono_register_bundled_assemblies (const MonoBundledAssembly **assemblies);
void mono_register_config_for_assembly (const char* assembly_name, const char* config_xml);
void mono_register_symfile_for_assembly (const char* assembly_name, const mono_byte *raw_contents, int size);
void mono_register_machine_config (const char *config_xml);
void mono_set_rootdir (void);
void mono_set_dirs (const char *assembly_dir, const char *config_dir);
void mono_set_assemblies_path (const char* path);
MONO_END_DECLS
#endif

View File

@ -1,273 +0,0 @@
/*
* attredefs.h: This file contains the various definitions for constants
* found on the metadata tables
*
* Author:
* Miguel de Icaza (miguel@ximian.com)
* Paolo Molaro (lupus@ximian.com)
*
* (C) 2001 Ximian, Inc.
* (C) 2006 Novell, Inc.
*
* From the ECMA documentation
*/
#ifndef _MONO_METADATA_ATTRDEFS_H_
#define _MONO_METADATA_ATTRDEFS_H_
/*
* 23.1.1 Values for AssemblyHashAlgorithm
*/
enum {
MONO_ASSEMBLY_HASH_NONE,
MONO_ASSEMBLY_HASH_MD5 = 0x8003,
MONO_ASSEMBLY_HASH_SHA1 = 0x8004
};
/*
* 23.1.2 AssemblyRefs
*/
enum {
MONO_ASSEMBLYREF_FULL_PUBLIC_KEY = 0x0001,
MONO_ASSEMBLYREF_RETARGETABLE = 0x0100,
MONO_ASSEMBLYREF_JIT_TRACKING = 0x8000,
MONO_ASSEMBLYREF_NO_JIT_OPT = 0x4000
};
/*
* 23.1.4 Flags for Event.EventAttributes
*/
enum {
MONO_EVENT_SPECIALNAME = 0x0200,
MONO_EVENT_RTSPECIALNAME = 0x0400
};
/*
* Field Attributes (23.1.5).
*/
enum {
MONO_FIELD_ATTR_FIELD_ACCESS_MASK = 0x0007,
MONO_FIELD_ATTR_COMPILER_CONTROLLED = 0x0000,
MONO_FIELD_ATTR_PRIVATE = 0x0001,
MONO_FIELD_ATTR_FAM_AND_ASSEM = 0x0002,
MONO_FIELD_ATTR_ASSEMBLY = 0x0003,
MONO_FIELD_ATTR_FAMILY = 0x0004,
MONO_FIELD_ATTR_FAM_OR_ASSEM = 0x0005,
MONO_FIELD_ATTR_PUBLIC = 0x0006,
MONO_FIELD_ATTR_STATIC = 0x0010,
MONO_FIELD_ATTR_INIT_ONLY = 0x0020,
MONO_FIELD_ATTR_LITERAL = 0x0040,
MONO_FIELD_ATTR_NOT_SERIALIZED = 0x0080,
MONO_FIELD_ATTR_SPECIAL_NAME = 0x0200,
MONO_FIELD_ATTR_PINVOKE_IMPL = 0x2000,
/* For runtime use only */
MONO_FIELD_ATTR_RESERVED_MASK = 0x9500,
MONO_FIELD_ATTR_RT_SPECIAL_NAME = 0x0400,
MONO_FIELD_ATTR_HAS_MARSHAL = 0x1000,
MONO_FIELD_ATTR_HAS_DEFAULT = 0x8000,
MONO_FIELD_ATTR_HAS_RVA = 0x0100
};
/*
* 23.1.6 Flags for FileAttributes
*/
enum {
MONO_FILE_HAS_METADATA = 0,
MONO_FILE_HAS_NO_METADATA = 1
};
/*
* 23.1.7 Flags for generic parameters
*/
enum {
MONO_GEN_PARAM_VARIANCE_MASK = 0x0003,
MONO_GEN_PARAM_NON_VARIANT = 0x0000,
MONO_GEN_PARAM_VARIANT = 0x0001,
MONO_GEN_PARAM_COVARIANT = 0x0002,
MONO_GEN_PARAM_CONSTRAINT_MASK = 0x001c,
MONO_GEN_PARAM_CONSTRAINT_CLASS = 0x0004,
MONO_GEN_PARAM_CONSTRAINT_VTYPE = 0x0008,
MONO_GEN_PARAM_CONSTRAINT_DCTOR = 0x0010
};
/*
* 23.1.8 Flags for ImplMap [PInvokeAttributes]
*/
enum {
MONO_PINVOKE_NO_MANGLE = 0x0001,
MONO_PINVOKE_CHAR_SET_MASK = 0x0006,
MONO_PINVOKE_CHAR_SET_NOT_SPEC = 0x0000,
MONO_PINVOKE_CHAR_SET_ANSI = 0x0002,
MONO_PINVOKE_CHAR_SET_UNICODE = 0x0004,
MONO_PINVOKE_CHAR_SET_AUTO = 0x0006,
MONO_PINVOKE_BEST_FIT_ENABLED = 0x0010,
MONO_PINVOKE_BEST_FIT_DISABLED = 0x0020,
MONO_PINVOKE_BEST_FIT_MASK = 0x0030,
MONO_PINVOKE_SUPPORTS_LAST_ERROR = 0x0040,
MONO_PINVOKE_CALL_CONV_MASK = 0x0700,
MONO_PINVOKE_CALL_CONV_WINAPI = 0x0100,
MONO_PINVOKE_CALL_CONV_CDECL = 0x0200,
MONO_PINVOKE_CALL_CONV_STDCALL = 0x0300,
MONO_PINVOKE_CALL_CONV_THISCALL = 0x0400,
MONO_PINVOKE_CALL_CONV_FASTCALL = 0x0500,
MONO_PINVOKE_THROW_ON_UNMAPPABLE_ENABLED = 0x1000,
MONO_PINVOKE_THROW_ON_UNMAPPABLE_DISABLED = 0x2000,
MONO_PINVOKE_THROW_ON_UNMAPPABLE_MASK = 0x3000,
MONO_PINVOKE_CALL_CONV_GENERIC = 0x0010,
MONO_PINVOKE_CALL_CONV_GENERICINST = 0x000a
};
/*
* 23.1.9 Flags for ManifestResource
*/
enum {
MONO_MANIFEST_RESOURCE_VISIBILITY_MASK = 0x00000007,
MONO_MANIFEST_RESOURCE_PUBLIC = 0x00000001,
MONO_MANIFEST_RESOURCE_PRIVATE = 0x00000002
};
/*
* Method Attributes (23.1.10)
*/
enum {
MONO_METHOD_ATTR_ACCESS_MASK = 0x0007,
MONO_METHOD_ATTR_COMPILER_CONTROLLED = 0x0000,
MONO_METHOD_ATTR_PRIVATE = 0x0001,
MONO_METHOD_ATTR_FAM_AND_ASSEM = 0x0002,
MONO_METHOD_ATTR_ASSEM = 0x0003,
MONO_METHOD_ATTR_FAMILY = 0x0004,
MONO_METHOD_ATTR_FAM_OR_ASSEM = 0x0005,
MONO_METHOD_ATTR_PUBLIC = 0x0006,
MONO_METHOD_ATTR_STATIC = 0x0010,
MONO_METHOD_ATTR_FINAL = 0x0020,
MONO_METHOD_ATTR_VIRTUAL = 0x0040,
MONO_METHOD_ATTR_HIDE_BY_SIG = 0x0080,
MONO_METHOD_ATTR_VTABLE_LAYOUT_MASK = 0x0100,
MONO_METHOD_ATTR_REUSE_SLOT = 0x0000,
MONO_METHOD_ATTR_NEW_SLOT = 0x0100,
MONO_METHOD_ATTR_STRICT = 0x0200,
MONO_METHOD_ATTR_ABSTRACT = 0x0400,
MONO_METHOD_ATTR_SPECIAL_NAME = 0x0800,
MONO_METHOD_ATTR_PINVOKE_IMPL = 0x2000,
MONO_METHOD_ATTR_UNMANAGED_EXPORT = 0x0008,
/*
* For runtime use only
*/
MONO_METHOD_ATTR_RESERVED_MASK = 0xd000,
MONO_METHOD_ATTR_RT_SPECIAL_NAME = 0x1000,
MONO_METHOD_ATTR_HAS_SECURITY = 0x4000,
MONO_METHOD_ATTR_REQUIRE_SEC_OBJECT = 0x8000
};
/*
* Method Impl Attributes (23.1.11)
*/
enum {
MONO_METHOD_IMPL_ATTR_CODE_TYPE_MASK = 0x0003,
MONO_METHOD_IMPL_ATTR_IL = 0x0000,
MONO_METHOD_IMPL_ATTR_NATIVE = 0x0001,
MONO_METHOD_IMPL_ATTR_OPTIL = 0x0002,
MONO_METHOD_IMPL_ATTR_RUNTIME = 0x0003,
MONO_METHOD_IMPL_ATTR_MANAGED_MASK = 0x0004,
MONO_METHOD_IMPL_ATTR_UNMANAGED = 0x0004,
MONO_METHOD_IMPL_ATTR_MANAGED = 0x0000,
MONO_METHOD_IMPL_ATTR_FORWARD_REF = 0x0010,
MONO_METHOD_IMPL_ATTR_PRESERVE_SIG = 0x0080,
MONO_METHOD_IMPL_ATTR_INTERNAL_CALL = 0x1000,
MONO_METHOD_IMPL_ATTR_SYNCHRONIZED = 0x0020,
MONO_METHOD_IMPL_ATTR_NOINLINING = 0x0008,
MONO_METHOD_IMPL_ATTR_NOOPTIMIZATION = 0x0040,
MONO_METHOD_IMPL_ATTR_MAX_METHOD_IMPL_VAL = 0xffff
};
/*
* Method Semantics ([MethodSemanticAttributes]) 23.1.12,
*/
enum {
MONO_METHOD_SEMANTIC_SETTER = 0x0001,
MONO_METHOD_SEMANTIC_GETTER = 0x0002,
MONO_METHOD_SEMANTIC_OTHER = 0x0004,
MONO_METHOD_SEMANTIC_ADD_ON = 0x0008,
MONO_METHOD_SEMANTIC_REMOVE_ON = 0x0010,
MONO_METHOD_SEMANTIC_FIRE = 0x0020
};
/*
* Flags for Params (23.1.13)
*/
enum {
MONO_PARAM_ATTR_IN = 0x0001,
MONO_PARAM_ATTR_OUT = 0x0002,
MONO_PARAM_ATTR_OPTIONAL = 0x0010,
MONO_PARAM_ATTR_RESERVED_MASK = 0xf000,
MONO_PARAM_ATTR_HAS_DEFAULT = 0x1000,
MONO_PARAM_ATTR_HAS_MARSHAL = 0x2000,
MONO_PARAM_ATTR_UNUSED = 0xcfe0
};
/*
* 23.1.14 PropertyAttributes
*/
enum {
MONO_PROPERTY_ATTR_SPECIAL_NAME = 0x0200,
MONO_PROPERTY_ATTR_RESERVED_MASK = 0xf400,
MONO_PROPERTY_ATTR_RT_SPECIAL_NAME = 0x0400,
MONO_PROPERTY_ATTR_HAS_DEFAULT = 0x1000,
MONO_PROPERTY_ATTR_UNUSED = 0xe9ff
};
/*
* Type Attributes (23.1.15).
*/
enum {
MONO_TYPE_ATTR_VISIBILITY_MASK = 0x00000007,
MONO_TYPE_ATTR_NOT_PUBLIC = 0x00000000,
MONO_TYPE_ATTR_PUBLIC = 0x00000001,
MONO_TYPE_ATTR_NESTED_PUBLIC = 0x00000002,
MONO_TYPE_ATTR_NESTED_PRIVATE = 0x00000003,
MONO_TYPE_ATTR_NESTED_FAMILY = 0x00000004,
MONO_TYPE_ATTR_NESTED_ASSEMBLY = 0x00000005,
MONO_TYPE_ATTR_NESTED_FAM_AND_ASSEM = 0x00000006,
MONO_TYPE_ATTR_NESTED_FAM_OR_ASSEM = 0x00000007,
MONO_TYPE_ATTR_LAYOUT_MASK = 0x00000018,
MONO_TYPE_ATTR_AUTO_LAYOUT = 0x00000000,
MONO_TYPE_ATTR_SEQUENTIAL_LAYOUT = 0x00000008,
MONO_TYPE_ATTR_EXPLICIT_LAYOUT = 0x00000010,
MONO_TYPE_ATTR_CLASS_SEMANTIC_MASK = 0x00000020,
MONO_TYPE_ATTR_CLASS = 0x00000000,
MONO_TYPE_ATTR_INTERFACE = 0x00000020,
MONO_TYPE_ATTR_ABSTRACT = 0x00000080,
MONO_TYPE_ATTR_SEALED = 0x00000100,
MONO_TYPE_ATTR_SPECIAL_NAME = 0x00000400,
MONO_TYPE_ATTR_IMPORT = 0x00001000,
MONO_TYPE_ATTR_SERIALIZABLE = 0x00002000,
MONO_TYPE_ATTR_STRING_FORMAT_MASK = 0x00030000,
MONO_TYPE_ATTR_ANSI_CLASS = 0x00000000,
MONO_TYPE_ATTR_UNICODE_CLASS = 0x00010000,
MONO_TYPE_ATTR_AUTO_CLASS = 0x00020000,
MONO_TYPE_ATTR_CUSTOM_CLASS = 0x00030000,
MONO_TYPE_ATTR_CUSTOM_MASK = 0x00c00000,
MONO_TYPE_ATTR_BEFORE_FIELD_INIT = 0x00100000,
MONO_TYPE_ATTR_FORWARDER = 0x00200000,
MONO_TYPE_ATTR_RESERVED_MASK = 0x00040800,
MONO_TYPE_ATTR_RT_SPECIAL_NAME = 0x00000800,
MONO_TYPE_ATTR_HAS_SECURITY = 0x00040000
};
#endif

View File

@ -1,105 +0,0 @@
/*
* blob.h: Definitions used to pull information out of the Blob
*
*/
#ifndef _MONO_METADATA_BLOB_H_
#define _MONO_METADATA_BLOB_H_
/*
* Encoding for type signatures used in the Metadata
*/
typedef enum {
MONO_TYPE_END = 0x00, /* End of List */
MONO_TYPE_VOID = 0x01,
MONO_TYPE_BOOLEAN = 0x02,
MONO_TYPE_CHAR = 0x03,
MONO_TYPE_I1 = 0x04,
MONO_TYPE_U1 = 0x05,
MONO_TYPE_I2 = 0x06,
MONO_TYPE_U2 = 0x07,
MONO_TYPE_I4 = 0x08,
MONO_TYPE_U4 = 0x09,
MONO_TYPE_I8 = 0x0a,
MONO_TYPE_U8 = 0x0b,
MONO_TYPE_R4 = 0x0c,
MONO_TYPE_R8 = 0x0d,
MONO_TYPE_STRING = 0x0e,
MONO_TYPE_PTR = 0x0f, /* arg: <type> token */
MONO_TYPE_BYREF = 0x10, /* arg: <type> token */
MONO_TYPE_VALUETYPE = 0x11, /* arg: <type> token */
MONO_TYPE_CLASS = 0x12, /* arg: <type> token */
MONO_TYPE_VAR = 0x13, /* number */
MONO_TYPE_ARRAY = 0x14, /* type, rank, boundsCount, bound1, loCount, lo1 */
MONO_TYPE_GENERICINST= 0x15, /* <type> <type-arg-count> <type-1> \x{2026} <type-n> */
MONO_TYPE_TYPEDBYREF = 0x16,
MONO_TYPE_I = 0x18,
MONO_TYPE_U = 0x19,
MONO_TYPE_FNPTR = 0x1b, /* arg: full method signature */
MONO_TYPE_OBJECT = 0x1c,
MONO_TYPE_SZARRAY = 0x1d, /* 0-based one-dim-array */
MONO_TYPE_MVAR = 0x1e, /* number */
MONO_TYPE_CMOD_REQD = 0x1f, /* arg: typedef or typeref token */
MONO_TYPE_CMOD_OPT = 0x20, /* optional arg: typedef or typref token */
MONO_TYPE_INTERNAL = 0x21, /* CLR internal type */
MONO_TYPE_MODIFIER = 0x40, /* Or with the following types */
MONO_TYPE_SENTINEL = 0x41, /* Sentinel for varargs method signature */
MONO_TYPE_PINNED = 0x45, /* Local var that points to pinned object */
MONO_TYPE_ENUM = 0x55 /* an enumeration */
} MonoTypeEnum;
typedef enum {
MONO_TABLE_MODULE,
MONO_TABLE_TYPEREF,
MONO_TABLE_TYPEDEF,
MONO_TABLE_FIELD_POINTER,
MONO_TABLE_FIELD,
MONO_TABLE_METHOD_POINTER,
MONO_TABLE_METHOD,
MONO_TABLE_PARAM_POINTER,
MONO_TABLE_PARAM,
MONO_TABLE_INTERFACEIMPL,
MONO_TABLE_MEMBERREF, /* 0xa */
MONO_TABLE_CONSTANT,
MONO_TABLE_CUSTOMATTRIBUTE,
MONO_TABLE_FIELDMARSHAL,
MONO_TABLE_DECLSECURITY,
MONO_TABLE_CLASSLAYOUT,
MONO_TABLE_FIELDLAYOUT, /* 0x10 */
MONO_TABLE_STANDALONESIG,
MONO_TABLE_EVENTMAP,
MONO_TABLE_EVENT_POINTER,
MONO_TABLE_EVENT,
MONO_TABLE_PROPERTYMAP,
MONO_TABLE_PROPERTY_POINTER,
MONO_TABLE_PROPERTY,
MONO_TABLE_METHODSEMANTICS,
MONO_TABLE_METHODIMPL,
MONO_TABLE_MODULEREF, /* 0x1a */
MONO_TABLE_TYPESPEC,
MONO_TABLE_IMPLMAP,
MONO_TABLE_FIELDRVA,
MONO_TABLE_UNUSED6,
MONO_TABLE_UNUSED7,
MONO_TABLE_ASSEMBLY, /* 0x20 */
MONO_TABLE_ASSEMBLYPROCESSOR,
MONO_TABLE_ASSEMBLYOS,
MONO_TABLE_ASSEMBLYREF,
MONO_TABLE_ASSEMBLYREFPROCESSOR,
MONO_TABLE_ASSEMBLYREFOS,
MONO_TABLE_FILE,
MONO_TABLE_EXPORTEDTYPE,
MONO_TABLE_MANIFESTRESOURCE,
MONO_TABLE_NESTEDCLASS,
MONO_TABLE_GENERICPARAM, /* 0x2a */
MONO_TABLE_METHODSPEC,
MONO_TABLE_GENERICPARAMCONSTRAINT
#define MONO_TABLE_LAST MONO_TABLE_GENERICPARAMCONSTRAINT
#define MONO_TABLE_NUM (MONO_TABLE_LAST + 1)
} MonoMetaTableEnum;
#endif

Some files were not shown because too many files have changed in this diff Show More