22.03.2011, 18:04
Try this
pawn Код:
CMD:v(playerid, params[])
{
new color1,color2;
new CarName, getveh[128];
if(sscanf(params,"sii",params, color1, color2)) return SendClientMessage(playerid, -1, "Syntax: /v <vehicle ID>, color1, color2");
new vehicle = GetVehicleModelIDFromName(params);
if(IsNumeric(params)) vehicle = strval(params);
else vehicle = GetVehicleModelIDFromName(params);
if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid, 0xAA3333AA, "Invalid vehicle ID/name");
else
if ( getveh[playerid] > 0 )
{
DestroyVehicle(getveh[playerid]);
getveh[playerid] = 0;
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
getveh[playerid] = CreateVehicle(CarName, x, y, z, 90, color1, color2, false);
PutPlayerInVehicle(playerid, getveh[playerid], 0);
}
return 1;
}