30.05.2013, 11:40
pawn Код:
stock SavePlayerOrgInfo(playerid)
{
if (!dini_Exists(PlayerPath(playerid)))
{
dini_Create(PlayerPath(playerid));
}
//dini_Set(savef,"ContactName1",ContactNames[0][playerid]);
dini_Set(PlayerPath(playerid),"Org",Organization[PlayerOrg[playerid]][Name]);
if(Organization[PlayerOrg[playerid]][ismember] == 1)
{
dini_IntSet(PlayerPath(playerid),"Member",1);
}
if(Organization[PlayerOrg[playerid]][trial] == 1)
{
dini_IntSet(PlayerPath(playerid),"trial",1);
}
if(Organization[PlayerOrg[playerid]][adv] == 1)
{
dini_IntSet(PlayerPath(playerid),"adv",1);
}
if(Organization[PlayerOrg[playerid]][co] == 1)
{
dini_IntSet(PlayerPath(playerid),"co",1);
}
if(Organization[PlayerOrg[playerid]][Leader] == 1)
{
dini_IntSet(PlayerPath(playerid),"Leader",1);
}
dini_IntSet(PlayerPath(playerid),"CollectedWage",CollectedWage[playerid]);
}
stock LoadPlayerOrgInfo(playerid)
{
new string[45];
format(string,sizeof(string),"%s",dini_Get(PlayerPath(playerid),"Org"));
PlayerOrg[playerid] = GetOrgID(string);
new string2[28];
Organization[PlayerOrg[playerid]][ismember] = dini_Int(PlayerPath(playerid),"Member");
Organization[PlayerOrg[playerid]][adv] = dini_Int(PlayerPath(playerid),"adv");
Organization[PlayerOrg[playerid]][co] = dini_Int(PlayerPath(playerid),"co");
Organization[PlayerOrg[playerid]][Leader] = dini_Int(PlayerPath(playerid),"Leader");
Organization[PlayerOrg[playerid]][trial] = dini_Int(PlayerPath(playerid),"Trial");
CollectedWage[playerid] = dini_Int(PlayerPath(playerid), "CollectedWage");
if (strcmp(Organization[PlayerOrg[playerid]][Leader], PlayerName(playerid),true) == 0 && PlayerOrg[playerid] != 0)
{
PlayerLeader[playerid] = 1;
}
}
pawn Код:
CMD:setrank(playerid, params[])
{
if (!IsLeader(playerid)) return SendClientMessage(playerid,COLOR_RED,"You are not the leader of an organization");
new ID, rank,mode[128];
if (sscanf(params, "us[28]", ID, rank)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: /setrank [playerid] [rank]");
if (!IsPlayerConnected(ID)) return 1;
if(done[playerid] == 1) return 0;
new org = PlayerOrg[playerid];
if (PlayerOrg[ID] != org) return SendClientMessage(playerid, COLOR_RED,"That player does not belong to your organization");
new string[120];
if(rank=0)
{
Organization[PlayerOrg[playerid]][trial] = 1;
mode = "Trial";
done[playerid] = 1;
format(string,sizeof(string),"Your leader %s has given you a rank: '%s'", PlayerName(playerid), mode);
SendClientMessage(ID, COLOR_YELLOW, string);
format(string,sizeof(string),"You have given a rank to %s (%s)", PlayerName(ID), mode);
SendClientMessage(playerid, COLOR_YELLOW, string);
SavePlayerOrgInfo(ID);
}
if(rank=1)
{
Organization[PlayerOrg[playerid]][ismember] = 1;
mode = "Member";
done[playerid] = 1;
format(string,sizeof(string),"Your leader %s has given you a rank: '%s'", PlayerName(playerid), mode);
SendClientMessage(ID, COLOR_YELLOW, string);
format(string,sizeof(string),"You have given a rank to %s (%s)", PlayerName(ID), mode);
SendClientMessage(playerid, COLOR_YELLOW, string);
SavePlayerOrgInfo(ID);
}
if(rank=2)
{
Organization[PlayerOrg[playerid]][advs] = 1;
mode = "Adv.Member";
done[playerid] = 1;
format(string,sizeof(string),"Your leader %s has given you a rank: '%s'", PlayerName(playerid), mode);
SendClientMessage(ID, COLOR_YELLOW, string);
format(string,sizeof(string),"You have given a rank to %s (%s)", PlayerName(ID), mode);
SendClientMessage(playerid, COLOR_YELLOW, string);
SavePlayerOrgInfo(ID);
}
if(rank=3)
{
Organization[PlayerOrg[playerid]][co] = 1;
mode = "Co-Leader";
done[playerid] = 1;
format(string,sizeof(string),"Your leader %s has given you a rank: '%s'", PlayerName(playerid), mode);
SendClientMessage(ID, COLOR_YELLOW, string);
format(string,sizeof(string),"You have given a rank to %s (%s)", PlayerName(ID), mode);
SendClientMessage(playerid, COLOR_YELLOW, string);
SavePlayerOrgInfo(ID);
}
if(rank=4)
{
Organization[PlayerOrg[playerid]][Leader] = 1;
mode = "Leader";
done[playerid] = 1;
format(string,sizeof(string),"Your leader %s has given you a rank: '%s'", PlayerName(playerid), mode);
SendClientMessage(ID, COLOR_YELLOW, string);
format(string,sizeof(string),"You have given a rank to %s (%s)", PlayerName(ID), mode);
SendClientMessage(playerid, COLOR_YELLOW, string);
SavePlayerOrgInfo(ID);
}
return 1;
}
pls i;m trying to fix it but you guys help me as well