new engine,lights,alarm,doors,bonnet,boot,objective;new bool:JarmuMotor[MAX_VEHICLES],VehAsk[MAX_PLAYERS];public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { new jarmu = GetPlayerVehicleID(playerid); if(GetPlayerState(playerid) == 2){ if(newkeys & KEY_JUMP) { if(IsPlayerConnected(playerid)) { if (JarmuMotor[jarmu] == false) { SendClientMessage(playerid,-1,\"*Elfordítottad a kulcsot.\"); SetTimerEx(\"MotorTimer\", 2000, 0, \"d\", playerid); return 1; } } }}return 1;}public OnPlayerStateChange(playerid, newstate, oldstate){ new jarmu = GetPlayerVehicleID(playerid);if(newstate == PLAYER_STATE_DRIVER) { if(JarmuMotor[jarmu] == false) { GetVehicleParamsEx(jarmu,engine,lights,alarm,doors,bonnet,boot,objective); SetVehicleParamsEx(jarmu,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective); TogglePlayerControllable(playerid,false); VehAsk[playerid] = 1; SendClientMessage(playerid,-1,\"*A motorbeindításához nyomj SHIFT gombot!\");}}return 1;}forward MotorTimer(playerid);public MotorTimer(playerid){new jarmu = GetPlayerVehicleID(playerid);if (JarmuMotor[jarmu] == false) {if(VehAsk[playerid] == 1) { VehAsk[playerid] = 0; TogglePlayerControllable(playerid,true); GetVehicleParamsEx(jarmu,engine,lights,alarm,doors,bonnet,boot,objective); SetVehicleParamsEx(jarmu,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);} JarmuMotor[jarmu] = true;SendClientMessage(playerid, ZOLD, \"*A jármû motorja beindult!\");}}CMD:beindit(playerid, params[]){ new jarmu = GetPlayerVehicleID(playerid);if(IsPlayerConnected(playerid)) {if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) { SendClientMessage(playerid,VPIROS,\"Nem vagy jármûben\"); return 1; }if (JarmuMotor[jarmu] == false) { SendClientMessage(playerid, -1, \"Elfordítottad a kulcsot.\"); SetTimerEx(\"MotorTimer\", 2000, 0, \"d\", playerid); return 1; } else if (JarmuMotor[jarmu] == true) { JarmuMotor[jarmu] = false; SendClientMessage(playerid, -1, \"Leállítottad a jármû motorját.\"); TogglePlayerControllable(playerid,false); VehAsk[playerid] = 1; GetVehicleParamsEx(jarmu,engine,lights,alarm,doors,bonnet,boot,objective); SetVehicleParamsEx(jarmu,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective); return 1;}}return 1;}
Én jelenleg ezt használom new engine,lights,alarm,doors,bonnet,boot,objective;new bool:JarmuMotor[MAX_VEHICLES],VehAsk[MAX_PLAYERS];public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { new jarmu = GetPlayerVehicleID(playerid); if(GetPlayerState(playerid) == 2){ if(newkeys & KEY_JUMP) { if(IsPlayerConnected(playerid)) { if (JarmuMotor[jarmu] == false) { SendClientMessage(playerid,-1,\"*Elfordítottad a kulcsot.\"); SetTimerEx(\"MotorTimer\", 2000, 0, \"d\", playerid); return 1; } } }}return 1;}public OnPlayerStateChange(playerid, newstate, oldstate){ new jarmu = GetPlayerVehicleID(playerid);if(newstate == PLAYER_STATE_DRIVER) { if(JarmuMotor[jarmu] == false) { GetVehicleParamsEx(jarmu,engine,lights,alarm,doors,bonnet,boot,objective); SetVehicleParamsEx(jarmu,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective); TogglePlayerControllable(playerid,false); VehAsk[playerid] = 1; SendClientMessage(playerid,-1,\"*A motorbeindításához nyomj SHIFT gombot!\");}}return 1;}forward MotorTimer(playerid);public MotorTimer(playerid){new jarmu = GetPlayerVehicleID(playerid);if (JarmuMotor[jarmu] == false) {if(VehAsk[playerid] == 1) { VehAsk[playerid] = 0; TogglePlayerControllable(playerid,true); GetVehicleParamsEx(jarmu,engine,lights,alarm,doors,bonnet,boot,objective); SetVehicleParamsEx(jarmu,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);} JarmuMotor[jarmu] = true;SendClientMessage(playerid, ZOLD, \"*A jármû motorja beindult!\");}}CMD:beindit(playerid, params[]){ new jarmu = GetPlayerVehicleID(playerid);if(IsPlayerConnected(playerid)) {if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) { SendClientMessage(playerid,VPIROS,\"Nem vagy jármûben\"); return 1; }if (JarmuMotor[jarmu] == false) { SendClientMessage(playerid, -1, \"Elfordítottad a kulcsot.\"); SetTimerEx(\"MotorTimer\", 2000, 0, \"d\", playerid); return 1; } else if (JarmuMotor[jarmu] == true) { JarmuMotor[jarmu] = false; SendClientMessage(playerid, -1, \"Leállítottad a jármû motorját.\"); TogglePlayerControllable(playerid,false); VehAsk[playerid] = 1; GetVehicleParamsEx(jarmu,engine,lights,alarm,doors,bonnet,boot,objective); SetVehicleParamsEx(jarmu,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective); return 1;}}return 1;}