15.02.2016, 19:57
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:
On Dialog Response
As always, whoever helps will get +1 Rep.
Thanks Tass
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(playerid, params[])
{
new tmp[256];
if (orgReq[playerid] > 0)
{
SendClientMessage2(playerid, COLOR_ORANGE, "You are already requesting to join an organization.");
SendClientMessage2(playerid, COLOR_YELLOW, "Your request will not be withdrawn until you are accepted, declined or reconnect.");
return 1;
}
new moneys1 = dini_Int(AddDirFile(dir_orgfiles, FILE_OSTATS), "max_org");
if (moneys1 == 0) return SendClientMessage2(playerid, COLOR_SILVER, "There are currently no existing organizations.");
if (DoesPlayerHaveMenuOpen(playerid) || GetPlayerDialog(playerid) != -1) return SendClientMessage2(playerid, COLOR_WHITE, "SERVER: Please exit your current menu first.");
new tmp3[1028];
for (new orgg = 1; orgg <= moneys1; orgg++)
{
format(tmp, 10, "ORG%d", orgg);
if (!dini_Exists(AddDirFile(dir_orgfiles, tmp))) continue;
if (adlvl[playerid] >= 3) format(tmp3, sizeof(tmp3), "%s\n{%s}%s (%d)\n", tmp3, dini_Get(AddDirFile(dir_orgfiles, tmp), "color"), dini_Get(AddDirFile(dir_orgfiles, tmp), "name"), orgg);
else format(tmp3, sizeof(tmp3), "%s\n{%s}%s\n", tmp3, dini_Get(AddDirFile(dir_orgfiles, tmp), "color"), dini_Get(AddDirFile(dir_orgfiles, tmp), "name"), orgg);
}
ShowPlayerDialog2(playerid, DIALOG_ORG_REQUEST, DIALOG_STYLE_LIST, "Select an organization to join.", tmp3, "Select", "Cancel");
return 1;
}
PHP код:
if (dialogid == DIALOG_ORG_REQUEST)
{
if (response)
{
if (orgReq[playerid] > 0)
{
SendClientMessage2(playerid, COLOR_ORANGE, "You are already requesting to join an organization.");
SendClientMessage2(playerid, COLOR_YELLOW, "Your request will not be withdrawn until you are accepted, declined or reconnect.");
return 1;
}
if (GetPVarInt(playerid, "playerorg") != 0)
{
SendClientMessage2(playerid, COLOR_RED, "Error: You are already in an organization!");
return 1;
}
temp1 = dini_Int(AddDirFile(dir_orgfiles, FILE_OSTATS), "max_org");
for (new org = 1; org <= temp1; org++)
{
format(string, 10, "ORG%d", org);
if (!dini_Exists(AddDirFile(dir_orgfiles, string))) continue;
if (temp2 == listitem)
{
temp3 = org;
break;
}
temp2 ++;
}
temp1 = 0;
for (new i = 0; i < PLAYERS; i++)
{
if (IsPlayerConnected2(i) && GetPVarInt(i, "playerorg") == temp3 && orgleader[i] != 0)
{
temp1 ++;
break;
}
}
if(dini_Int(AddDirFile(dir_orgfiles, string), "Reqoff") == 1)
{
SendClientMessage2(playerid, COLOR_RED, "Sorry the leader(s) of that organization has disable the recruitment of this organization.");
return 1;
}
if (temp1 == 0)
{
SendClientMessage2(playerid, COLOR_WHITE, "Sorry the leader(s) of that organization are currently offline.");
GetServerVarAsString("weburl", tmp2, sizeof(tmp2));
SendPlayerFormattedText(playerid, COLOR_WHITE, "You can apply to join this organization at %s.", tmp2, "");
return 1;
}
temp1 = 0;
new temp4 = dini_Int(AddDirFile(dir_orgfiles, string), "maxmembers");
if (temp4 != 0)
{
for (new i = 1; i <= temp4; i++)
{
format(tmp, 12, "member%d", i);
if (strcmp(dini_Get(AddDirFile(dir_orgfiles, string), tmp), "server", false) != 0) temp1 ++;
}
}
if (temp1 == temp4)
{
SendClientMessage2(playerid, COLOR_RED, "Sorry that organization has reached maximum members.");
return 1;
}
orgReq[playerid] = temp3;
for (new i = 0; i < PLAYERS; i++)
{
if (IsPlayerConnected2(i) && GetPVarInt(i, "playerorg") == temp3)
{
SendPlayerFormattedText(i, COLOR_SILVER, "%s is requesting to join your organization.", playername, "");
}
}
SendPlayerFormattedText(playerid, COLOR_WHITE, "Your request to join %s has been sent.", dini_Get(AddDirFile(dir_orgfiles, string), "name"), "");
GameTextForPlayer(playerid, "~g~~h~~h~Request sent!", 5000, 3);
}
return 1;
}
Thanks Tass