02.07.2012, 16:21
(
Последний раз редактировалось KingHual; 03.10.2012 в 11:14.
)
Random Functions V1
Introduction
Hello, this is a set of 11 random functions. And by random, I mean REALLY random - even more random than the things Logitech90 posts. I was bored today, and I thought "I haven't released something on the SA:MP forums in like... 5 months", so I thought I'd strike again. These functions are really not advanced, but still, I thought I'd release them.
The Functions
- RotationToPoint(int playerid,double x, double y)
Description: Gets the required rotation of a player towards a point.- int playerid - The PlayerID of the player whose rotation you want to get
- double x - The X (horizontal) location on the map of the point
- double y - The Y (vertical) location on the map of the point
- RotationToPlayer(int playerid,int playerid2)
Description: Gets the required rotation of a player towards another player.- int playerid - The PlayerID of the player whose rotation you want to get
- int playerid2 - The PlayerID of the player whose co-ordinates you want to get the rotation to
- RotationToVehicle(int playerid,int vehid)
Description: Gets the required rotation of a player towards a vehicle.- int playerid - The PlayerID of the player whose rotation you want to get
- int vehid- The ID of the vehicle whose co-ordinates you want to get the rotation to
- strrev(const string[],int len)
Description: Reverses the specified string- const string[]- The string that will be reversed
- int len - The lenght of the string that will be reversed. Specifying a lower value may trim the string
- substr(const string[],int index,int len)
Description: Returns the portion of a string, specified by the index and len parameters.- const string[]- The string that will be reversed
- int index - The starting index of the portion in the string
- int len - The lenght of the portion
- FormatInt(int number, char delimiter)
Description: Formats a number using the specified delimiter- int number - The number which will be formatted Note: The number should not exceed 9 characters
- char delimiter - The ascii character that will be used in the formatting
- fRandom(double max)
Description: Generates a random double number/float between 0 and a value- double/float max - The highest possible number
- fRandomEx(double min,double max)
Description: Generates a random double number/float between two values- double/float min - The lowest possible number
- double/float max - The highest possible number
- RandomEx(int min,int max)
Description: Generates a random double number/float between two values- int min - The lowest possible number
- int max - The highest possible number
- IsPlayerSwimming(int playerid)
Description: Checks if a player is currently swimming- int playerid - The ID of the player whose state you want to check
- IsPlayerFalling(int playerid)
Description: Checks if a player is currently falling- int playerid - The ID of the player whose state you want to check
The installation is simple - Just download the file and put it in your "ServerFolder/pawno/include". Then, in your scripts, use #include <hfunc>
Downloads
Pastebin.com
Uploading.com
Mirrors are welcome