21.11.2012, 09:14
The reason that it gave you that is on my post above. It expects a string
and you gave an integer
Код:
GetVehicleModelID(vName[])
pawn Код:
CMD:car(playerid, params[])
{
if(PlayerInfo[playerid][World] != DMWorldID)
{
new aVehicle[ 64 ], Color1, Color2;
if(sscanf(params, "s[64]I(-1)I(-1)", aVehicle, Color1, Color2)) return SendClientMessage(playerid,COLOR_YELLOW, "Correct usage: /car [car ID/name] [color1] [color2]");
new veh = GetVehicleModelID(aVehicle);
if(veh < 400 || veh > 611) return SendClientMessage(playerid,COLOR_RED, "ERROR: This is not a valid vehicle name! Please try again ");
new Float:Pos[4];
GetPlayerPos(playerid, Pos[0],Pos[1],Pos[2]); GetPlayerFacingAngle(playerid, Pos[3]);
if(IsPlayerInAnyVehicle(playerid)) { DestroyVehicle(GetPlayerVehicleID(playerid)); }
new PVeh = CreateVehicle(veh, Pos[0], Pos[1], Pos[2], Pos[3]+90, Color1, Color2, -1);
LinkVehicleToInterior(PVeh, GetPlayerInterior(playerid));
SetVehicleVirtualWorld(PVeh, GetPlayerVirtualWorld(playerid));
PutPlayerInVehicle(playerid, PVeh, 0);
GameTextForPlayer(playerid, "~y~Enjoy your new ~r~ride", 2000, 1);
return 1;
}
else return SendClientMessage(playerid, COLOR_RED, "ERROR: you can't use this command when in DeathMatch World");
}