new engine, lights, alarm, doors, bonnet, boot, objective; if(strcmp(cmd, "/engine", true) == 0) { new vid = GetPlayerVehicleID(playerid); SendClientMessage(playerid, COLOR_GRAD1, "Engine ON!"); GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective); SetVehicleParamsEx(vid,1,lights,alarm,doors,bonnet,boot,objective); CommandLog(string); return 1; } if(strcmp(cmd, "/engineoff", true) == 0) { new vid = GetPlayerVehicleID(playerid); SendClientMessage(playerid, COLOR_GRAD1, " Engine off!"); GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective); SetVehicleParamsEx(vid,0,lights,alarm,doors,bonnet,boot,objective); TogglePlayerControllable(playerid, 0); CommandLog(string); return 1; }
TogglePlayerControllable(playerid,0);
cmd
cmdtext
I Have this a Ongamemodeinit! |
public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(cmdtext, "/engine", true) == 0) { new vid = GetPlayerVehicleID(playerid); SendClientMessage(playerid, COLOR_GRAD1, "Engine ON!"); GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective); SetVehicleParamsEx(vid,1,lights,alarm,doors,bonnet,boot,objective); CommandLog(string); return 1; } if(!strcmp(cmdtext, "/engineoff", true) == 0) { new vid = GetPlayerVehicleID(playerid); SendClientMessage(playerid, COLOR_GRAD1, " Engine off!"); GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective); SetVehicleParamsEx(vid,0,lights,alarm,doors,bonnet,boot,objective); TogglePlayerControllable(playerid, 0); CommandLog(string); return 1; } // any other commands you may have return 0; }