Dayrion

/trouvernom

Sep 29th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.07 KB | None | 0 0
  1. CMD:trouvernom(playerid, params[])
  2. {
  3.     /*  » pAccount[][pScore] à changer par la variable permettant de savoir le numéro du joueur.
  4.         » Les SendClientMessage sont à changer par ceux du serveur.
  5.     */
  6.     if(!IsPlayerAdmin(playerid)) // À changer par la variable qui permet de voir si le joueur est un FDL ou non.
  7.         return SCM(playerid, -1, "Vous n'êtes pas autorisé à utiliser cette commande.")
  8.  
  9.     new numero,
  10.         a;
  11.  
  12.     if(sscanf(params, "i", numero)) return SCM(playerid, -1, "[Usage]{BFC0C2} /trouvernom [numero]");
  13.  
  14.     foreach(new i : Player)
  15.     {
  16.         if(pAccount[i][pScore] != numero)
  17.             continue;
  18.         a++;
  19.         SCMF(playerid, -1, "%s correspond au numéro %i.", GetName(i), pAccount[i][pScore]);
  20.     }
  21.  
  22. /* -> Sans foreach
  23.     for(new i; i < GetPlayerPoolSize(); i ++)
  24.     {
  25.         if(!IsPlayerConnected(i))
  26.             continue;
  27.  
  28.         if(pAccount[i][pScore] != numero)
  29.             continue;
  30.         a++;
  31.         SCMF(playerid, -1, "%s correspond au numéro %i.", GetName(i), pAccount[i][pScore]);
  32.     }
  33. */
  34.  
  35.     if(a == 0)
  36.         return SCM(playerid, -1, "Personne ne porte se numéro de téléphone.");
  37.     else
  38.         return 1;
  39. }
Add Comment
Please, Sign In to add comment