if(strcmp(cmd, \"/motor\", true) == 0){ if(IsPlayerConnected(playerid)) { if(IsPlayerInAnyVehicle(playerid)) { if(engineOn[GetPlayerVehicleID(playerid)]) { if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) { return 1; } if(IsAnOwnableCar(idcar)) { if(PlayerInfo[playerid][pPcarkey] == idcar) { } else { return 1; } } engineOn[GetPlayerVehicleID(playerid)] = false; TogglePlayerControllable(playerid, 0); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), \"* %s leállítja a motort\", sendername); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); gEngine[playerid] = 0; SetVehicleParamsEx(GetPlayerVehicleID(playerid), OFF, lights, alarm, doors, bonnet, boot, objective); return 1; } } } return 1;}
COMMAND:motor(playerid, params[]){ if (GetPlayerVehicleSeat(playerid) == 0){ new engine, lights, alarm, doors, bonnet, boot, objective; new vid = GetPlayerVehicleID(playerid); GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective); if(engine == 1) { SetVehicleParamsEx(vid, 0, lights, alarm, doors, bonnet, boot, objective); SendClientMessage(playerid, 0x00FF00FF, \"Sikeresen leállítottad a motort.\"); //Speedometer_Cleanup(playerid); //TextDrawShowForPlayer(playerid, Textdraw1); } else if(engine == 0) { SetVehicleParamsEx(vid, 1, lights, alarm, doors, bonnet, boot, objective); SendClientMessage(playerid, 0x00FF00FF, \"Sikeresen beindítottad a motort.\"); //Speedometer_Setup(playerid);} }else SendClientMessage(playerid, 0xFF0000FF, \"Nem vagy járműben!!\"); // Let the server know that this was a valid commandreturn 1;}
if(strcmp(cmd, \"/motor\", true) == 0) {if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {OnPlayerKeyStateChange(playerid, KEY_VALAMI, -1); // nem tudom melyik a shift gomb}return 1;}