Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*----------------------------------------------------------------------------*\
- =================================
- Y Sever Includes - Misc Functions
- =================================
- Description:
- Misc functions used throughout.
- 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 utils 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.3
- Changelog:
- 22/12/11:
- Changed "ceildiv" to only evaluate arguments once.
- 05/12/11:
- Added NO_VALUE to test if macros have no value.
- 08/09/10:
- Added strcpy and StripNL.
- 08/08/10:
- Scrapped almost everything. Only VERY usefult things go in now.
- Functions:
- Stock:
- StripNL - Strips the newline characters from the end of a string.
- Inline:
- iseven - Checks if a number is even.
- isodd - Checks if a number is odd.
- isnull - Checks if a string is NULL ("\1\0").
- strcpy - Copy one string to another.
- Variables:
- Global:
- TRUE - True hack for infinate loops.
- FALSE - False hack for one-time loops.
- NULL - 1 long string for passing via Call(Remote|Local)Function.
- \*----------------------------------------------------------------------------*/
- #include "internal\y_version"
- #include "y_debug"
- #include "y_amx"
- //#tryinclude <sscanf>
- /*// "File,Float," must remain last always.
- #if defined CUSTOM_TAG_TYPES
- #define File,Float, Float,File,CUSTOM_TAG_TYPES
- #else
- #define File,Float, Float,File
- #endif*/
- // Add new tags to the START of this list.
- #include "internal\y_globaltags"
- // VERY VERY VERY IMPORTANT!!! y_inline uses "130" instead of "YSI_MAX_STRING"
- // for two lines (one is "520" for "130 * 4").
- #define YSI_MAX_STRING (130)
- #define FUNCTION_LENGTH (32)
- #define NO_VALUE(%0) ((2*%0-1+1)==-1)
- #if !defined NULL
- new stock
- NULL[2] = {1, 0};
- #endif
- // Define "volatile" as nothing.
- #if !defined volatile
- #define volatile
- #endif
- #define YSIM_MASTER #M
- #define YSIM_RETURN #R
- #define YSIM_CALLER #C
- //#pragma unused TRUE, FALSE, NULL
- #define ceildiv(%0,%1) \
- (((%0)-1)/(%1)+1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement