GetPlayerNetworkStats FR

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search

Revision as of 12:33, 28 January 2014



Cette fonction a été ajoutée dans SA-MP 0.3c R4 et n'est pas utilisable dans les versions antérieures!


Description:

Récupère les statistiques de réseau d'un joueur et les sauvegardes dans une chaîne.


Image:32px-Ambox_warning_orange.png

Note

According to JernejL (a SA-MP beta tester), this function will not always return accurate data when used in OnPlayerDisconnect and data returned in OnPlayerDisconnect is usually only correct if the player was kicked or timed out (if the player quits the game normally, data returned may not be accurate).


Paramètres:
(playerid, retstr[], retstr_size)
playeridThe ID of the player you want to get the networkstats of.
retstr[]The string to store the networkstats in, passed by reference.
retstr_sizeThe length of the string that should be stored.


public OnPlayerCommandText(playerid,cmdtext[])
{    
    if(!strcmp(cmdtext, "/monreseau"))
    {
        new stats[400+1];
        GetPlayerNetworkStats(playerid, stats, sizeof(stats)); // Récupère ses stats personnels
        ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Mes statistiques de réseau", stats, "Okay", "");
    }
    return 1;
}

Fonctions Relatives

Les fonctions suivantes peuvent être utiles car elles sont indirectement ou directement liées a cette fonction.

  • GetNetworkStats: Récupère les statistiques de réseau et les sauvegardes dans une chaîne.