/**--------------------------------------------------------------------------**\ ====================================== y_classes - Advanced class selection ====================================== Description: Allows greater control over classes so not everyone has every class. Uses a form of compression for locations. Legal: Version: MPL 1.1 The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. The Original Code is the YSI classes include. The Initial Developer of the Original Code is Alex "Y_Less" Cole. Portions created by the Initial Developer are Copyright (C) 2011 the Initial Developer. All Rights Reserved. Contributors: ZeeX, koolk, JoeBullet/Google63, g_aSlice/Slice Thanks: JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL. ZeeX - Very productive conversations. koolk - IsPlayerinAreaEx code. TheAlpha - Danish translation. breadfish - German translation. Fireburn - Dutch translation. yom - French translation. 50p - Polish translation. Zamaroht - Spanish translation. Dracoblue, sintax, mabako, Xtreme, other coders - Producing other modes for me to strive to better. Pixels^ - Running XScripters where the idea was born. Matite - Pestering me to release it and using it. Very special thanks to: Thiadmer - PAWN, whose limits continue to amaze me! Kye/Kalcor - SA:MP. SA:MP Team past, present and future - SA:MP. Version: 0.1 Changelog: 14/04/12: Readded OnRequestSpawn logic. Fixed Class_AddWithGroupSet. Improved GM/FS interaction. 02/01/08: First '08 edit - Fixed minus numbers in spawn points. 18/11/07: Improved location compression to allow larger areas. Moved position code to Class_OnPlayerSpawn to reduce overhead. 10/10/07: Fixed spawn data problem. 31/08/07: Added cheap master system - YSI_SLAVE_CLASSs can't be master. 05/08/07: Fixed a few bugs with repeated selection. 04/08/07: First version. Functions: Public: Class_AddRemote - Adds a class to the remote master. Class_Remote - Updates settings remotely. Core: Class_Class - Sets up the system. Class_OnPlayerRequestSpawn - Called when a player requests a spawn. Class_OnPlayerRequestClass - Called when a player requests a class. Class_OnPlayerConnect - Called when a player connects. Stock: Class_Delete - Removes a class. Class_SetPlayer - Sets whether or not a player can use a class. Class_Disable - Disables a class. Class_Enable - Enables a disabled class. Class_AddForGroup - Adds a class to the system for only one group. Class_Add - Adds a class to the system. Class_AddEx - Adds a class to the system with group selection and setting. Class_AddWithGroupSet - Adds a class and sets their group on selection. Class_AllowReselection - Allows or disallows people to return to reselect a class. Class_RequireSpawnLogin - Require people to login before spawning. Class_RequireSelectionLogin - Require people to login before selecting. Class_RequireSelectionReg - Require people to register before selecting. Class_RequireSpawnReg - Require people to register before spawning. Static: Class_AddClass - Adds a class, wrapped by API and remote functions. Inline: Class_IsActive - Checks a class is active. Class_Enabled - Checks a class is enabled. Class_IsValid - Checks a class is valid. Class_X - Gets a classes x position. Class_Y - Gets a classes y position. Class_Z - Gets a classes z position. Class_A - Gets a classes angle. Class_Skin - Gets a classes skin. API: - Callbacks: - Definitions: MAX_CLASSES - Maximum number of classes storeable by the system. CLASS_LEFT - Flag for last internal class viewed. CLASS_MIDDLE - Flag for last internal class viewed. CLASS_RIGHT - Flag for last internal class viewed. Enums: e_CLASS_FLAGS - Small data for individual classes. E_CLASS - Class data structure. Macros: - Tags: - Variables: Global: - Static: YSI_g_sClasses - Data for classes. YSI_g_sPlayerClass - Player's current classes. YSI_g_sLeft - Handle for the first internal class. YSI_g_sMiddle - Handle for the second internal class. YSI_g_sRight - Handle for the third internal class. YSI_g_sClassCount - Number of classes stored. Commands: - Compile options: - Operators: - \**--------------------------------------------------------------------------**/ #if defined _INC_y_classes #endinput #endif #define _INC_y_classes stock _YSI_HAS_y_classes(_do_not_call_me_ever_, _like_never_) { P:E("You called _YSI_HAS_y_classes! Bad, don't do that!", _do_not_call_me_ever_, _like_never_); assert(false); return 0; } #include "..\YSI_Internal\y_version" #if !defined MAX_CLASSES #define MAX_CLASSES (512) #endif #if !defined MAX_CLASS_SPAWN_WEAPONS #define MAX_CLASS_SPAWN_WEAPONS (13) #endif #if !defined WEAPON_ARMOUR #define WEAPON_ARMOUR (100) #endif #define INFINATE_ARMOUR (0x00800000) #define MASTER 61 #define YSIM_U_DISABLE #include "..\YSI_Core\y_master" #include "..\YSI_Data\y_bit" #include "..\YSI_Core\y_debug" #include "..\YSI_Data\y_iterate" #include "..\YSI_Data\y_playerarray" #include "..\YSI_Data\y_iterate" #include "..\YSI_Internal\y_natives" #define _GROUP_MAKE_NAME<%0...%1> %0Class%1 #define _GROUP_MAKE_LIMIT MAX_CLASSES #include "..\YSI_Players\y_groups\_funcs" //#include "..\YSI_Players\y_groups\y_classes" #include "..\YSI_Coding\y_hooks" #include "y_classes/classcontrol" #include "..\YSI_Coding\y_hooks" #include "y_classes/multiclass" #if defined YSI_TESTS #include "..\YSI_Core\y_testing" #include "y_classes/tests" #endif // Reset. #undef _GROUP_MAKE_LIMIT #undef _GROUP_MAKE_NAME #include "..\YSI_Core\y_master"