04.04.2011, 18:34
Hello!
Im a bit confused how to get this to work. I want your admin level to get saved in your usefile.
Info like this was no problem
But info like this i cant figure out how to get saved.
Here is the setadmin code, there is no problem with it. You get admin rights... but it just not geting saved.
Here is the part of what confuse me. I dont use OnPlayerConnect, so i must put this things somewhere else to get it saved in the userfiles, but how?
I just cant get how to do to get it to work properly, any suggestions?
Im a bit confused how to get this to work. I want your admin level to get saved in your usefile.
Info like this was no problem
pawn Код:
Password=0
Member=0
Leader=0
Status=0
Request=0
IsRequesting=0
Score=0
pawn Код:
enum pInfo
{
Money,
Admin,
Level,
Vip,
Spawn,
};
pawn Код:
CMD:setadmin(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][Admin] >= 5)
{
new sendername[MAX_PLAYER_NAME];
new giveplayername[MAX_PLAYER_NAME];
new giveplayerid,level;
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
if (!sscanf(params, "ii", giveplayerid,level))
{
if (giveplayerid != INVALID_PLAYER_ID)
{
new string[128];
format(string, sizeof(string), "The admin %s has made you a level %d admin",sendername,level);
SendClientMessage(giveplayerid, COLOR_GRAD1, string);
format(string, sizeof(string), "You have made %s a level %d admin",giveplayername,level);
SendClientMessage(playerid, COLOR_GRAD1, string);
PlayerInfo[giveplayerid][Admin] = level;
}
}
else SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /setadmin [playerid] [level]");
}
else SendClientMessage(playerid, 0xFF0000FF, "You are not an level 5, or not a Admin!");
}
return 1;
}
pawn Код:
/*new gPlayerAccount[MAX_PLAYERS];*/
/*public OnPlayerConnect(playerid)
{
PlayerInfo[playerid][Level] = 0;
PlayerInfo[playerid][Money] = 0;
PlayerInfo[playerid][Vip] = 0;
PlayerInfo[playerid][Admin] = 0;
PlayerInfo[playerid][Spawn] = 0;
format(file, sizeof(file), "/Users/%s.ini", playername3);
if(dini_Exists(string))
{
gPlayerAccount[playerid] = 1;
}
else
{
gPlayerAccount[playerid] = 0;
}
return 1;
}*/