20.02.2014, 16:23
I've been trying to create memberlist system which show all the members in specific organization.
SetOrgMember stock
I use this in /acceptreq
Please help me!
SetOrgMember stock
pawn Код:
stock SetOrgMember(playerid,orgid)
{
if(!strcmp(OrgInfo[orgid][oMember1],"N/A",true,3))
{
format(OrgInfo[orgid][oMember1],24,"%s",pName(playerid));
}
else if(!strcmp(OrgInfo[orgid][oMember2],"N/A",true,3))
{
format(OrgInfo[orgid][oMember2],24,"%s",pName(playerid));
}
else if(!strcmp(OrgInfo[orgid][oMember3],"N/A",true,3))
{
format(OrgInfo[orgid][oMember3],24,"%s",pName(playerid));
}
else if(!strcmp(OrgInfo[orgid][oMember4],"N/A",true,3))
{
format(OrgInfo[orgid][oMember4],24,"%s",pName(playerid));
}
else if(!strcmp(OrgInfo[orgid][oMember5],"N/A",true,3))
{
format(OrgInfo[orgid][oMember5],24,"%s",pName(playerid));
}
else if(!strcmp(OrgInfo[orgid][oMember6],"N/A",true,3))
{
format(OrgInfo[orgid][oMember6],24,"%s",pName(playerid));
}
else if(!strcmp(OrgInfo[orgid][oMember7],"N/A",true,3))
{
format(OrgInfo[orgid][oMember7],24,"%s",pName(playerid));
}
else if(!strcmp(OrgInfo[orgid][oMember8],"N/A",true,3))
{
format(OrgInfo[orgid][oMember8],24,"%s",pName(playerid));
}
else if(!strcmp(OrgInfo[orgid][oMember9],"N/A",true,3))
{
format(OrgInfo[orgid][oMember9],24,"%s",pName(playerid));
}
else if(!strcmp(OrgInfo[orgid][oMember10],"N/A",true,3))
{
format(OrgInfo[orgid][oMember10],24,"%s",pName(playerid));
}
return 1;
}
pawn Код:
CMD:acceptreq(playerid,params[])
{
new pID;
if(!IsPlayerLeader(playerid)) return SendClientMessage(playerid,COLOR_GREY,"You're not leader of any organization.");
if(sscanf(params,"u",pID)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /acceptreq [playerid]");
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid,COLOR_GREY,"Player is not connnected.");
if(Requesting[playerid] == GetOrgOfLeader(playerid))
{
format(string,sizeof(string),"You've been accepted into %s by the leader.",OrgInfo[GetOrgOfLeader(playerid)][oName]);
SendClientMessage(pID,COLOR_ORANGE,string);
format(string,sizeof(string),"You have accepted %s into your organization.",pName(pID));
SendClientMessage(playerid,COLOR_YELLOW,string);
pInfo[pID][PlayerOrg] = GetOrgOfLeader(playerid);
SetOrgMember(pID,GetOrgOfLeader(playerid));
Requesting[playerid] = 0;
}
else return SendClientMessage(playerid,COLOR_GREY,"Player is not requesting to join your organization.");
return 1;
}