#include <a_samp>#include <zcmd>#define COLOR_GREEN 0x33AA33AA#define COLOR_ORANGE 0xFF9933AA #define SCM SendClientMessagecmd(indit, playerid, params[]){if(GetPlayerState(playerid) != 2) return SCM(playerid, COLOR_ORANGE, \"Mit akarsz beinditani?\");new vehicleid = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective;GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);if(engine != 1){ GameTextForPlayer(playerid, \"inditod...\", 5000, 5);SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);SCM(playerid, COLOR_GREEN, \"Jármû beinditva!\");}else{SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);SCM(playerid, -1, \"Motor már jár!\");}return 1;}
#include <a_samp>#include <zcmd>#define COLOR_GREEN 0x33AA33AA#define COLOR_ORANGE 0xFF9933AA #define SCM SendClientMessage//Létrehozol egy függvényt, amit a timerrel hívsz megpublic Indit( playerid, vehicleid );cmd(indit, playerid, params[]){ if(GetPlayerState(playerid) != 2) return SCM(playerid, COLOR_ORANGE, \"Mit akarsz beinditani?\"); new vehicleid = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective; GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective); if(engine != 1) { GameTextForPlayer(playerid, \"inditod...\", 5000, 5); SetTimerEx( \"Indit\", 3000, false, \"ii\", playerid, vehicleid ); //Meghívod az \"Indit\" függvényt 3 másodperc múlva, ismétlés nélkül, a \'playerid\' és \'vehicleid\' azonosítókkal } else { SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective); SCM(playerid, -1, \"Motor már jár!\"); } return 1;}//A fent létrehozott és meghívott függvénypublic Indit( playerid, vehicleid ) { SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective); SCM(playerid, COLOR_GREEN, \"Jármû beinditva!\");}
/A fent létrehozott és meghívott függvény public Indit( playerid, vehicleid ) { new engine,lights,alarm,doors,bonnet,boot,objective;GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective); SCM(playerid, COLOR_GREEN, \"Jármû beinditva!\"); }