25.03.2011, 09:32
Hey iam creating a vip system but it doesnt go completely well because if i /setvip someone and i watch in files the level is 0 and if i reconnect and i do /viplevel it says my lvl is 0
This is my onplayerConnect
And this disconnect
Whats wrong with this? Please help me.
Thanx!
This is my onplayerConnect
pawn Код:
public OnPlayerConnect(playerid)
{
new file[100],Name[MAX_PLAYER_NAME],Ip[16]; GetPlayerName(playerid,Name,sizeof(Name)); GetPlayerIp(playerid,Ip,sizeof(Ip)); format(file,sizeof(file),playerfile,Name);
if(!dini_Exists(file)) return SendClientMessage(playerid, COLOR_RED, " ");
dini_Create(file);
dini_Set(file,"Name",Name);
dini_Set(file,"Ip",Ip);
dini_IntSet(file, "Vip_level", 0);
}
Pinfo[playerid][Vip_Level] = dini_Int(file,"Vip_Level");
return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new file[100];
format(file,sizeof(file),playerfile,Pinfo[playerid][pName]);
dini_Set(file,"Name",Pinfo[playerid][pName]);
dini_Set(file,"Ip",Pinfo[playerid][Pip]);
dini_IntSet(file,"Vip_Level",Pinfo[playerid][Vip_Level]);
Pinfo[playerid][Vip_Level] = 0;
return 1;
}
Thanx!