[FilterScript] HandBrake
#1

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.

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;
}
Sorry for my English, I am Argentine.

[J]Ulian.
Reply
#2

Very nice script, thanx
Reply
#3

Wow awsome, this is good idea for RP, now all cars will be parked corectly.
In chat you typed LAG, is it laggy ?
Reply
#4

lag on my bad computer.
Reply
#5

pawn Код:
C:\Users\dani\Desktop\RolePlay\RolePlay\gamemodes\RRP.pwn(66478) : error 017: undefined symbol "partes"
C:\Users\dani\Desktop\RolePlay\RolePlay\gamemodes\RRP.pwn(66478) : warning 215: expression has no effect
C:\Users\dani\Desktop\RolePlay\RolePlay\gamemodes\RRP.pwn(66478) : error 001: expected token: ";", but found "]"
C:\Users\dani\Desktop\RolePlay\RolePlay\gamemodes\RRP.pwn(66478) : error 029: invalid expression, assumed zero
C:\Users\dani\Desktop\RolePlay\RolePlay\gamemodes\RRP.pwn(66478) : fatal error 107: too many error messages on one line
... help ?
EDIT :
Fixed. cool FS, i will use it
Reply
#6

Thank you.
Reply
#7

Would be better if you used OnPlayerKeyStateChange to use a key to activate when held down and deactivate when lifted.
Reply
#8

Make it by your self
Reply
#9

I would if I had a use for it - I don't, so I won't. What I was saying is it would be better for everyone on earth if that's how it worked, nobody wants to type a command for a handbrake... then type it again to turn it off ...
Reply
#10

Quote:
Originally Posted by Famalamalam
Посмотреть сообщение
Would be better if you used OnPlayerKeyStateChange to use a key to activate when held down and deactivate when lifted.
Ok...
Reply
#11

Quote:
Originally Posted by gold
Посмотреть сообщение
pawn Код:
C:\Users\dani\Desktop\RolePlay\RolePlay\gamemodes\RRP.pwn(66478) : error 017: undefined symbol "partes"
C:\Users\dani\Desktop\RolePlay\RolePlay\gamemodes\RRP.pwn(66478) : warning 215: expression has no effect
C:\Users\dani\Desktop\RolePlay\RolePlay\gamemodes\RRP.pwn(66478) : error 001: expected token: ";", but found "]"
C:\Users\dani\Desktop\RolePlay\RolePlay\gamemodes\RRP.pwn(66478) : error 029: invalid expression, assumed zero
C:\Users\dani\Desktop\RolePlay\RolePlay\gamemodes\RRP.pwn(66478) : fatal error 107: too many error messages on one line
... help ?
EDIT :
Fixed. cool FS, i will use it
Make sure you have the last server update.

P.S The lag might be fixied somehow.
Reply
#12

Quote:
Originally Posted by Famalamalam
Посмотреть сообщение
Would be better if you used OnPlayerKeyStateChange to use a key to activate when held down and deactivate when lifted.
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;
}
Reply
#13

That's not very realistic, and there's already a handbrake key in GTA: SA.
Reply
#14

Quote:
Originally Posted by Calg00ne
Посмотреть сообщение
That's not very realistic, and there's already a handbrake key in GTA: SA.
It is for the vehicle will not move while the hand brake.
Reply
#15

Quote:
Originally Posted by Calg00ne
Посмотреть сообщение
That's not very realistic, and there's already a handbrake key in GTA: SA.
i think its supposed to be more like real life where you dont have to hold down a button for the car to stay there
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)