mskamilor

Double rcon

Dec 27th, 2011
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. /* wenn ihr euer server mit diesen Script startet wird eine datei in Scriptfiles ordner erstellt
  2. wo ihr das passwort eandern koennt
  3.  
  4. ==Copyright==
  5. <<<mskamilor>>>
  6.  
  7. */
  8.  
  9. #include a_samp
  10.  
  11. #define DIALOG_RCON_ATTEMPT 24029
  12. #define FILE_RCON_PASSWORD "RconAttempt.ini"
  13.  
  14. public OnFilterScriptInit()
  15. {
  16. if(!fexist(FILE_RCON_PASSWORD))
  17. {
  18. new File:xqz=fopen(FILE_RCON_PASSWORD,io_write);
  19. fwrite(xqz,"bitte schreibe das passwort hier rein ");
  20. fclose(xqz);
  21. }
  22. return 1;
  23. }
  24.  
  25. public OnRconLoginAttempt(ip[], password[], success)
  26. {
  27. if(success)
  28. {
  29. new pip[16];
  30. for(new i=0; i<MAX_PLAYERS; i++)
  31. {
  32. GetPlayerIp(i, pip, sizeof(pip));
  33. if(!strcmp(ip, pip, true))
  34. {
  35. ShowPlayerDialog(i,DIALOG_RCON_ATTEMPT,DIALOG_STYLE_INPUT,"Rcon","du bist als Rcon Admin eingelogt, jedoch muss du ein zweites passwort eingeben\n wenn du es nicht machst wirst du gebannt!\n\n{FFFFFF}Zweites Rcon passwort:","Einlogen","");
  36. break;
  37. }
  38. }
  39. }
  40. return 1;
  41. }
  42.  
  43. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  44. {
  45. if(dialogid == DIALOG_RCON_ATTEMPT && response)
  46. {
  47. if(!strlen(inputtext)) return ShowPlayerDialog(playerid,DIALOG_RCON_ATTEMPT,DIALOG_STYLE_INPUT,"Rcon","du bist als Rcon Admin eingelogt, jedoch muss du ein zweites passwort eingeben\n wenn du es nicht machst wirst du gebannt!\n\n{FFFFFF}Zweites Rcon passwort:","Einlogen","");
  48. new File:ohp=fopen(FILE_RCON_PASSWORD,io_read);
  49. new string[24];
  50. fread(ohp,string);
  51. if(strcmp(inputtext,string,true) != 0) Ban(playerid); else SendClientMessage(playerid,-1,"das zweite rcon passwort ist richtig!!");
  52. fclose(ohp);
  53. return 1;
  54. }
  55. return 0;
  56. }
Advertisement
Add Comment
Please, Sign In to add comment