27.03.2014, 10:57
You cannot have vehicle name before color1 and color2 unless you type only 1 word.
pawn Код:
CMD:car(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] < 4 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"You do not have the right admin permissions for this command!");
if (isnull(params)) return SendClientMessage(playerid, COLOR_GREY,"Syntax /car [vehicle name]");
new vid = GetVehicleModelIDFromName(params);
if (vid == -1) return SendClientMessage(playerid,COLOR_RED,"Invalid Vehicle");
new Float:X, Float:Y, Float:Z, Float:Angle;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Angle);
LinkVehicleToInterior(vid, GetPlayerInterior(playerid));
PlayerCar[playerid] = CreateVehicle(vid, X, Y, Z, Angle, random(255), random(255), 60);
return 1;
}