19.02.2012, 11:30
pawn Код:
CMD:car(playerid, params[])
{
if(pData[playerid][pAdmin] >= MODERATOR || IsPlayerAdmin(playerid))
{
new aVehicle, Color1, Color2;
if(sscanf(params, "uI(-1)I(-1)", aVehicle, Color1, Color2)) return SendClientMessage(playerid,color_usage, "[Usage]:"#cwhite" /car [car ID] [ color 1 ] [ color 2 ]");if(veh < 400 || veh > 611) return SendClientMessage(playerid,color_error, "[ Error ]:"#cwhite" This is not a valid vehicle name! Please try again ");
new veh = GetVehicleModelID(aVehicle); // you see you never called this
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));
return 1;
}
else return aerror(playerid);
}