SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 08/07/2020, 08:18 PM   #1
brauf
Little Clucker
 
brauf's Avatar
 
Join Date: Jul 2018
Location: i live in narnia city Savage: 100%
Posts: 37
Reputation: 29
Default uuid.inc

uuid.inc v1a

Info

What's UUID?
"It's an identification number that will uniquely identify something. The idea being that id number will be universally unique."
However, I doubt pawns random function could make it as unique...
Although there is a plugin available that does this properly - I just wanted to implement it in Pawn. It gives a valid UUIDv4.

Example:
f8fe4b96-8242-439a-ad70-498a0df55e89

Disclaimer:
* it's not tested to an extent, maybe it could clash after a thousand/million/billion/trillion tries, maybe not?
* please read the notes in the script for more information


Link




Usage

* Drop uuid.inc in includes folder and #include <uuid> in your gamemode

PHP Code:
main()
{
    new 
string[UUID_MAX_LEN];

    
UUIDv4(string);

    
printf("%s"string);

Updates
--------------------------------------------------------------------------------------------------------
Update: 1a
* Released
* function: UUIDv4(string[], sz = sizeof string)
--------------------------------------------------------------------------------------------------------
brauf is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 03:07 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.