Jump to content
  • 0

Question

Posted

Problema intalnita (descriere): Cond intru in game sa probez comanda nu functioneaza.
Ero(area / rile) / warning-(ul / urile): -
Liniile de cod / sursa / script-ul(obligatoriu):

// Aceasta este comanda

if(strcmp(cmd, "/licenses", true) == 0)
    {
        if(gLogged[playerid] == 1)
        {
            ShowLicenses(playerid, playerid);
        }
        else
        {
            //
        }
        return 1;
    }

 

// Acesta este executabilil

forward ShowLicenses(playerid, targetid);
public ShowLicenses(playerid, targetid)
{
    new text[6][50];
    new string[128], string2[128];
    if(PlayerInfo[playerid][pLanguage] == 1)
    {
        if(PlayerInfo[targetid][pDriveLic] > 0)
        {
            text[0] = "Passed";
        }
        else
        {
            if(PlayerInfo[targetid][pDriveLicSusp] == 0)
            {
                text[0] = "Suspended";
            }
            else
            {
                text[0] = "Not passed";
            }
        }
        //-
        if(PlayerInfo[targetid][pFlyLic] > 0)
        {
            text[1] = "Passed";
        }
        else
        {
            if(PlayerInfo[targetid][pFlyLicSusp] == 0)
            {
                text[1] = "Suspended";
            }
            else
            {
                text[1] = "Not passed";
            }
        }
        //-
        if(PlayerInfo[targetid][pSailLic] > 0)
        {
            text[2] = "Passed";
        }
        else
        {
            if(PlayerInfo[targetid][pSailLicSusp] == 0)
            {
                text[2] = "Suspended";
            }
            else
            {
                text[2] = "Not passed";
            }
        }
        //-
        if(PlayerInfo[targetid][pFishLic] > 0)
        {
            text[3] = "Passed";
        }
        else
        {
            if(PlayerInfo[targetid][pFishLicSusp] == 0)
            {
                text[3] = "Suspended";
            }
            else
            {
                text[3] = "Not passed";
            }
        }
        //-
        if(PlayerInfo[targetid][pWeapLic] > 0)
        {
            text[4] = "Passed";
        }
        else
        {
            if(PlayerInfo[targetid][pWeapLicSusp] == 0)
            {
                text[4] = "Suspended";
            }
            else
            {
                text[4] = "Not passed";
            }
        }
        //-
        if(PlayerInfo[targetid][pMatLic] > 0)
        {
            text[5] = "Passed";
        }
        else
        {
            if(PlayerInfo[targetid][pMatLicSusp] == 0)
            {
                text[5] = "Suspended";
            }
            else
            {
                text[5] = "Not passed";
            }
        }
        //-
        format(string, sizeof(string),"%s's licenses", GetName(playerid));
        format(string, sizeof(string),"** Driving License: %s\n**Flying License: %s\nSailing License: %s\nFishing License: %s\nWeapons License: %s\nMaterials License: %s", text[0], text[1], text[2], text[3], text[4], text[5]);
        ShowPlayerDialog(playerid, DIALOG_LICENSES, DIALOG_STYLE_MSGBOX, string, string2, "Ok", "");
    }
    else
    {
        if(PlayerInfo[targetid][pDriveLic] > 0)
        {
            text[0] = "Valida";
        }
        else
        {
            if(PlayerInfo[targetid][pDriveLicSusp] == 0)
            {
                text[0] = "Suspendata";
            }
            else
            {
                text[0] = "Expirata";
            }
        }
        //-
        if(PlayerInfo[targetid][pFlyLic] > 0)
        {
            text[1] = "Valida";
        }
        else
        {
            if(PlayerInfo[targetid][pFlyLicSusp] == 0)
            {
                text[1] = "Suspendata";
            }
            else
            {
                text[1] = "Expirata";
            }
        }
        //-
        if(PlayerInfo[targetid][pSailLic] > 0)
        {
            text[2] = "Valida";
        }
        else
        {
            if(PlayerInfo[targetid][pSailLicSusp] == 0)
            {
                text[2] = "Suspendata";
            }
            else
            {
                text[2] = "Expirata";
            }
        }
        //-
        if(PlayerInfo[targetid][pFishLic] > 0)
        {
            text[3] = "Valida";
        }
        else
        {
            if(PlayerInfo[targetid][pFishLicSusp] == 0)
            {
                text[3] = "Suspendata";
            }
            else
            {
                text[3] = "Expirata";
            }
        }
        //-
        if(PlayerInfo[targetid][pWeapLic] > 0)
        {
            text[4] = "Valida";
        }
        else
        {
            if(PlayerInfo[targetid][pWeapLicSusp] == 0)
            {
                text[4] = "Suspendata";
            }
            else
            {
                text[4] = "Expirata";
            }
        }
        //-
        if(PlayerInfo[targetid][pMatLic] > 0)
        {
            text[5] = "Valida";
        }
        else
        {
            if(PlayerInfo[targetid][pMatLicSusp] == 0)
            {
                text[5] = "Suspendata";
            }
            else
            {
                text[5] = "Expirata";
            }
        }
        //-
        format(string, sizeof(string),"Licentele lui %s", GetName(playerid));
        format(string, sizeof(string),"** Carnet de sofer: %s\n**licenta de pilot: %s\nLicenta de navigatie: %s\nLicenta de pescar: %s\nPermis de port-arma: %s\nLicenta de materiale: %s", text[0], text[1], text[2], text[3], text[4], text[5]);
        ShowPlayerDialog(playerid, DIALOG_LICENSES, DIALOG_STYLE_MSGBOX, string, string2, "Ok", "");
    }
    return 1;
}

Imagini / Video (optional):-
Ati incercat sa rezolvati singur?:Da.. nu inteleg care este problema.

5 answers to this question

Recommended Posts

  • 0
Posted

Salut,incearca

if(strcmp(cmd, "/licenses", true) == 0)
    {
        if(gLogged[playerid] == 1)
        {
            ShowLicenses(playerid, playerid);
        }
        else
        {
            //
        }
        return 1;
    }
 
// Acesta este executabilil
forward ShowLicenses(playerid, targetid);
public ShowLicenses(playerid, targetid)
{
    new text[6][50];
    new string[128], string2[128];
    if(PlayerInfo[playerid][pLanguage] == 1)
    {
        if(PlayerInfo[targetid][pDriveLic] > 0)
        {
            text[0] = "Passed";
        }
        else
        {
            if(PlayerInfo[targetid][pDriveLicSusp] == 0)
            {
                text[0] = "Suspended";
            }
            else
            {
                text[0] = "Not passed";
            }
        }
        //-
        if(PlayerInfo[targetid][pFlyLic] > 0)
        {
            text[1] = "Passed";
        }
        else
        {
            if(PlayerInfo[targetid][pFlyLicSusp] == 0)
            {
                text[1] = "Suspended";
            }
            else
            {
                text[1] = "Not passed";
            }
        }
        //-
        if(PlayerInfo[targetid][pSailLic] > 0)
        {
            text[2] = "Passed";
        }
        else
        {
            if(PlayerInfo[targetid][pSailLicSusp] == 0)
            {
                text[2] = "Suspended";
            }
            else
            {
                text[2] = "Not passed";
            }
        }
        //-
        if(PlayerInfo[targetid][pFishLic] > 0)
        {
            text[3] = "Passed";
        }
        else
        {
            if(PlayerInfo[targetid][pFishLicSusp] == 0)
            {
                text[3] = "Suspended";
            }
            else
            {
                text[3] = "Not passed";
            }
        }
        //-
        if(PlayerInfo[targetid][pWeapLic] > 0)
        {
            text[4] = "Passed";
        }
        else
        {
            if(PlayerInfo[targetid][pWeapLicSusp] == 0)
            {
                text[4] = "Suspended";
            }
            else
            {
                text[4] = "Not passed";
            }
        }
        //-
        if(PlayerInfo[targetid][pMatLic] > 0)
        {
            text[5] = "Passed";
        }
        else
        {
            if(PlayerInfo[targetid][pMatLicSusp] == 0)
            {
                text[5] = "Suspended";
            }
            else
            {
                text[5] = "Not passed";
            }
        }
        //-
        new BigString15[250];
        strcat(BigString15, "%s's licenses", GetName(playerid));
        strcat(BigString15, "** Driving License: %s\n**Flying License: %s\nSailing License: %s\nFishing License: %s\nWeapons License: %s\nMaterials License: %s", text[0], text[1], text[2], text[3], text[4], text[5]);
        ShowPlayerDialog(playerid, DIALOG_LICENSES, DIALOG_STYLE_MSGBOX, string, string2, "Ok", "");
    }
    else
    {
        if(PlayerInfo[targetid][pDriveLic] > 0)
        {
            text[0] = "Valida";
        }
        else
        {
            if(PlayerInfo[targetid][pDriveLicSusp] == 0)
            {
                text[0] = "Suspendata";
            }
            else
            {
                text[0] = "Expirata";
            }
        }
        //-
        if(PlayerInfo[targetid][pFlyLic] > 0)
        {
            text[1] = "Valida";
        }
        else
        {
            if(PlayerInfo[targetid][pFlyLicSusp] == 0)
            {
                text[1] = "Suspendata";
            }
            else
            {
                text[1] = "Expirata";
            }
        }
        //-
        if(PlayerInfo[targetid][pSailLic] > 0)
        {
            text[2] = "Valida";
        }
        else
        {
            if(PlayerInfo[targetid][pSailLicSusp] == 0)
            {
                text[2] = "Suspendata";
            }
            else
            {
                text[2] = "Expirata";
            }
        }
        //-
        if(PlayerInfo[targetid][pFishLic] > 0)
        {
            text[3] = "Valida";
        }
        else
        {
            if(PlayerInfo[targetid][pFishLicSusp] == 0)
            {
                text[3] = "Suspendata";
            }
            else
            {
                text[3] = "Expirata";
            }
        }
        //-
        if(PlayerInfo[targetid][pWeapLic] > 0)
        {
            text[4] = "Valida";
        }
        else
        {
            if(PlayerInfo[targetid][pWeapLicSusp] == 0)
            {
                text[4] = "Suspendata";
            }
            else
            {
                text[4] = "Expirata";
            }
        }
        //-
        if(PlayerInfo[targetid][pMatLic] > 0)
        {
            text[5] = "Valida";
        }
        else
        {
            if(PlayerInfo[targetid][pMatLicSusp] == 0)
            {
                text[5] = "Suspendata";
            }
            else
            {
                text[5] = "Expirata";
            }
        }
        //-
        new BigString15[250];
        strcat(BigString15, "Licentele lui %s", GetName(playerid));
        strcat(BigString15, "** Carnet de sofer: %s\n**licenta de pilot: %s\nLicenta de navigatie: %s\nLicenta de pescar: %s\nPermis de port-arma: %s\nLicenta de materiale: %s", text[0], text[1], text[2], text[3], text[4], text[5]);
        ShowPlayerDialog(playerid, DIALOG_LICENSES, DIALOG_STYLE_MSGBOX, string, string2, "Ok", "");
    }
    return 1;
}
 
 

 

 

  • 0
  • 0
Posted

Cu placere,am uitat sa adaug,cred ca string-ul este mare,daca doresti il poti micsora pana la 50 parca,din cate vad aici,nu ai mai mult de 50 caractere deci... Ai putea sa il micsorezi.

 

 

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.