Quote:
Originally Posted by Serifukas
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