Freeze Car
#1

Hello.

I want to create simple car freezing system with command

Like this :

Code:
if(strcmp(cmdtext, "/freezecar", true)==0)
{
Freeze(vehicleid);
return 1;
}
It is possible?

If it possible then can someone explain little bit, how can I create command like this.

Thanks For Attention.
Reply
#2

Quote:
Originally Posted by Serifukas
View Post
Hello.

I want to create simple car freezing system with command

Like this :

Code:
if(strcmp(cmdtext, "/freezecar", true)==0)
{
Freeze(vehicleid);
return 1;
}
It is possible?

If it possible then can someone explain little bit, how can I create command like this.

Thanks For Attention.
There might be alternate ways but this is how you can do (just an example):-

pawn Code:
new frozecar[MAX_VEHICLES]; // on top

frozecar[vehicleid] = 0; //OnVehicleSpawn lol

CMD:freezecar(playerid, params[])
{
    if ( !IsPlayerInAnyVehicle( playerid ) )return SendClientMessage( playerid, -1, "You are not in any vehicle." );
        new vid = GetPlayerVehicleID( playerid ), engine,lights,alarm,doors,bonnet,boot,objective;
    if(frozecar[vid] == 0)
    {
        SendClientMessage(playerid, -1, "SERVER: The engine is now started.");
        frozecar[vid] = 1;
        GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
        SetVehicleParamsEx(vid,1,lights,alarm,doors,bonnet,boot,objective); // the second one is engine, 1 is on and 0 is off so you can do like this.
    }
    else
    {
        SendClientMessage(playerid, -1, "SERVER: The engine is now turned off.");
        frozecar[vid] = 0;
        GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
        SetVehicleParamsEx(vid,0,lights,alarm,doors,bonnet,boot,objective); // the second one is engine, 1 is on and 0 is off so you can do like this.
    }
    return 1;
}
Original link: https://sampwiki.blast.hk/wiki/SetVehicleParamsEx
-FalconX
Reply
#3

Quote:
Originally Posted by FalconX
View Post
There might be alternate ways but this is how you can do (just an example):-

pawn Code:
new frozecar[MAX_VEHICLES]; // on top

frozecar[vehicleid] = 0; //OnVehicleSpawn lol

CMD:freezecar(playerid, params[])
{
    if ( !IsPlayerInAnyVehicle( playerid ) )return SendClientMessage( playerid, -1, "You are not in any vehicle." );
        new vid = GetPlayerVehicleID( playerid ), engine,lights,alarm,doors,bonnet,boot,objective;
    if(frozecar[vid] == 0)
    {
        SendClientMessage(playerid, -1, "SERVER: The engine is now started.");
        frozecar[vid] = 1;
        GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
        SetVehicleParamsEx(vid,1,lights,alarm,doors,bonnet,boot,objective); // the second one is engine, 1 is on and 0 is off so you can do like this.
    }
    else
    {
        SendClientMessage(playerid, -1, "SERVER: The engine is now turned off.");
        frozecar[vid] = 0;
        GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
        SetVehicleParamsEx(vid,0,lights,alarm,doors,bonnet,boot,objective); // the second one is engine, 1 is on and 0 is off so you can do like this.
    }
    return 1;
}
Original link: https://sampwiki.blast.hk/wiki/SetVehicleParamsEx
-FalconX
I know this one there is engine starting and turning off script.

But i need frozen car then player leave it, and try to push the car then the car are standing with no driver,
that car stand in same position there i left her.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)