27.06.2012, 05:57
pawn Код:
if(strcmp(cmd, "/hood", true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new vid = GetPlayerVehicleID(playerid);
new engine, light, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vid, engine, light, alarm, doors, bonnet, boot, objective);
if(bonnet != VEHICLE_PARAMS_ON)
{
SetVehicleParamsEx(vid, engine, light, alarm, doors, VEHICLE_PARAMS_ON, boot, objective);
return 1;
}
SetVehicleParamsEx(vid, engine, light, alarm, doors, VEHICLE_PARAMS_OFF, boot, objective);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_ORANGE, "[ERROR:] You are not in a vehicle as a driver.");
}
return 1;
}
if(strcmp(cmd, "/trunk", true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new vid = GetPlayerVehicleID(playerid);
new engine, light, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vid, engine, light, alarm, doors, bonnet, boot, objective);
if(boot!= VEHICLE_PARAMS_ON)
{
SetVehicleParamsEx(vid, engine, light, alarm, doors, bonnet, VEHICLE_PARAMS_ON, objective);
return 1;
}
SetVehicleParamsEx(vid, engine, light, alarm, doors, bonnet, VEHICLE_PARAMS_OFF, objective);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_ORANGE, "[ERROR:] You are not in a vehicle as a driver.");
}
return 1;
}