10.04.2013, 13:24
Dб pra fazer por uma funзгo tambйm, para nгo ficar obtendo e alterando valores tantas vezes e diminuir o cуdigo tambйm.
Uso:
Sу um exemplo...
pawn Код:
LockVehicle ( vehicleid, bool: set )
{
new
params [ 7 ];
GetVehicleParamsEx ( vehicleid, params [ 0 ], params [ 1 ], params [ 2 ], params [ 3 ], params [ 4 ], params [ 5 ], params [ 6 ] );
SetVehicleParamsEx ( vehicleid, params [ 0 ], params [ 1 ], params [ 2 ], set, params [ 4 ], params [ 5 ], params [ 6 ] );
/*variбvel booleana global*/ [ vehicleid ] = set;
return 1;
}
pawn Код:
YCMD:destrancar ( playerid, params [ ], help )
{
if ( !IsPlayerInAnyVehicle ( playerid ) )
return SendClientMessage ( playerid, -1, "Vocк nгo estб em um veнculo." );
new
vehicleid = GetPlayerVehicleID ( playerid );
if ( !/*variбvel booleana global*/[ vehicleid ] )
return SendClientMessage ( playerid, -1, "Esse veнculo jб estб destrancado!" );
LockVehicle ( vehicleid, false );
return 1;
}