Bug in /request
#1

When i /createorg in my server ( Windows ) and then /request then all the organizations show what ive created but in the host when i /createorg then /request it tells me There are no existing organizations

/createorg code:

PHP код:
CMD:createorg(playeridparams[])
{
    new 
tmp[256], tmp2[256], string[256], giveplayer[256], moneys1istr[2][50];
    if (
adlvl[playerid] < 6) return 0;
    if (
sscanf(params"s[128]"tmp)) return SendClientMessage2(playeridCOLOR_WHITE"Usage: /createorg [name]");
    if (
strlen(tmp) > 48) return SendClientMessage2(playeridCOLOR_RED"Organization names must be a maximum of 48 characters.");
    new 
amount dini_Int(AddDirFile(dir_orgfilesFILE_OSTATS), "orgs");
    if (
amount == MAX_ORGS)
    {
        
format(tmp2sizeof(tmp2), "The number of organizations has reached the limit of %d."MAX_ORGS);
        
SendClientMessage2(playeridCOLOR_REDtmp2);
        return 
1;
    }
    new 
giveplayerid dini_Int(AddDirFile(dir_orgfilesFILE_OSTATS), "max_org");
    for (new 
tov 1tov <= giveplayeridtov++)
    {
        
format(string10"ORG%d"tov);
        if (!
dini_Exists(AddDirFile(dir_orgfilesstring)))
        {
            
moneys1 tov;
            break;
        }
    }
    if (
moneys1 == 0)
    {
        
moneys1 giveplayerid+1;
        
dini_IntSet(AddDirFile(dir_orgfilesFILE_OSTATS), "max_org"moneys1);
    }
    
dini_IntSet(AddDirFile(dir_orgfilesFILE_OSTATS), "orgs"amount+1);
    
format(string10"ORG%d"moneys1);
    
dini_Create(AddDirFile(dir_orgfilesstring));
    
dini_Set(AddDirFile(dir_orgfilesstring), "name"tmp);
    
dini_Set(AddDirFile(dir_orgfilesstring), "leader""server");
    for (new 
1<= MAX_ORG_MEMBERSe++)
    {
        
format(giveplayer12"members%d"e);
        
dini_Set(AddDirFile(dir_orgfilesstring), giveplayer"server");
    }
    
valstr(istr[0], moneys1);
    
SendPlayerFormattedText(playeridCOLOR_SILVER"Organization '%s' created (ID = %s)"tmpistr[0]);
    if (
DoesPlayerHaveMenuOpen(playerid) == && GetPlayerDialog(playerid) == -1ShowPlayerDialog2(playeridDIALOG_ORG_CATSDIALOG_STYLE_LIST"Organization catagories""Law Enforcement\nGang\nPublic Service\nPublic Transport\nPrivate Business\nHitman\nOther""Select""Cancel");
    
orgselectc[playerid] = moneys1;
    return 
1;

/request code:

PHP код:
CMD:request(playeridparams[])
{
    new 
tmp[256];
    if (
orgReq[playerid] > 0)
    {
        
SendClientMessage2(playeridCOLOR_ORANGE"You are already requesting to join an organization.");
        
SendClientMessage2(playeridCOLOR_YELLOW"Your request will not be withdrawn until you are accepted, declined or reconnect.");
        return 
1;
    }
    new 
moneys1 dini_Int(AddDirFile(dir_orgfilesFILE_OSTATS), "max_org");
    if (
moneys1 == 0) return SendClientMessage2(playeridCOLOR_SILVER"There are currently no existing organizations.");
    if (
DoesPlayerHaveMenuOpen(playerid) || GetPlayerDialog(playerid) != -1) return SendClientMessage2(playeridCOLOR_WHITE"SERVER: Please exit your current menu first.");
    new 
tmp3[1028];
    for (new 
orgg 1orgg <= moneys1orgg++)
    {
        
format(tmp10"ORG%d"orgg);
        if (!
dini_Exists(AddDirFile(dir_orgfilestmp))) continue;
        if (
adlvl[playerid] >= 3format(tmp3sizeof(tmp3), "%s\n{%s}%s (%d)\n"tmp3dini_Get(AddDirFile(dir_orgfilestmp), "color"), dini_Get(AddDirFile(dir_orgfilestmp), "name"), orgg);
        else 
format(tmp3sizeof(tmp3), "%s\n{%s}%s\n"tmp3dini_Get(AddDirFile(dir_orgfilestmp), "color"), dini_Get(AddDirFile(dir_orgfilestmp), "name"), orgg);
    }
    
ShowPlayerDialog2(playeridDIALOG_ORG_REQUESTDIALOG_STYLE_LIST"Select an organization to join."tmp3"Select""Cancel");
    return 
1;

I need help ASAP
Reply
#2

It's pointless to create another thread.
The fact that you even didn't reply to your previous thread, makes it even worse.
https://sampforum.blast.hk/showthread.php?tid=614347
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)