Advertisement
Guest User

Passwort Changer für GF

a guest
Mar 15th, 2012
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.00 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define rot 0xFF6347AA
  4. #define blau 0x33CCFFAA
  5.  
  6. public OnPlayerCommandText(playerid, cmdtext[])
  7. {
  8.     new idx; //falls es noch nicht im Script vorhanden ist
  9.     if(strcmp(cmdtext, "/changepw", true) == 0)
  10.     {
  11.         new length = strlen(cmdtext);
  12.         while ((idx < length) && (cmdtext[idx] <= ' '))
  13.         {
  14.             idx++;
  15.         }
  16.         new offset = idx;
  17.         new result[64];
  18.         while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  19.         {
  20.             result[idx - offset] = cmdtext[idx];
  21.             idx++;
  22.         }
  23.         result[idx - offset] = EOS;
  24.         if(!strlen(result))
  25.         {
  26.             SendClientMessage(playerid, rot, "Benutzung: /changepw [neues passwort]");
  27.             return 1;
  28.         }
  29.         new string[128], str[128];
  30.         format(string, sizeof(string),"%s",result);
  31.         strmid(PlayerInfo[playerid][pKey], result, 0, strlen(result), 255);
  32.         OnPlayerUpdate(playerid);
  33.         format(str, sizeof(str),"Du hast dein Passwort erfolgreich geändert es lautet nun: {FFFFFF}%s",result);
  34.         SendClientMessage(playerid, blau, str);
  35.         return 1;
  36.     }
  37.     return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement