Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_vehicles>
- #include <a_npc>
- #include <a_dini>
- new RecordNumber;
- new PlayerVehicle;
- main(){}
- public OnNPCModeInit()
- {
- RecordNumber = 0;
- //RandomBot = 1 + random(4);
- //RandomBot = 1;
- SetTimer("CheackIfCarCame",5 * 1000, false);
- return 1;
- }
- public OnRecordingPlaybackEnd()
- {
- if(RecordNumber == 0)
- return StartRecordingPlayback(2, "TaxiTesterStand_1");
- else if(RecordNumber == 1)
- {
- StartRecordingPlayback(2, "TaxiTesterWalkToCar_1");
- RecordNumber = 2;
- return 1;
- }
- else if(RecordNumber == 2)
- {
- return StartRecordingPlayback(1, "TaxiTesterInCar_1");
- }
- return 1;
- }
- public OnNPCEnterVehicle(vehicleid, seatid)
- {
- StopRecordingPlayback();
- StartRecordingPlayback(1, "TaxiTesterInCar_1");
- }
- public OnNPCSpawn()
- {
- StopRecordingPlayback();
- if(RecordNumber == 0)
- return StartRecordingPlayback(2, "TaxiTesterStand_1");
- else if(RecordNumber == 1)
- return StartRecordingPlayback(2, "TaxiTesterWalkToCar_1");
- else if(RecordNumber == 2)
- return StartRecordingPlayback(1, "TaxiTesterInCar_1");
- return 1;
- }
- forward CheackIfCarCame();
- public CheackIfCarCame()
- {
- if(RecordNumber == 0)
- {
- new Float:pos[3];
- GetMyPos(pos[0], pos[1], pos[2]);
- for(new i = 1; i < MAX_VEHICLES; i++)
- {
- //if(IsPlayerNPC(i)) continue;
- if(!IsPlayerInRangeOfPoint(i, 10, pos[0], pos[1], pos[2])) continue;
- //if(GetVehicleModel(i) != 420) continue;
- new string[256];
- PlayerVehicle = GetPlayerVehicleID(i);
- format(string, 256, "vehicles/%d.ini", PlayerVehicle);
- if(dini_Int(string, "IsDmv") != 1) continue;
- RecordNumber++;
- return 1;
- }
- SetTimer("CheackIfCarCame",10 * 1000, false);
- }
- return 1;
- }
- stock IsVehicleInRangeOfPoint(vehicleid, Float:radi, Float:x, Float:y, Float:z)
- {
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetVehiclePos(vehicleid, oldposx, oldposy, oldposz);
- tempposx = (oldposx -x);
- tempposy = (oldposy -y);
- tempposz = (oldposz -z);
- if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement