Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Server{
- RegisterFunc = ["StartChallenge"]
- }
- local ChallengeCount = 0;
- local ClientSphere = array(128);
- local ClientBlip = array(128);
- function onScriptLoad(){
- print("Hello rod")
- foreach(ToRegister in Server.RegisterFunc){
- RegisterRemoteFunc(ToRegister);
- }
- LoadModule("lu_ini")
- ChallengeCount = ReadIniInteger("Server/Data.ini", "Data", "Count");;
- }
- function onPlayerJoin(pPlayer){
- CallClientFunc(pPlayer, "Main/Client.nut", "SetChallengeCount", ChallengeCount)
- Message("ss")
- }
- function onPlayerCommand(pPlayer, Command, Params){
- if(Command == "pos")Message(pPlayer.Pos+"")
- }
- function onPlayerSpawn(pPlayer, Spawn){
- local Runway = Random(1,2)
- if(Runway == 1 ) pPlayer.Pos = Vector(-1575, -965, 11)
- else if(Runway == 2 ) pPlayer.Pos = Vector(-1575, -980, 11)
- local Vehicle = CreateVehicle(126, pPlayer.Pos, 270);
- Vehicle.OneTime = true;
- pPlayer.Vehicle = Vehicle;
- //pPlayer.Frozen = true;
- }
- function onConsoleInput(Command, Parameters){
- if(Command == "test"){
- print(Random(1,2))
- }
- }
- function StartChallenge(pPlayer, Challenge){
- SmallMessage(pPlayer, "Loaded challenge " + Challenge, 1000, 1)
- Challenge = Challenge.tostring();
- local XPos = ReadIniInteger("Server/Pos/" + Challenge + ".ini", Challenge, "XPos");
- local YPos = ReadIniInteger("Server/Pos/" + Challenge + ".ini", Challenge, "YPos");
- local ZPos = ReadIniInteger("Server/Pos/" + Challenge + ".ini", Challenge, "ZPos");
- local Radius = ReadIniInteger("Server/Pos/" + Challenge + ".ini", Challenge, "Radius");
- local = ReadIniInteger("Server/Pos/" + Challenge + ".ini", Challenge, "XPos");
- local YPos = ReadIniInteger("Server/Pos/" + Challenge + ".ini", Challenge, "YPos");
- local ZPos = ReadIniInteger("Server/Pos/" + Challenge + ".ini", Challenge, "ZPos");
- ClientSphere[pPlayer.ID] = CreateClientSphere(Vector(XPos, YPos, ZPos), Radius)
- }
- function Random ( Min, Max ) {
- //Min and Max Inclusive
- return rand ( ) % ( Min - Max - 1 ) + Min;
- }
Advertisement
Add Comment
Please, Sign In to add comment