SA-MP Forums Archive
How.. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How.. (/showthread.php?tid=194091)



How.. - ZmaXy - 28.11.2010

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


Re: How.. - WillyP - 28.11.2010

Lol, you didn't make that.


Re: How.. - Grim_ - 28.11.2010

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 ].