Posts: 141
Threads: 14
Joined: Feb 2013
Quote:
Originally Posted by newbie scripter
pawn Код:
CMD:engineon(playerid, params) { if(IsPlayerInAnyVehicle(playerid)) { new engine, lights, alarm, doors, bonnet, boot, objective, vehicleid = GetPlayerVehicleID(playerid); GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective); if( engine = 0) { SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective); } else return SendClientMessage(playerid, -1, "Your Vehicle's Engine Is Already On."); } else return SendClientMessage(playerid, -1, "You Need to Be In A Vehicle To Use This Command"); }
|
You should really have a global variable to detect whether the engine is on or off. It's more efficient if he wants to do an RP script