VIP system help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: VIP system help (
/showthread.php?tid=243891)
VIP system help -
thimo - 25.03.2011
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
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;
}
And this disconnect
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;
}
Whats wrong with this? Please help me.
Thanx!
Re: VIP system help -
thimo - 28.03.2011
BUMP!
Re: VIP system help -
Mr_Scripter - 28.03.2011
lol i also got it and it don't save
Re: VIP system help -
Haydz - 28.03.2011
Try saving there VIP level when you use the /setvip command, i had problems with missions not saving when i tryed to save them under OnPlayerDisconnect on my server also.
Re: VIP system help -
thimo - 29.03.2011
Well it already gets saved i think
pawn Код:
dcmd_setvip(playerid, params[])
{
new file[100];
format(file,sizeof(file),PlayerFile,Pinfo[playerid][pName]);
new string[128],string2[128];
new giveplayerid, level;
new playername[MAX_PLAYER_NAME],idname[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
GetPlayerName(playerid,idname,MAX_PLAYER_NAME);
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You Have To Be Rcon Admin To Use This Command!");
if(sscanf(params, "ud", giveplayerid, level))return SendClientMessage(playerid, COLOR_RED, "Usage: /setvip [Playerid/Partname] [Level]");
else if (giveplayerid == INVALID_PLAYER_ID)return SendClientMessage(playerid, COLOR_RED, "Player Is Not Connected");
else if (level > 3)return SendClientMessage(playerid, COLOR_RED, "Maximum Vip Level Is 3");
else
{
Pinfo[giveplayerid][Vip_Level] = level;
format(string,sizeof(string),"Administrator %s Set Your Vip Level To %d",playername,level);
SendClientMessage(giveplayerid,COLOR_YELLOW,string);
format(string2,sizeof(string2),"%s Vip Level Is Now %d",idname,level);
SendClientMessageToAll(COLOR_YELLOW,string2);
dini_IntSet(file,"Vip_Level",Pinfo[playerid][Vip_Level]);
}
return 1;
}
But it doesnt work :S
Re: VIP system help -
thimo - 31.03.2011
Bump! Help pls