Vehicle
#1

.....
Reply
#2

Just check if the player is admin using a function like IsPlayerAdmin according to your admin script.
Reply
#3

Removed.
Reply
#4

pawn Код:
if(GetVehicleModel(vehicleid) == 432 || GetVehicleModel(vehicleid) == 520 || GetVehicleModel(vehicleid) == 425 || GetVehicleModel(vehicleid) == 441 || GetVehicleModel(vehicleid) == 464 || GetVehicleModel(vehicleid) == 465 ||
    GetVehicleModel(vehicleid) == 501 || GetVehicleModel(vehicleid) == 564 || GetVehicleModel(vehicleid) == 594 || GetVehicleModel(vehicleid) == 447 || GetVehicleModel(vehicleid) == 449 || GetVehicleModel(vehicleid) == 537 || GetVehicleModel(vehicleid) == 538 ||
    GetVehicleModel(vehicleid) == 539 || GetVehicleModel(vehicleid) == 577 || GetVehicleModel(vehicleid) == 592 || GetVehicleModel(vehicleid) == 601 || GetVehicleModel(vehicleid) == 604 || GetVehicleModel(vehicleid) == 605))
    }
After the if statement, you should do something, but you have a closed brace there.
Reply
#5

Removed.
Reply
#6

Is this what you want?

pawn Код:
CMD:veh(playerid, params[])
{
    new carName[100];
    if(isDead[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command When Dead.");
    if(sscanf(params, "s[100]", carName)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /veh (Vehicle Name)");
    if(BlockVeh == 1) return  SendClientMessage(playerid, COLOR_RED, "This Command Is DISABLED.");
    if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You Are Already In A Vehicle.");
    if(ReturnVehicleID(carName) == INVALID_VEHICLE_ID) return SendClientMessage(playerid, COLOR_RED, "Invalid Vehicle Model.");
    //
    //admincheck
    new vehicleid = GetPlayerVehicleID(playerid);
    if(GetVehicleModel(vehicleid) == 432 || GetVehicleModel(vehicleid) == 520 ||
    GetVehicleModel(vehicleid) == 425 || GetVehicleModel(vehicleid) == 441 ||
    GetVehicleModel(vehicleid) == 464 || GetVehicleModel(vehicleid) == 465 ||
    GetVehicleModel(vehicleid) == 501 || GetVehicleModel(vehicleid) == 564 ||
    GetVehicleModel(vehicleid) == 594 || GetVehicleModel(vehicleid) == 447 ||
    GetVehicleModel(vehicleid) == 449 || GetVehicleModel(vehicleid) == 537 ||
    GetVehicleModel(vehicleid) == 538 || GetVehicleModel(vehicleid) == 539 ||
    GetVehicleModel(vehicleid) == 577 || GetVehicleModel(vehicleid) == 592 ||
    GetVehicleModel(vehicleid) == 601 || GetVehicleModel(vehicleid) == 604 ||
    GetVehicleModel(vehicleid) == 605 && !IsCnRAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You Must Be An Admin To Spawn This Vehicle.");
    //
    new Float:pPos[4], vid;
    GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
    GetPlayerFacingAngle(playerid, pPos[3]);
    vid = CreateVehicle(ReturnVehicleID(carName), pPos[0], pPos[1], pPos[2] + 1.00, pPos[3], 0, 0, 60);
    PutPlayerInVehicle(playerid, vid, 0);
    //
    return 1;
}
Reply
#7

Removed.
Reply
#8

pawn Код:
CMD:veh(playerid, params[])
{
    new carName[100];
    if(IsCnRAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You Must Be An Admin To Spawn This Vehicle.");
    if(isDead[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command When Dead.");
    if(sscanf(params, "s[100]", carName)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /veh (Vehicle Name)");
    if(BlockVeh == 1) return  SendClientMessage(playerid, COLOR_RED, "This Command Is DISABLED.");
    if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You Are Already In A Vehicle.");
    if(ReturnVehicleID(carName) == INVALID_VEHICLE_ID) return SendClientMessage(playerid, COLOR_RED, "Invalid Vehicle Model.");
    //
    //admincheck
    new vehicleid = GetPlayerVehicleID(playerid);
    if(GetVehicleModel(vehicleid) == 432 || GetVehicleModel(vehicleid) == 520 ||
    GetVehicleModel(vehicleid) == 425 || GetVehicleModel(vehicleid) == 441 ||
    GetVehicleModel(vehicleid) == 464 || GetVehicleModel(vehicleid) == 465 ||
    GetVehicleModel(vehicleid) == 501 || GetVehicleModel(vehicleid) == 564 ||
    GetVehicleModel(vehicleid) == 594 || GetVehicleModel(vehicleid) == 447 ||
    GetVehicleModel(vehicleid) == 449 || GetVehicleModel(vehicleid) == 537 ||
    GetVehicleModel(vehicleid) == 538 || GetVehicleModel(vehicleid) == 539 ||
    GetVehicleModel(vehicleid) == 577 || GetVehicleModel(vehicleid) == 592 ||
    GetVehicleModel(vehicleid) == 601 || GetVehicleModel(vehicleid) == 604 ||
    GetVehicleModel(vehicleid) == 605 && !IsCnRAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You Must Be An Admin To Spawn This Vehicle.");
    //
    new Float:pPos[4], vid;
    GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
    GetPlayerFacingAngle(playerid, pPos[3]);
    vid = CreateVehicle(ReturnVehicleID(carName), pPos[0], pPos[1], pPos[2] + 1.00, pPos[3], 0, 0, 60);
    PutPlayerInVehicle(playerid, vid, 0);
    //
    return 1;
}
Reply
#9

pawn Код:
CMD:veh(playerid, params[])
{
    if(IsCnRAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You Must Be An Admin To Spawn This Vehicle.");
    if(isDead[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command When Dead.");
    new carName[32];
    if(sscanf(params, "s[32]", carName)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /veh (Vehicle Name)");
    if(BlockVeh == 1) return  SendClientMessage(playerid, COLOR_RED, "This Command Is DISABLED.");
    if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You Are Already In A Vehicle.");
    if(ReturnVehicleID(carName) == INVALID_VEHICLE_ID) return SendClientMessage(playerid, COLOR_RED, "Invalid Vehicle Model.");
    if(!IsVehicleForbidden(ReturnVehicleID(carName)) return SendClientMessage(playerid, COLOR_RED, "You cannot spawn that vehicle");
    new Float:pPos[4], vid;
    GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
    GetPlayerFacingAngle(playerid, pPos[3]);
    vid = CreateVehicle(ReturnVehicleID(carName), pPos[0], pPos[1], pPos[2] + 1.00, pPos[3], 0, 0, 60);
    PutPlayerInVehicle(playerid, vid, 0);
    return 1;
}

stock IsVehicleForbidden( modelid )
{
    if( modelid == 432 || modelid == 520 || modelid == 425 || modelid == 441 || modelid == 464 || modelid == 465 || modelid == 501
    || modelid == 564 || modelid == 594 || modelid == 447 || modelid == 449 || modelid == 537 || modelid == 538 || modelid == 539
    || modelid == 577 || modelid == 592 || modelid == 601 || modelid == 604 || modelid == 605 ) return 1;
    return 0;
}
Reply
#10

Removed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)