Gpci

From SA-MP Wiki

Jump to: navigation, search

gpci

Image:Farm-Fresh text lowercase.png Note: This function name starts with a lowercase letter.


Description:

Fetch the CI of a user, this is linked to their SAMP/GTA on their computer.


Parameters:
(playerid, string[], length)
playeridThe ID of the player to fetch their CI.
string[]String to store the fetched CI in.
lengthAssigned size of the string, should use sizeof()


Return Values:

The length of the stored string. 0 if player specified doesn't exist.


Image:32px-Circle-style-warning.png

Important
Notes

  • A player's CI is NOT UNIQUE, some players may have similar or the same CI, don't ban solely due to a CI match.
  • You must add native gpci(playerid, serial[], len); at the top of your script before using any CI functions.
  • The string returned by this function is usually 40 characters long, but could be shorter.


Image:32px-Ambox_warning_orange.png

Notes

  • It is a non-reversible (lossy) hash derived from information about your San Andreas installation path.
  • It is not a unique ID.
  • It was added to assist owners of large servers who deal with constant attacks from cheaters and botters.


Example Usage:

#if !defined gpci
    native gpci(playerid, serial[], len);
#endif
 
new szSerial[41]; // 40 + \0
 
gpci(iPlayerID, szSerial, sizeof(szSerial));
return szSerial;
Tip

Image:Light_bulb_icon.png

This function may come in handy to easily get someone's CI


Example Usage:

ReturnCI(iPlayerID)
{
    new 
        szSerial[41]; // 40 + \0
 
    gpci(iPlayerID, szSerial, sizeof(szSerial));
    return szSerial;
}

Related Functions

The following functions may be helpful as they relate to this function in one way or another.

  • GetNetworkStats: Gets the servers networkstats and saves it into a string.
Navigation