Jump to content
  • 0

ajutor multe erori


Smulyz

Question

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;
}

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
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

Link to comment
Share on other sites

  • 0
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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.