18.12.2012, 15:21
Guys i made a members saving system in .txt with their names with command /setmember in my organization script but when i use /setmember id its only saving my name if i use /setmember 1 then saving my name and if i use /setmember 2 then saving my name
like
IceBilizard
IceBilizard
this this is my code see and tell what is worng
like
IceBilizard
IceBilizard
this this is my code see and tell what is worng
pawn Код:
CMD:setmember(playerid, params[])
{
if (!IsLeader(playerid)) return SendClientMessage(playerid,COLOR_RED,"You are not the leader of an organization");
new ID;
if (sscanf(params, "u", ID)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: /setmember [playerid]");
if (!IsPlayerConnected(ID) || ID == playerid) return 1;
new org = PlayerOrg[playerid];
if (PlayerOrg[ID]) return SendClientMessage(playerid, COLOR_RED,"That player already belongs to an organization");
if (Requesting[ID] != org) return SendClientMessage(playerid, COLOR_RED,"That player is not requesting to join your organization!");
new string[120];
format(string,sizeof(string),"%s has set you as a member of %s", PlayerName(playerid), GetOrgName(org));
SendClientMessage(ID, COLOR_YELLOW, string);
format(string,sizeof(string),"You have set %s a member of %s", PlayerName(ID), GetOrgName(org));
SendClientMessage(playerid, COLOR_YELLOW, string);
PlayerOrg[ID] = org;
GiveOrgFeatures(ID);
Requesting[ID] = 0;
if (PlayerOrg[ID] == 1)
{
new pname[24], File:ftw=fopen("GSFMembers.txt", io_append);
if(ftw)
{
GetPlayerName(ID, pname, 24);
format(string, 300, "%s\r\n", pname); // formatting the string with the escape codes
fwrite(ftw, string);
fclose(ftw);
}
}
return 1;
}