ARSEnic69

Main.nuts

Dec 20th, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. class Server{
  2. RegisterFunc = ["StartChallenge"]
  3. }
  4.  
  5. local ChallengeCount = 0;
  6. local ClientSphere = array(128);
  7. local ClientBlip = array(128);
  8. function onScriptLoad(){
  9. print("Hello rod")
  10. foreach(ToRegister in Server.RegisterFunc){
  11. RegisterRemoteFunc(ToRegister);
  12. }
  13. LoadModule("lu_ini")
  14. ChallengeCount = ReadIniInteger("Server/Data.ini", "Data", "Count");;
  15.  
  16. }
  17. function onPlayerJoin(pPlayer){
  18. CallClientFunc(pPlayer, "Main/Client.nut", "SetChallengeCount", ChallengeCount)
  19. Message("ss")
  20. }
  21. function onPlayerCommand(pPlayer, Command, Params){
  22. if(Command == "pos")Message(pPlayer.Pos+"")
  23. }
  24. function onPlayerSpawn(pPlayer, Spawn){
  25. local Runway = Random(1,2)
  26. if(Runway == 1 ) pPlayer.Pos = Vector(-1575, -965, 11)
  27. else if(Runway == 2 ) pPlayer.Pos = Vector(-1575, -980, 11)
  28. local Vehicle = CreateVehicle(126, pPlayer.Pos, 270);
  29. Vehicle.OneTime = true;
  30. pPlayer.Vehicle = Vehicle;
  31. //pPlayer.Frozen = true;
  32. }
  33.  
  34. function onConsoleInput(Command, Parameters){
  35. if(Command == "test"){
  36. print(Random(1,2))
  37. }
  38. }
  39. function StartChallenge(pPlayer, Challenge){
  40. SmallMessage(pPlayer, "Loaded challenge " + Challenge, 1000, 1)
  41. Challenge = Challenge.tostring();
  42. local XPos = ReadIniInteger("Server/Pos/" + Challenge + ".ini", Challenge, "XPos");
  43. local YPos = ReadIniInteger("Server/Pos/" + Challenge + ".ini", Challenge, "YPos");
  44. local ZPos = ReadIniInteger("Server/Pos/" + Challenge + ".ini", Challenge, "ZPos");
  45. local Radius = ReadIniInteger("Server/Pos/" + Challenge + ".ini", Challenge, "Radius");
  46. local = ReadIniInteger("Server/Pos/" + Challenge + ".ini", Challenge, "XPos");
  47. local YPos = ReadIniInteger("Server/Pos/" + Challenge + ".ini", Challenge, "YPos");
  48. local ZPos = ReadIniInteger("Server/Pos/" + Challenge + ".ini", Challenge, "ZPos");
  49. ClientSphere[pPlayer.ID] = CreateClientSphere(Vector(XPos, YPos, ZPos), Radius)
  50. }
  51.  
  52.  
  53. function Random ( Min, Max ) {
  54. //Min and Max Inclusive
  55. return rand ( ) % ( Min - Max - 1 ) + Min;
  56. }
Advertisement
Add Comment
Please, Sign In to add comment