Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define rot 0xFF6347AA
- #define blau 0x33CCFFAA
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new idx; //falls es noch nicht im Script vorhanden ist
- if(strcmp(cmdtext, "/changepw", true) == 0)
- {
- new length = strlen(cmdtext);
- while ((idx < length) && (cmdtext[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[64];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = cmdtext[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- if(!strlen(result))
- {
- SendClientMessage(playerid, rot, "Benutzung: /changepw [neues passwort]");
- return 1;
- }
- new string[128], str[128];
- format(string, sizeof(string),"%s",result);
- strmid(PlayerInfo[playerid][pKey], result, 0, strlen(result), 255);
- OnPlayerUpdate(playerid);
- format(str, sizeof(str),"Du hast dein Passwort erfolgreich geändert es lautet nun: {FFFFFF}%s",result);
- SendClientMessage(playerid, blau, str);
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement