02.12.2011, 13:47
pawn Код:
if(newkeys == KEY_YES)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(IsPlayerConnected(playerid))
{
if(IsAnOwnableCar(newcar))
{
if(PlayerInfo[playerid][pPcarkey] == newcar) { }
else if(PlayerInfo[playerid][pPcarkey2] == newcar) { }
else if(PlayerInfo[playerid][pPcarkey3] == newcar) { }
else { return 1; }
format(string, sizeof(string), "* %s Turned On Car lights.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, 1, alarm, doors, bonnet, boot, objective);
return 1;
}
}
}
}
if(newkeys == KEY_NO)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(IsPlayerConnected(playerid))
{
if(IsAnOwnableCar(newcar))
{
if(PlayerInfo[playerid][pPcarkey] == newcar) { }
else if(PlayerInfo[playerid][pPcarkey2] == newcar) { }
else if(PlayerInfo[playerid][pPcarkey3] == newcar) { }
else { return 1; }
format(string, sizeof(string), "* %s Turned Off Car lights", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, 0, alarm, doors, bonnet, boot, objective);
return 1;
}
}
}
}