Jump to content
  • 0

Problema la o comanda


AlexuTzuBss

Question

Am comanda : CMD:getjob(playerid, params[])
{
    if(PlayerJob[playerid] != 0) return SCM(playerid, COLOR_ORANGERED, "Ai deja un job.");
    new string[256];
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 2795.7803,-1619.5692,10.9219))
    {
        PlayerJob = 1;
        format(string, sizeof(string), "Noul tau job este %s", JOB_NAME1);
        SCM(playerid, COLOR_ORANGERED, string);
    }
    else SCM(playerid, COLOR_ORANGERED, "Nu esti in zona unui job.");
    return 1;
}

si am eroarea : error 033: array must be indexed (variable "PlayerJob")

Am pus si new PlayerJob[MAX_PLAYERS];

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0
Acum 4 ore, AlexuTzuBss a spus:

Am comanda : CMD:getjob(playerid, params[])
{
    if(PlayerJob[playerid] != 0) return SCM(playerid, COLOR_ORANGERED, "Ai deja un job.");
    new string[256];
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 2795.7803,-1619.5692,10.9219))
    {
        PlayerJob = 1;
        format(string, sizeof(string), "Noul tau job este %s", JOB_NAME1);
        SCM(playerid, COLOR_ORANGERED, string);
    }
    else SCM(playerid, COLOR_ORANGERED, "Nu esti in zona unui job.");
    return 1;
}

si am eroarea : error 033: array must be indexed (variable "PlayerJob")

Am pus si new PlayerJob[MAX_PLAYERS];

PlayerJob[playerid]=1; daca e definit ca PlayerJob[MAX_PLAYERS]

Link to comment
Share on other sites

  • 0
5 hours ago, AlexuTzuBss said:

CMD:getjob(playerid, params[])
{
    if(PlayerJob[playerid] != 0) return SCM(playerid, COLOR_ORANGERED, "Ai deja un job.");
    new string[256];
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 2795.7803,-1619.5692,10.9219))
    {
        PlayerJob = 1;
        format(string, sizeof(string), "Noul tau job este %s", JOB_NAME1);
        SCM(playerid, COLOR_ORANGERED, string);
    }
    else SCM(playerid, COLOR_ORANGERED, "Nu esti in zona unui job.");
    return 1;
}

Vezi diferentele?

Daca variabila e definita ca new PlayerJob[ o valoare ], da-i o valoare si cand o folosesti.

 

Nu pot intelege de ce puneti intruna intrebarea aia proasta: "Ce GM folosesti?".. pai ce conteaza?

Link to comment
Share on other sites

  • 0
CMD:getjob(playerid, params[]) {
    if(PlayerJob[playerid] != 0) return SCM(playerid, COLOR_ORANGERED, "Ai deja un job.");
    new string[256];
    if(!IsPlayerInRangeOfPoint(playerid, 5.0, 2795.7803,-1619.5692,10.9219)) return SCM(playerid, COLOR_ORANGERED, "Nu esti in zona unui job.");
    PlayerJob[playerid] = 1;
    format(string, sizeof(string), "Noul tau job este %s", JOB_NAME1); SCM(playerid, COLOR_ORANGERED, string);
    return 1;
}
	
Edited by MiritaXD
Link to comment
Share on other sites

  • 0
CMD:getjob(playerid, params[])
{
    if(PlayerJob[playerid] != 0) return SCM(playerid, COLOR_ORANGERED, "Ai deja un job.");
    new string[256];
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 2795.7803,-1619.5692,10.9219))
    {
        PlayerJob[playerid] = 1;
        format(string, sizeof(string), "Noul tau job este %s", JOB_NAME1);
        SCM(playerid, COLOR_ORANGERED, string);
    }
    else SCM(playerid, COLOR_ORANGERED, "Nu esti in zona unui job.");
    return 1;
}

 

maxresdefault.jpg

 

 

 

Link to comment
Share on other sites

  • 0
15 hours ago, Lunoxx said:

Vezi diferentele?

Daca variabila e definita ca new PlayerJob[ o valoare ], da-i o valoare si cand o folosesti.

 

Nu pot intelege de ce puneti intruna intrebarea aia proasta: "Ce GM folosesti?".. pai ce conteaza?

Da, multumesc am rezolvat.

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.