09.03.2016, 14:37
Код:
new speed = GetPlayerSpeed(playerid, true); if(speed >= 40) { setspeedcarro 30 }
new speed = GetPlayerSpeed(playerid, true); if(speed >= 40) { setspeedcarro 30 }
Код:
new speed = GetPlayerSpeed(playerid, true); if(speed >= 40) { setspeedcarro 30 } |
new bool:StuntSuperSpeed[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
StuntSuperSpeed[ playerid ] = false;
return 1;
}
//Para Fazer Um CMD De Dar Speed Faзa O Comando E Coloque:
StuntSuperSpeed[ playerid ] = true;
//O Veнculo Terб Speed E Jump. Pressione CTRL|ALT
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
//Speed
if (newkeys & KEY_FIRE && StuntSuperSpeed[playerid] == true)
{
if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
ModifyVehicleSpeed(GetPlayerVehicleID(playerid),100);
}
}
//Jump
if (newkeys & KEY_ACTION && StuntSuperSpeed[playerid] == true)
{
if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new Float:Vx,Float:Vy,Float:Vz;
GetVehicleVelocity(GetPlayerVehicleID(playerid),Vx,Vy,Vz);
SetVehicleVelocity(GetPlayerVehicleID(playerid),Vx,Vy,Vz+0.20);
}
}
return 1;
}
stock ModifyVehicleSpeed(vehicleid,mph) //Miles Per Hour
{
new Float:Vx,Float:Vy,Float:Vz,Float:DV,Float:multiple;
GetVehicleVelocity(vehicleid,Vx,Vy,Vz);
DV = floatsqroot(Vx*Vx + Vy*Vy + Vz*Vz);
if(DV > 0) //Directional velocity must be greater than 0 (display strobes if 0)
{
multiple = ((mph + DV * 100) / (DV * 100)); //Multiplying DV by 100 calculates speed in MPH
return SetVehicleVelocity(vehicleid,Vx*multiple,Vy*multiple,Vz*multiple);
}
return 0;
}
if(speed >= 60) { ModifyVehicleSpeed(GetPlayerVehicleID(playerid),15); }
stock ModifyVehicleSpeed(vehicleid,mph) //Miles Per Hour { new Float:Vx,Float:Vy,Float:Vz,Float:DV,Float:multiple; GetVehicleVelocity(vehicleid,Vx,Vy,Vz); DV = floatsqroot(Vx*Vx + Vy*Vy + Vz*Vz); if(DV > 0) //Directional velocity must be greater than 0 (display strobes if 0) { multiple = ((mph + DV * 100) / (DV * 100)); //Multiplying DV by 100 calculates speed in MPH return SetVehicleVelocity(vehicleid,Vx*multiple,Vy*multiple,Vz*multiple); } return 0; }
new speed, Float:Velocity[3];
speed = GetVehicleVelocity(GetPlayerVehicleID(playerid), Velocity[0], Velocity[1], Velocity[2]);
if(speed >= 15.0) {
SetVehicleVelocity(GetPlayerVehicleID(playerid), 40.0, 0.0, 0.0);
}