Jump to content

Question

Posted (edited)

Salut  am inceput si eu recent un GM de la 0 si nu imi pot da seama cum sa rezolv acea eroare mai exact error 002: only a single statement (or expression) can follow each "case"

Eroarea se afla la linia asta: else SendClientMessage(playerid, COLOR_WHITE, "Nu esti in jurul unui job");

cod:

CMD:getjob(playerid, params[]){
    if(PlayerJob[playerid]) return SendClientMessage(playerid, COLOR_WHITE, "Ai deja un job!");
    new string[256];
    switch(PlayerJob[playerid]){
    case 0: {
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 1764.96191, -2050.68042, 14.96930)){
        PlayerJob[playerid] = 1;
        format(string, sizeof(string), "Job-ul tau este acum %s.Foloseste comanda /startwork pentru a munci!", JOB_NAME1);
        SendClientMessage(playerid, COLOR_CYAN, string);
        }
    }
    case 1: {
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 854.8568,-605.1971,18.4219)){
        PlayerJob[playerid] = 1;
        format(string, sizeof(string), "Job-ul tau este acum %s.Foloseste comanda /startwork pentru a munci!", JOB_NAME2);
        SendClientMessage(playerid, COLOR_CYAN, string);
        }
    }
    else SendClientMessage(playerid, COLOR_WHITE, "Nu esti in jurul unui job");
    return 1;
}

Edited by FloriNNN

7 answers to this question

Recommended Posts

  • 0
Posted

cum ai definit PlayerJob?

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

  • 0
Posted

  if(PlayerJob[playerid] != 0) return SendClientMessage(playerid, COLOR_WHITE, "Ai deja un job!");

Cu placere da un UP sau nu mai dormi la noapte :)))

  • Upvote 1
  • 0
Posted

CMD:getjob(playerid, params[]){
    if(PlayerJob[playerid]) return SendClientMessage(playerid, COLOR_WHITE, "Ai deja un job!");
    new string[256];
    switch(PlayerJob[playerid]){
        case 0: {
            if(IsPlayerInRangeOfPoint(playerid, 5.0, 1764.96191, -2050.68042, 14.96930)){
                PlayerJob[playerid] = 1;
                format(string, sizeof(string), "Job-ul tau este acum %s.Foloseste comanda /startwork pentru a munci!", JOB_NAME1);
                
            }
        }
        case 1: {
            if(IsPlayerInRangeOfPoint(playerid, 5.0, 854.8568,-605.1971,18.4219)){
                PlayerJob[playerid] = 1;
                format(string, sizeof(string), "Job-ul tau este acum %s.Foloseste comanda /startwork pentru a munci!", JOB_NAME2);
                
            }
        }
        default: return SendClientMessage(playerid, COLOR_WHITE, "Nu esti in jurul unui job");
    }
    SendClientMessage(playerid, COLOR_CYAN, string);
    return 1;
}

incearca asa ms pa da like sau nu mai dormi diseara :))

  • Upvote 1
Guest
This topic is now closed to further replies.
×
×
  • 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.