Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new CreatedCarPointR[MAX_PLAYERS];
- if(mipickup12 == pickupid)
- {
- // Check for nitro attach vehicle
- if(IsPlayerInInvalidNosVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "This vehicle does not accept nitro");
- // attach nitro
- AddVehicleComponent(GetPlayerVehicleID(playerid) , 1010); // x10 nitro
- PlayerPlaySound(playerid,1133,0.0,0.0,0.0);
- //car change function when passing through point, if it is running and if the "CarreraTroll" variable is activated
- if(JugadorEnCarrera[playerid] && CarreraTroll /*RaceTroll*/ == 1) //Player in Race
- {
- new VID = GetPlayerVehicleID(playerid),
- Float:V_X,Float:V_Y,Float:V_Z,
- Float:P_X,Float:P_Y,Float:P_Z,Float:P_A;
- // getting velocity and pos
- GetVehicleVelocity(VID,V_X,V_Y,V_Z);
- GetVehiclePos(VID,P_X,P_Y,P_Z);
- GetVehicleZAngle(VID,P_A);
- if(CreatedRaceVeh[playerid] != -1) DestruirVehiculo(playerid,CreatedRaceVeh[playerid]); /// vehicle race default
- switch(random(4))
- {
- case 0: CrearVehiculoEx2(playerid,568,P_X,P_Y,P_Z,P_A,V_X,V_Y,V_Z);
- case 1: CrearVehiculoEx2(playerid,411,P_X,P_Y,P_Z,P_A,V_X,V_Y,V_Z);
- case 2: CrearVehiculoEx2(playerid,429,P_X,P_Y,P_Z,P_A,V_X,V_Y,V_Z);
- case 3: CrearVehiculoEx2(playerid,494,P_X,P_Y,P_Z,P_A,V_X,V_Y,V_Z);
- }
- }
- }
- funcion CrearVehiculoEx2(playerid, model, Float:x, Float:y, Float:z, Float:angle, Float:vx, Float:vy, Float:vz)
- {
- if(PlayerInfo[playerid][Vehiculo] != -1)
- DestruirVehiculo(playerid,PlayerInfo[playerid][Vehiculo]), PlayerInfo[playerid][Vehiculo] = -1;
- if(CreatedCarPointR[playerid] != -1) DestruirVehiculo(playerid,CreatedCarPointR[playerid]), CreatedCarPointR[playerid] = -1;
- CreatedCarPointR[playerid] = CreateVehicle(model,x,y,z,angle,random(255),random(255),-1);
- SetVehicleZAngle(CreatedCarPointR[playerid],angle);
- PutPlayerInVehicle(playerid,CreatedCarPointR[playerid],0);
- SetVehicleVelocity(CreatedCarPointR[playerid],vx,vy,vz);
- DisableRemoteVehicleCollisions(playerid,1);
- PlayerInfo[playerid][Vehiculo] = CreatedCarPointR[playerid];
- return vehicleid;
- }
- funcion StopRace()
- {
- rCounter = 0;
- RaceStarted = 0;
- RaceBusy = 0x00;
- JoinCount = 0;
- FinishCount = 0;
- KillTimer(TimerRace2);
- foreach(new i : Player) if(JugadorEnCarrera[i])
- {
- DisablePlayerRaceCheckpoint(i);
- DestruirVehiculo(i,CreatedRaceVeh[i]);
- CreatedRaceVeh[i] = -1;
- DestruirVehiculo(i,CreatedCarPointR[i]);
- CreatedCarPointR[i] = -1;
- DisableRemoteVehicleCollisions(i,0);/// 1 desactiva colisiones y 0 para permitirlas
- RemovePlayerAttachedObject(i,SLOT_ATCOB);
- CPProgess[i] = 0;
- JugadorEnCarrera[i]=false;
- }
- Iter_Clear(Race);
- if(AutomaticRace == true)
- LoadRaceNames(), LoadAutoRace(RaceNames[random(TotalRaces)]);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement