Jump to content
  • 0

Question

Posted

erori:

C:/Users/Hawai/OneDrive/Desktop/GM PRINCIPAL/gamemodes/main.pwn(118) : error 001: expected token: "{", but found "case"
C:/Users/Hawai/OneDrive/Desktop/GM PRINCIPAL/gamemodes/main.pwn(119) : error 002: only a single statement (or expression) can follow each "case"
C:/Users/Hawai/OneDrive/Desktop/GM PRINCIPAL/gamemodes/main.pwn(119) : warning 215: expression has no effect
C:/Users/Hawai/OneDrive/Desktop/GM PRINCIPAL/gamemodes/main.pwn(120) : warning 209: function "IsABike" should return a value
C:/Users/Hawai/OneDrive/Desktop/GM PRINCIPAL/gamemodes/main.pwn(131) : error 001: expected token: ":", but found "-integer value-"
C:/Users/Hawai/OneDrive/Desktop/GM PRINCIPAL/gamemodes/main.pwn(131) : warning 215: expression has no effect
C:/Users/Hawai/OneDrive/Desktop/GM PRINCIPAL/gamemodes/main.pwn(131) : warning 215: expression has no effect
C:/Users/Hawai/OneDrive/Desktop/GM PRINCIPAL/gamemodes/main.pwn(131) : warning 215: expression has no effect
C:/Users/Hawai/OneDrive/Desktop/GM PRINCIPAL/gamemodes/main.pwn(131) : warning 215: expression has no effect
C:/Users/Hawai/OneDrive/Desktop/GM PRINCIPAL/gamemodes/main.pwn(131) : warning 215: expression has no effect
C:/Users/Hawai/OneDrive/Desktop/GM PRINCIPAL/gamemodes/main.pwn(131) : warning 215: expression has no effect
C:/Users/Hawai/OneDrive/Desktop/GM PRINCIPAL/gamemodes/main.pwn(131) : warning 215: expression has no effect
C:/Users/Hawai/OneDrive/Desktop/GM PRINCIPAL/gamemodes/main.pwn(131) : warning 215: expression has no effect
C:/Users/Hawai/OneDrive/Desktop/GM PRINCIPAL/gamemodes/main.pwn(131) : error 001: expected token: ";", but found ":"
C:/Users/Hawai/OneDrive/Desktop/GM PRINCIPAL/gamemodes/main.pwn(133) : error 010: invalid function or declaration
C:/Users/Hawai/OneDrive/Desktop/GM PRINCIPAL/gamemodes/main.pwn(138) : error 001: expected token: ":", but found "."
C:/Users/Hawai/OneDrive/Desktop/GM PRINCIPAL/gamemodes/main.pwn(138) : error 029: invalid expression, assumed zero
C:/Users/Hawai/OneDrive/Desktop/GM PRINCIPAL/gamemodes/main.pwn(138) : error 029: invalid expression, assumed zero
C:/Users/Hawai/OneDrive/Desktop/GM PRINCIPAL/gamemodes/main.pwn(138) : fatal error 107: too many error messages on one line

 

linile gen tot codu

 

function IsABike(vehicleid) {
    switch(GetVehicleModel(vehicleid))
    case 481, 509, 510: return 1;
    return 0;
}

function IsAMotorcycle(vehicleid) {
    switch(GetVehicleModel(vehicleid)) {
        case 448, 461, 462, 463, 468, 471, 521, 522, 523, 571, 581, 586: return 1;
    }
    return 0;
}

function IsABoat(vehicleid) {
    switch(GetVehicleModel(vehicleid)) {
        case 430, 446 452, 453, 454, 472, 473, 484, 493, 595: return 1;
    }
    return 0;
}

function IsAPlane(vehicleid) {
    switch(GetVehicleModel(vehicleid)) {
        case 417, 425, 447, 460, 464, 465, 469, 476, 487, 488, 497, 501, 511, 512, 513, 519. 520, 548, 553, 563, 577, 592, 594:return 1;
    }
    return 0;
}

2 answers to this question

Recommended Posts

  • 0
Posted
function IsABike(vehicleid) {
    switch(GetVehicleModel(vehicleid)) {
        case 481, 509, 510: return 1;
    }
    return 0;
}

function IsAMotorcycle(vehicleid) {
    switch(GetVehicleModel(vehicleid)) {
        case 448, 461, 462, 463, 468, 471, 521, 522, 523, 571, 581, 586: return 1;
    }
    return 0;
}

function IsABoat(vehicleid) {
    switch(GetVehicleModel(vehicleid)) {
        case 430, 446, 452, 453, 454, 472, 473, 484, 493, 595: return 1;
    }
    return 0;
}

function IsAPlane(vehicleid) {
    switch(GetVehicleModel(vehicleid)) {
        case 417, 425, 447, 460, 464, 465, 469, 476, 487, 488, 497, 501, 511, 512, 513, 519, 520, 548, 553, 563, 577, 592, 594: return 1;
    }
    return 0;
}

Ai uitat acoladele la primul switch.
Si ai uitat niste virgule in case-uri...

  • Thanks 1

Discord:
! Akan !#6675

  • 0
Posted
6 minutes ago, Akan said:
function IsABike(vehicleid) {
    switch(GetVehicleModel(vehicleid)) {
        case 481, 509, 510: return 1;
    }
    return 0;
}

function IsAMotorcycle(vehicleid) {
    switch(GetVehicleModel(vehicleid)) {
        case 448, 461, 462, 463, 468, 471, 521, 522, 523, 571, 581, 586: return 1;
    }
    return 0;
}

function IsABoat(vehicleid) {
    switch(GetVehicleModel(vehicleid)) {
        case 430, 446, 452, 453, 454, 472, 473, 484, 493, 595: return 1;
    }
    return 0;
}

function IsAPlane(vehicleid) {
    switch(GetVehicleModel(vehicleid)) {
        case 417, 425, 447, 460, 464, 465, 469, 476, 487, 488, 497, 501, 511, 512, 513, 519, 520, 548, 553, 563, 577, 592, 594: return 1;
    }
    return 0;
}

Ai uitat acoladele la primul switch.
Si ai uitat niste virgule in case-uri...

+1 mereu ma ajuta si e corect mereu

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.