26.04.2012, 15:26
Hey Forum, i made an gang system including some rank's but i need help with my /makeleader command..
I did this:
And this is for the ini file:
Enum:
Does someone know how to set the players Leader id to 1?
I did this:
pawn Код:
CMD:makeleader(playerid, params[])
{
new pid,gid;
if(sscanf(params, "ii", pid, gid)) return SendClientMessage(playerid, -1, "USAGE: /makeleader [playerid] [gangid]");
{
if(!IsPlayerAdmin(playerid))return 1;
{
if(!IsPlayerConnected(pid))
{
GangData[pid][gLeader] = 1;
GangData[pid][gID] = gid;
}
}
}
return 1;
}
pawn Код:
stock LoadGangInfo(playerid)
{
new filename[128];
format(filename,sizeof(filename),"/Gang/%s.ini",GetName(playerid));
GangData[playerid][gLeader] = dini_Int(filename,"Leader");
GangData[playerid][gMember] = dini_Int(filename,"Member");
GangData[playerid][gID] = dini_Int(filename,"GangID");
return 1;
}
stock SaveGangInfo(playerid)
{
new filename[128];
format(filename,sizeof(filename),"/Gang/%s.ini",GetName(playerid));
dini_Create(filename);
dini_IntSet(filename,"Leader",GangData[playerid][gLeader]);
dini_IntSet(filename,"Member",GangData[playerid][gMember]);
dini_IntSet(filename,"GangID",GangData[playerid][gID]);
}
pawn Код:
enum gData
{
gID,
gLeader,
gMember,
gfile[128]
}
new GangData[MAX_PLAYERS][gData];