Esempio n. 1
0
 public void OnClientEventTrigger(Client client, string eventName, params object[] args)
 {
     if (eventName == "player_entered_blip")
     {
         DMVTest d = GetTestInstanceByPlayer(Player.PlayerData[client]);
         if (d.IsPlayerInTestVehicle())
         {
             d.PlayerEnteredCheckpoint();
         }
         else
         {
             API.sendChatMessageToPlayer(client, "Get back in your car!");
         }
     }
     else if (eventName == "player_found_speeding")
     {
         DMVTest d = GetTestInstanceByPlayer(Player.PlayerData[client]);
         d.AddSpeedFlag(Convert.ToInt32(args[0]));
     }
     else if (eventName == "request_test_results")
     {
         DMVTest d = GetTestInstanceByPlayer(Player.PlayerData[client]);
         d.HandleTestResults(Convert.ToInt32(args[0]));
     }
 }
Esempio n. 2
0
 public void OnClientEventTrigger(Client client, string eventName, params object[] args)
 {
     if (eventName == "player_entered_blip")
     {
         DMVTest d = GetTestInstanceByPlayer(Player.PlayerData[client]);
         if (d.IsPlayerInTestVehicle())
         {
             d.PlayerEnteredCheckpoint();
         }
         else
         {
             API.sendChatMessageToPlayer(client, "Get back in your car!");
         }
     }
     else if (eventName == "player_found_speeding")
     {
         DMVTest d = GetTestInstanceByPlayer(Player.PlayerData[client]);
         d.AddSpeedFlag(Convert.ToInt32(args[0]));
     }
     else if (eventName == "request_test_results")
     {
         DMVTest d = GetTestInstanceByPlayer(Player.PlayerData[client]);
         d.HandleTestResults(Convert.ToInt32(args[0]));
     }
     else if (eventName == "launch_test_type")
     {
         API.sendChatMessageToPlayer(client, "Test type recieved: " + args[0].ToString());
         if ((int)args[0] == 1 || (int)args[0] == 2 || (int)args[0] == 3)
         {
             LaunchTest(client, Convert.ToInt32(args[0]));
         }
         else if ((int)args[0] == 6)
         {
             API.sendChatMessageToPlayer(client, "Triggering Client Event");
             API.triggerClientEvent(client, "show_boattest_marker");
         }
         else if ((int)args[0] == 5)
         {
             API.triggerClientEvent(client, "show_planetest_marker");
         }
         else if ((int)args[0] == 4)
         {
             API.triggerClientEvent(client, "show_helitest_marker");
         }
     }
     else if (eventName == "start_boat_test")
     {
         LaunchTest(client, 6);
     }
     else if (eventName == "start_plane_test")
     {
         LaunchTest(client, 5);
     }
     else if (eventName == "start_heli_test")
     {
         LaunchTest(client, 4);
     }
 }