Command isn't doing what it's meant to do
#1

Hai. When I type /request it displays "There are currently no existing organizations." however. If I type like /setleader (To set a player leader of an org) it works. It works on my local host (Windows) and does what it's meant to do. However the server I'm using is hosted on Linux, and that's where the "There are currently no existing organizations." is coming from.

Below i'll post the cmd, and the on dialog response. I don't get any error's what so ever. But it just doesn't run properly on Linux...

CMD:
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;

On Dialog Response

PHP код:
    if (dialogid == DIALOG_ORG_REQUEST)
    {
        if (
response)
        {
            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;
            }
            if (
GetPVarInt(playerid"playerorg") != 0)
            {
                
SendClientMessage2(playeridCOLOR_RED"Error: You are already in an organization!");
                return 
1;
            }
            
temp1 dini_Int(AddDirFile(dir_orgfilesFILE_OSTATS), "max_org");
            for (new 
org 1org <= temp1org++)
            {
                
format(string10"ORG%d"org);
                if (!
dini_Exists(AddDirFile(dir_orgfilesstring))) continue;
                if (
temp2 == listitem)
                {
                    
temp3 org;
                    break;
                }
                
temp2 ++;
            }
            
temp1 0;
            for (new 
0PLAYERSi++)
            {
                if (
IsPlayerConnected2(i) && GetPVarInt(i"playerorg") == temp3 && orgleader[i] != 0)
                {
                    
temp1 ++;
                    break;
                }
            }
            if(
dini_Int(AddDirFile(dir_orgfilesstring), "Reqoff") == 1)
            {
                
SendClientMessage2(playeridCOLOR_RED"Sorry the leader(s) of that organization has disable the recruitment of this organization.");
                return 
1;
            }
            if (
temp1 == 0)
            {
                
SendClientMessage2(playeridCOLOR_WHITE"Sorry the leader(s) of that organization are currently offline.");
                
GetServerVarAsString("weburl"tmp2sizeof(tmp2));
                
SendPlayerFormattedText(playeridCOLOR_WHITE"You can apply to join this organization at %s."tmp2"");
                return 
1;
            }
            
temp1 0;
            new 
temp4 dini_Int(AddDirFile(dir_orgfilesstring), "maxmembers");
            if (
temp4 != 0)
            {
                for (new 
1<= temp4i++)
                {
                    
format(tmp12"member%d"i);
                    if (
strcmp(dini_Get(AddDirFile(dir_orgfilesstring), tmp), "server"false) != 0temp1 ++;
                }
            }
            if (
temp1 == temp4)
            {
                
SendClientMessage2(playeridCOLOR_RED"Sorry that organization has reached maximum members.");
                return 
1;
            }
            
orgReq[playerid] = temp3;
            for (new 
0PLAYERSi++)
            {
                if (
IsPlayerConnected2(i) && GetPVarInt(i"playerorg") == temp3)
                {
                    
SendPlayerFormattedText(iCOLOR_SILVER"%s is requesting to join your organization."playername"");
                }
            }
            
SendPlayerFormattedText(playeridCOLOR_WHITE"Your request to join %s has been sent."dini_Get(AddDirFile(dir_orgfilesstring), "name"), "");
            
GameTextForPlayer(playerid"~g~~h~~h~Request sent!"50003);
        }
        return 
1;
    } 
As always, whoever helps will get +1 Rep.

Thanks Tass
Reply


Messages In This Thread
Command isn't doing what it's meant to do - by Tass007 - 15.02.2016, 19:57
Re: Command isn't doing what it's meant to do - by Tass007 - 17.02.2016, 18:13
Re: Command isn't doing what it's meant to do - by Riddy - 17.02.2016, 18:43
Re: Command isn't doing what it's meant to do - by Tass007 - 17.02.2016, 19:03
Re: Command isn't doing what it's meant to do - by Riddy - 17.02.2016, 19:12
Re: Command isn't doing what it's meant to do - by Tass007 - 17.02.2016, 19:52
Re: Command isn't doing what it's meant to do - by Riddy - 17.02.2016, 21:17
Re: Command isn't doing what it's meant to do - by Tass007 - 17.02.2016, 21:47
Re: Command isn't doing what it's meant to do - by Joron - 17.02.2016, 21:54
Re: Command isn't doing what it's meant to do - by Riddy - 17.02.2016, 21:59

Forum Jump:


Users browsing this thread: 1 Guest(s)