27.06.2012, 05:39
How i enable that lights will be able to see in day?
ManualVehicleEngineAndLights();
if(strcmp(cmd, "/lights", 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(light != VEHICLE_PARAMS_ON)
{
GameTextForPlayer(playerid, "~w~Lights ~g~On", 2000, 4);
SetVehicleParamsEx(vid, engine, VEHICLE_PARAMS_ON, alarm, doors, bonnet, boot, objective);
return 1;
}
GameTextForPlayer(playerid, "~w~Lights ~r~Off", 2000, 4);
SetVehicleParamsEx(vid, engine, VEHICLE_PARAMS_OFF, alarm, doors, bonnet, boot, objective);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_ORANGE, "[ERROR:] You are not in a vehicle as a driver.");
}
return 1;
}
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;
}
if(strcmp(cmd, "/car", true) == 0) { if(IsPlayerConnected(playerid)) { new x_v[256]; x_v = strtok(cmdtext, idx); if(!strlen(x_v)) { SendClientMessage(playerid, COLOR_LIGHTBLUE, "{33CCFF}USAGE:{FFFFFF} /car [Action]"); SendClientMessage(playerid, COLOR_YELLOW2, "lights, hood, trunk"); return 1; } if(!strcmp(x_v, "lights",true)) { 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(light != VEHICLE_PARAMS_ON) { GameTextForPlayer(playerid, "~w~Lights ~g~On", 2000, 4); SetVehicleParamsEx(vid, engine, VEHICLE_PARAMS_ON, alarm, doors, bonnet, boot, objective); return 1; } GameTextForPlayer(playerid, "~w~Lights ~r~Off", 2000, 4); SetVehicleParamsEx(vid, engine, VEHICLE_PARAMS_OFF, alarm, doors, bonnet, boot, objective); return 1; } else if(!strcmp(x_v, "hood",true)) { 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; } else if(!strcmp(x_v, "trunk",true)) { 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; } } return 1; } }