14.01.2013, 17:50
If you want to do with command you should type this code
But if you want to add nitro to the all vehicles you should write this in the end of OnGameModeInit
If you have a variable contains last vehicle id (for example, lastVehicleId) you can rewrite your loop as
for (new i = 0; i < lastVehicleId; i++)...
pawn Код:
if (!strcmp(cmdtext, "/nitro", true)) {
if (!IsPlayerInAnyVehicle(playerid)) return 1;
new vehicleid = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehicleid, 1010); // X10 nitro
return 1;
}
pawn Код:
for (new i = 0; i < MAX_VEHICLES; i++)
AddVehicleComponent(i, 1010);
for (new i = 0; i < lastVehicleId; i++)...