17.09.2012, 22:18
Ops, sorry. Here's the working version:
LE: Wait, that won't work either, let me see what's wrong with sscanf plugin. I think I did something wrong, I get "sscanf error: System not initialised." error in log.
LE2: Alright, tested the command myself and it works for me perfectly. Try to update your sscanf2 to last version from here.
pawn Код:
command(spawncar, playerid, vehicleid, params[])
{
new carid, string[128], Float: CarToX, Float: CarToY, Float: CarToZ, physical_car_id, c1, c2;
if(Player[playerid][AdminLevel] < 1)
return SendClientMessage(playerid, ERROR, "ERROR: You are not authorized to use this command!");
if(sscanf(params, "ddd", carid, c1, c2))
return SendClientMessage(playerid, ERROR, "SYNTAX: /spawncar [vehicleid] [colour 1] [colour 2]");
if(CarCount >= MAX_VEHICLES)
return SendClientMessage(playerid, WHITE, "Despawn the current spawned vehicles before spawning any more (or attempting to do so).");
if(carid < 400 || carid > 611)
return SendClientMessage(playerid, ERROR, "ERROR: Valid car IDs start from 400, ending at 611.");
GetPlayerPos(playerid, CarToX, CarToY, CarToZ);
physical_car_id = CreateVehicle(carid, CarToX, CarToY+4, CarToZ, 90, -1, -1, -1);
ChangeVehicleColor(carid, c1, c2);
SendClientMessage(playerid, WHITE, string);
AdminSpawned[SpawnedVehicles] = physical_car_id;
SpawnedVehicles++;
PutPlayerInVehicle(playerid, physical_car_id, 0);
LinkVehicleToInterior(physical_car_id, GetPlayerInterior(playerid));
SetVehicleVirtualWorld(physical_car_id, GetPlayerVirtualWorld(playerid));
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);
return 1;
}
LE2: Alright, tested the command myself and it works for me perfectly. Try to update your sscanf2 to last version from here.