Advertisement
Guest User

OnGameModeInit

a guest
Mar 17th, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. public OnGameModeInit()
  2. {
  3. UsePlayerPedAnims();
  4.  
  5. SetTimer("ChangeServerName", 1000, 1);
  6. new oldtime = GetTickCount();
  7. AntiDeAMX();
  8. mysql_debug(0);
  9. print(" ... GamemodeInit");
  10. GetServerVarAsString("bind",GlobalString,sizeof(GlobalString));
  11. if(!GlobalString[0] || strcmp(GlobalString,BINDIP,false))
  12. {
  13. printf("SERVER: Der Server ist nicht auf der IP '%s' gebinded!",BINDIP);
  14. print(" Server wird heruntergefahren ...");
  15. SendRconCommand("exit");
  16. return 1;
  17. }
  18. MySqlConnection = mysql_connect(SQL_HOST,SQL_USER,SQL_DATA,SQL_PASS);
  19. if(mysql_ping() == 1)
  20. {
  21. print("SERVER: Verbindung zur Datenbank wurde erfolgreich hergestellt.");
  22. printf("Host: %s,User: %s,Datanbank: %s,Passwort: %s",SQL_HOST,SQL_USER,SQL_DATA,SQL_PASS);
  23. }
  24. else
  25. {
  26. print("SERVER: Es konnte keine Verbindung zur Datenbank hergestellt werden!");
  27. print(" Es wird erneut versucht eine Verbindung zur Datenbank herzustellen.");
  28. printf("Host: %s,User: %s,Datanbank: %s,Passwort: %s",SQL_HOST,SQL_USER,SQL_DATA,SQL_PASS);
  29. MySqlConnection = mysql_connect(SQL_HOST,SQL_USER,SQL_DATA,SQL_PASS);
  30. if(mysql_ping() == 1)
  31. {
  32. print("SERVER: Es konnte im 2 Versuch eine Verbindung hergestellt werden!");
  33. printf("Host: %s,User: %s,Datanbank: %s,Passwort: %s",SQL_HOST,SQL_USER,SQL_DATA,SQL_PASS);
  34. }
  35. else
  36. {
  37. print("SERVER: Es konnte keine Verbindung zur Datenbank hergestellt werden!");
  38. print(" Server wird heruntergefahren ...");
  39. SendRconCommand("exit");
  40. return 1;
  41. }
  42. }
  43. CreateTables();
  44. SendRconCommand("hostname "#HOST"");
  45. SendRconCommand("gamemodetext "#SERVERVERSION"");
  46. SendRconCommand("mapname "#MAPVERSION"");
  47. SendRconCommand("weburl "#WEBURL"");
  48. SendRconCommand("maxnpc "#MAXNPC"");
  49. ManualVehicleEngineAndLights();
  50. DisableInteriorEnterExits();
  51. EnableStuntBonusForAll(0);
  52. LimitGlobalChatRadius(0);
  53. ShowNameTags(1);
  54. ShowPlayerMarkers(0);
  55. AllowInteriorWeapons(1);
  56. SetNameTagDrawDistance(MAX_STREAM_NAME_DISTANCE);
  57. AddPlayerClass(1,1833.8286,-1683.4785,13.4570,83.7825,0,0,0,0,0,0);
  58. WeatherChange();
  59. ResetElevatorQueue();
  60. Elevator_Initialize();
  61. RaceStarted = -1;
  62. RaceCarType = 0;
  63. RaceMaxCps = 0;
  64. lchataktiv = true;
  65. RaceWinner = 0;
  66. registration = false;
  67. login = false;
  68. GeneratedKey = 100000 + random(50000);
  69. BombState = false;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement