01.08.2011, 07:40
(
Последний раз редактировалось [J]ulian; 01.08.2011 в 21:01.
)
HANDBRAKE
( only functional in the R5 )
Today i bring a filterscript for roleplay server, which acts as a brake of a car stopping in reality this is mobilized.( only functional in the R5 )
The only command is /handbrake both to activate and to deactivate it.
Video:
[ame]http://www.youtube.com/watch?v=J08zTeqjid0[/ame]
Pastebin http://pastebin.com/bZEGCeKz
Update:
- With keys:
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if((newkeys & KEY_SUBMISSION) && !(oldkeys & KEY_SUBMISSION))
{
if (IsPlayerInAnyVehicle(playerid))
{
new coche = GetPlayerVehicleID(playerid);
new nombre[MAX_PLAYER_NAME], string_freno[128], partes[7];
GetPlayerName(playerid, nombre, sizeof(nombre));
if(FrenodeMano[coche] == 1)
{
FrenodeMano[coche] = 0;
if(idioma == 0) format(string_freno, sizeof(string_freno), "* %s quitу el freno de mano al vehнculo.", nombre);
if(idioma == 1) format(string_freno, sizeof(string_freno), "* %s took the hand brake the vehicle.", nombre);
ProxDetector(30.0, playerid, string_freno, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GetVehicleParamsEx(coche, partes[0], partes[1], partes[2], partes[3], partes[4], partes[5], partes[6]);
SetVehicleParamsEx(coche,VEHICLE_PARAMS_ON, partes[1], partes[2], partes[3], partes[4], partes[5], partes[6]);
return 1;
}
if(FrenodeMano[coche] == 0)
{
FrenodeMano[coche] = 1;
GetVehiclePos(coche, VehFrenoPOS[coche][0], VehFrenoPOS[coche][1], VehFrenoPOS[coche][2]);
GetVehicleZAngle(coche, VehFrenoPOS[coche][3]);
SetVehicleVelocity(coche, 0, 0, 0);
if(idioma == 0) format(string_freno, sizeof(string_freno), "* %s colocу el freno de mano al vehнculo.", nombre);
if(idioma == 1) format(string_freno, sizeof(string_freno), "* %s put the hand brake the vehicle.", nombre);
ProxDetector(30.0, playerid, string_freno, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GetVehicleParamsEx(coche, partes[0], partes[1], partes[2], partes[3], partes[4], partes[5], partes[6]);
SetVehicleParamsEx(coche,VEHICLE_PARAMS_OFF, partes[1], partes[2], partes[3], partes[4], partes[5], partes[6]);
return 1;
}
}
}
return 1;
}
[J]Ulian.