01.09.2012, 07:52
I've been struggled for almost an hour to figure out how to save player's rank name like, Rank=Private.. etc. But I can't make it. Here's my script
So the problem is, It doesn't save in player's data in the scriptfiles. I want it to be like
Rank = Private (Or Corporal, Sergeant, ...etc)
pawn Код:
#define Private 7
#define Corporal 8
#define Sergeant 9
//moar ranks here
enum PlayerInfo
{
//some other shits here
Rank[10],
//moar shits here
}
forward GetPlayerRank(playerid);
public GetPlayerRank(playerid)
{
if(pInfo[playerid][Kills] >= 0)
{
pInfo[playerid][Rank] = Private;
}
else if(pInfo[playerid][Kills] >= 50)
{
pInfo[playerid][Rank] = Corporal;
}
return 1;
}
//onplayerdiconnect
INI_WriteString(file,"Rank",GetPlayerRank(playerid));
//somewhere
format(str,sizeof(str),"Rank: %s",GetPlayerRank(playerid));
TextDrawSetString(^);
Rank = Private (Or Corporal, Sergeant, ...etc)