10.12.2014, 06:42
Do you have a givekey command ?
Код:
COMMAND:engine(playerid, params[]) { new xr = GetPlayerVehicleID(playerid); new engine,lights,alarm,doors,bonnet,boot,objective; new sender[MAX_STRING]; if(PlayerTemp[playerid][hname]==1) myStrcpy(sender,"Stranger"); else myStrcpy(sender,NameEx(playerid)); if(IsPlayerInAnyVehicle(playerid) && Vehicles[xr][carmodel] == 481 && Vehicles[xr][carmodel] == 509) return SendClientError(playerid, "You are not in any vehicle, or there is no engine implented."); { if(!IsPlayerInAnyVehicle(playerid)) return SendClientError(playerid, "You are not in any vehicle!"); new State; State = GetPlayerState(playerid); if(State!=PLAYER_STATE_DRIVER) return SendClientMessage(playerid,COLOR_GREY,"You are not the driver!"); new stringa[MAX_STRING]; new vid = GetPlayerVehicleID(playerid); GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective); if (PlayerInfo[playerid][pCarKeys] == 0) { // Change pCarKeys if you have someting else SendClientMessage(playerid,COLOR_GREY," You can not start the car engine, if you dont have any car keys."); return 1; } if(engine == 0) { SetVehicleParamsEx(vid, 1, lights, alarm, doors, bonnet, boot, objective); format(stringa,sizeof(stringa),"%s has turned the engine on.",sender); NearMessage(playerid,stringa,COLOR_ME2); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); TogglePlayerControllable(playerid, true); } else { SetVehicleParamsEx(vid, 0, lights, alarm, doors, bonnet, boot, objective); format(stringa,sizeof(stringa),"%s has turned the engine off.",sender); NearMessage(playerid,stringa,COLOR_ME2); TogglePlayerControllable(playerid, true); } } return 1; }