23.01.2012, 18:24
pawn Код:
CMD:engine(playerid, params[])
{
new
giveplayerid,
string[128],
engine,
lights,
alarm,
doors,
bonnet,
boot,
objective,
vehicleid = GetPlayerVehicleID(playerid);
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return 1;
if(IsASateCar(vehicleid)) return SendClientMessage(playerid,COLOR_RED,"You need to hotwire this car.");
if(CanTurnEngine[playerid] == 9999)
return SendClientMessage(playerid, COLOR_GREY,"* You cannot turn this car's engine!");
if(GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510) return SendClientMessageEx(playerid,COLOR_WHITE,"This command can't be used in this vehicle.");
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
if(engine == VEHICLE_PARAMS_ON) {
SetVehicleEngine(vehicleid, playerid);
format(string, sizeof(string), "* %s spins a key and turn the vehicle engine off", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else if((engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET)) {
SetTimerEx("SetVehicleEngine", 3500, 0, "dd", vehicleid, playerid);
format(string, sizeof(string), "* %s spins a key and tries to start vehicle engine", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
return 1;
}
If you are using other languages too ,you will not be able to define it