#1

How to open Trunk and hood


I made this:

Код:
if(strcmp(cmd, "/startengine",true) == 0) {
        new vid = GetPlayerVehicleID(playerid);
        if(vid != INVALID_VEHICLE_ID) {
            GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
        }
        return 1;
    }
    if(strcmp(cmd, "/stopengine",true) == 0) {
        new vid = GetPlayerVehicleID(playerid);
        if(vid != INVALID_VEHICLE_ID) {
            GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
        }
        return 1;
    }
But when I type the command tells me "Server Unknown Command" and nothing happens
Reply
#2

Lol, you didn't make that.
Reply
#3

pawn Код:
if( !strcmp( cmdtext, "/hood", true ) )
{
   if( !IsPlayerInAnyVehicle( playerid ) )
      return SendClientMessage( playerid, 0xFFFFFF, "Error: You are not in a vehicle." );
   new v[ 7 ];
   GetVehicleParamsEx( GetPlayerVehicleID( playerid ), v[ 0 ], v[ 1 ], v[ 2 ], v[ 3 ], v[ 4 ], v[ 5 ], v[ 6 ] );
   if( v[ 4 ] == VEHICLE_PARAMS_OFF ) v[ 4 ] = VEHICLE_PARAMS_ON;
   else if( v[ 4 ] == VEHICLE_PARAMS_ON ) v[ 5 ] = VEHICLE_PARAMS_OFF;
   SetVehicleParamsEx( GetPlayerVehicleID( playerid ), v[ 0 ], v[ 1 ], v[ 2 ], v[ 3 ], v[ 4 ], v[ 5 ], v[ 6 ] );
   return 1;
}
If the hood is not open, it will open it. If it is already open, it will close it.

Do the exact same thing for the trunk, except change the variable v[ 5 ].
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)