Need some help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need some help (
/showthread.php?tid=377656)
Need some help -
IceBilizard - 15.09.2012
Guyz i need some help i have dynamic organization script and i have this cmd with dialog
pawn Код:
CMD:orgs(playerid, params[])
{
#pragma unused params
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"{FFFFFF}Organizations List","{12900B}1-Grove Street Families\n{8E0090}2-Front Yard Ballas\n{40FFFF}3-Los Aztecas\n{CCFFDD}4-Russian Mafia\n{00CC6C}5-San Andreas Sheriff Department\n{FF0000}6-Hells Angels\n{9CA1FF}7-RsHaul\n{00351E}8-San Andreas Armed Forces\n{6C0000}9-Ninkyo Dantai\n{2641FE}10-San Andreas Police Department\n{000080}11-Special Weapons And Tactics\n{3366FF}12-Federal Bureau Of Investigation\n{6C49A1}13-San Andreas Navy","Ok","Cancel");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if (dialogid == 1)
{
if (response)
{
if (PlayerOrg[playerid] > 0) return SendClientMessage(playerid, COLOR_RED,"You already belong to an organization!");
if (Requesting[playerid] > 0) return SendClientMessage(playerid, COLOR_RED,"You are already requesting to join an organization!");
new ID;
if (!IsLeaderOnline(ID)) return SendClientMessage(playerid,COLOR_RED,"The leader of this organization is currently offline!");
new string[120];
format(string,sizeof(string),"%s is requesting to join the %s", PlayerName(playerid), GetOrgName(ID));
SendClientMessageToAllEx(playerid, COLOR_GREY, string);
format(string,sizeof(string),"Your request to %s has been sent", GetOrgName(ID));
SendClientMessage(playerid, COLOR_YELLOW, string);
Requesting[playerid] = ID;
return 1;
}
else
{
SendClientMessage(playerid, COLOR_YELLOW, "List Closed");
}
}
}
If i click on Grove street families in game and org leader is online but with this function it always says this org leader is currently offline please help and fix it
Re: Need some help -
clarencecuzz - 15.09.2012
Try this:
pawn Код:
CMD:orgs(playerid, params[])
{
#pragma unused params
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"{FFFFFF}Organizations List","{12900B}1-Grove Street Families\n{8E0090}2-Front Yard Ballas\n{40FFFF}3-Los Aztecas\n{CCFFDD}4-Russian Mafia\n{00CC6C}5-San Andreas Sheriff Department\n{FF0000}6-Hells Angels\n{9CA1FF}7-RsHaul\n{00351E}8-San Andreas Armed Forces\n{6C0000}9-Ninkyo Dantai\n{2641FE}10-San Andreas Police Department\n{000080}11-Special Weapons And Tactics\n{3366FF}12-Federal Bureau Of Investigation\n{6C49A1}13-San Andreas Navy","Ok","Cancel");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if (dialogid == 1)
{
if (response)
{
if (PlayerOrg[playerid] > 0) return SendClientMessage(playerid, COLOR_RED,"You already belong to an organization!");
if (Requesting[playerid] > 0) return SendClQientMessage(playerid, COLOR_RED,"You are already requesting to join an organization!");
if (!IsLeaderOnline(listitem + 1)) return SendClientMessage(playerid,COLOR_RED,"The leader of this organization is currently offline!");
new string[120];
format(string,sizeof(string),"%s is requesting to join the %s", PlayerName(playerid), GetOrgName(listitem + 1));
SendClientMessageToAllEx(playerid, COLOR_GREY, string);
format(string,sizeof(string),"Your request to %s has been sent", GetOrgName(listitem + 1));
SendClientMessage(playerid, COLOR_YELLOW, string);
Requesting[playerid] = listitem + 1;
return 1;
}
else return SendClientMessage(playerid, COLOR_YELLOW, "List Closed");
}
return 0;
}
NOTE: Untested
Re: Need some help -
CoDeZ - 15.09.2012
pawn Код:
if (!IsLeaderOnline(ID)) return SendClientMessage(playerid,COLOR_RED,"The leader of this organization is currently offline!");
Try replacing it with this one.
pawn Код:
if (!IsPlayerConnected(ID)) return SendClientMessage(playerid,COLOR_RED,"The leader of this organization is currently offline!");