24.12.2014, 12:38
pawn Код:
if(newkeys & KEY_SUBMISSION) // New Engine HotKey
{
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "You are not driving a vehicle.");
new vehicleid = GetPlayerVehicleID(playerid);
switch(GetVehicleModel(vehicleid))
{
case 509, 481, 510: return SendClientMessage(playerid, COLOR_GREY, "Bicycles have no engine.");
default:
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(vehicleid == PlayerInfo[playerid][pVeh]) doors = PlayerInfo[playerid][vLocked];
else if(vehicleid == PlayerInfo[playerid][pVVeh]) doors = PlayerInfo[playerid][vVLocked];
else if(vehicleid == PlayerInfo[playerid][pBVeh]) doors = PlayerInfo[playerid][vBLocked];
else return SendClientMessage(playerid, COLOR_GREY, "This is not your car!");
new string[60];
if(PlayerInfo[playerid][pMaskOn]) string = (engine) ? ("* keeras sььte vдlja.") : ("* kдivitas mootori.");
else format(string, sizeof(string), (engine) ? ("* %s keeras sььte vдlja.") : ("* %s sisestas vхtme ja keeras sььdet"), RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
SetVehicleParamsEx(vehicleid, (engine) ? (0) : (1), lights, alarm, doors, bonnet, boot, objective);
}
}
}
pawn Код:
else return SendClientMessage(playerid, COLOR_GREY, "This is not your car!");