Useful Functions (uf.inc)

Here you can find useful functions for your pawno scripts. They are mostly copied from an older version of the useful functions topic on the SA-MP Forums, these can all be implemented with the Useful Functions include file.

This function allows you to encrypt strings, very useful for storing passwords without fear of someone cracking them

Parameters:

(string[])

string[]

The string you want to encrypt

Return Values:

The encrypted string

encrypt("User Password");

Note: This function requires you to set a unique key to use with it. This is so no-one elses use of the function generates the same hashes as you. This key must contain ALL the letters and digits you want to make valid in a password or it will produce wierd results. They don't have to be listed only once but must be listed at least once, in any random order. The location of the key is clearly documented within the function. Don't change your key or no-one will be able to log in.

Returns the distance between the player and the car as an integer (Note: This doesnt fully work properly due to the GetVehiclePos not working properly, instead it will give you the distance to the car spawn)