22.08.2015, 19:04
Quote:
You are not getting the vehicle's ID dude you just defined it.
Look at /uselock you'll see on top new id= and so on. |
Like cmd gives the vehicle's id. /towcar [VEHICLEID],
so, command works with id that's given.
And you probably right.
-------
Probably cmd won't work, because you have static vehicles too, like police n shit, well, I guess when you enter car's id, you entered the id of mysql cars list.
Try:
PHP код:
CMD:towcar(playerid, params[])
{
new vehicleid;
if (sscanf(params, "d", vehicleid))
return SendSyntaxMessage(playerid, "/towcar [veh]");
if (vehicleid < 1 || vehicleid > MAX_VEHICLES || !IsValidVehicle(vehicleid))
return SendErrorMessage(playerid, "You have specified an invalid vehicle ID.");
id = Car_GetID(vehicleid);
if (Car_IsOwner(playerid, id)) {
RespawnVehicle(id);
Car_Save(id);
SendServerMessage(playerid, "You have respawned vehicle ID: %d.", id);
GiveMoney(playerid, -500);
} else {
SendErrorMessage(playerid, "You cannot respawn a car that you do not own.");
}
return 1;
}