Vehicle Spawner spawns forbidden vehicles
#9

Try this
pawn Код:
stock AllowVehicleModel(model)
{
    if(model < 400 || model > 611) return false;
    switch(model)
    {
        case 425, 432, 447, 430, 417, 435, 449, 450, 497, 460, 464, 465, 469, 472, 476, 501, 511, 520, 537, 538, 548, 553, 563, 564, 569, 570, 607, 584, 590, 591, 592, 594, 606, 608, 610, 611: return false;
    }
    return true;
}
CMD:v(playerid, params[])
{
    new Vehicle[32], VehicleID, ColorOne, ColorTwo;
    if(sscanf(params, "s[32]D(1)D(1)", Vehicle, ColorOne, ColorTwo)) return SendClientMessage(playerid, WHITE, "[USAGE]: /v [Vehiclename/Vehicleid] [Color 1] [Color 2]");
    VehicleID = GetVehicleModelIDFromName(Vehicle);

    if(VehicleID == -1) VehicleID = strval(Vehicle);
    if(!AllowVehicleModel(VehicleID))   return SendClientMessage(playerid, RED, "You are not allowed to spawn this vehicle!!");

    GetPlayerPos(playerid, upX, upY, upZ);
    GetPlayerFacingAngle(playerid, upAngle);
    if(spawncar[playerid] !=0)
    {
        DestroyVehicle(spawncar[playerid]);
    }
    spawncar[playerid] = CreateVehicle(VehicleID, upX, upY, upZ+2.1, upAngle, ColorOne, ColorTwo, -1);
    LinkVehicleToInterior(spawncar[playerid], GetPlayerInterior(playerid));
    PutPlayerInVehicle(playerid, spawncar[playerid], 0);

    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)