Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!strcmp("/infernus", cmdtext, true) && !IsPlayerInAnyVehicle(playerid))
- {
- //DECLARE VARIABLES
- new
- Float:x,
- Float:y,
- Float:z,
- Float:a,
- vehicleId[5];
- // GET PLAYER POS TO CREATE VEHICLES
- GetPlayerPos(playerid, x,y,z);
- GetPlayerFacingAngle(playerid, a);
- // CREATE PLAYER VEHICLE
- vehicleId[0] = CreateVehicle(411, x, y, z, a, -1, -1, -1);
- PutPlayerInVehicle(playerid, vehicleId[0], 0);
- // CREATE VEHICLES
- vehicleId[1] = CreateVehicle(411, x, y, z, a, -1, -1, -1);
- vehicleId[2] = CreateVehicle(411, x, y, z, a, -1, -1, -1);
- vehicleId[3] = CreateVehicle(411, x, y, z, a, -1, -1, -1);
- vehicleId[4] = CreateVehicle(411, x, y, z, a, -1, -1, -1);
- // SET VEHICLES ON FORMAT
- // <- <- <- <- <- <-
- SetVehicleAfterVehicle(vehicleId[0], vehicleId[1]);
- SetVehicleAfterVehicle(vehicleId[1], vehicleId[2]);
- SetVehicleAfterVehicle(vehicleId[2], vehicleId[3]);
- SetVehicleAfterVehicle(vehicleId[3], vehicleId[4]);
- return true;
- }
- return false;
- }
- // FUNCTION
- SetVehicleAfterVehicle(vehicleid1, vehicleid2)
- {
- new
- Float:vehiclePos[4]
- ;
- return (GetVehiclePos(vehicleid1, vehiclePos[0], vehiclePos[1], vehiclePos[2]), GetVehicleZAngle(vehicleid1, vehiclePos[3]),SetVehiclePos(vehicleid2, vehiclePos[0] - (floatsin(-vehiclePos[3]+180, degrees) * 5.0), vehiclePos[1] - (floatcos(-vehiclePos[3]+180, degrees) * 5.0), vehiclePos[2] + 1.3),SetVehicleZAngle(vehicleid2, vehiclePos[3]));
- }
- /*
- Criado por Bruno da Silva
- Este código coloca um carro atrás do outro de forma perfeita através de um calculo rápido
- Bom para races
- www.ips-team.blogspot.com
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement