05.10.2013, 13:29
Hello i have a problem
my vip doesnt save
setvip cmd
my vip doesnt save
Код:
stock Gn(playerid) { new pname[24]; GetPlayerName(playerid,pname,MAX_PLAYER_NAME); return pname; } stock PFile(playerid) { format(vfile,64,"VipUsers/%s.ini",Gn(playerid)); return vfile; }
Код:
dcmd_setvip(playerid, params[]) { new id,vip; if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,red,"[ERROR]You are not an admin."); if(sscanf(params,"ui", id,vip))return SendClientMessage(playerid, red, "[ERROR]Usage: /setvip [id] [VipID]");//Use Vip id 1 for Premium, 2 for Silver and 3 for Gold if(vip > 3)return SendClientMessage(playerid,red,"There are only 3 kinds of vip"); if(vip == 1) { GetPlayerName(playerid, Name, sizeof(Name)); format(String, sizeof(String), "%s has set you become a Premium member.",Name); SendClientMessage(id,green, String); if(!dini_Exists(PFile(playerid))) { dini_Create(PFile(playerid)); dini_IntSet(PFile(playerid),"VipMember",1); } else if(dini_Exists(PFile(playerid))) { dini_IntSet(PFile(playerid),"VipMember",1); } Vinfo[playerid][VipLevel] = 1; VipRank = "Silver VIP"; } if(vip == 2) { GetPlayerName(playerid, Name, sizeof(Name)); format(String, sizeof(String), "%s has set you become a Silver member.",Name); SendClientMessage(id,green, String); if(!dini_Exists(PFile(playerid))) { dini_Create(PFile(playerid)); dini_IntSet(PFile(playerid),"VipMember",2); } else if(dini_Exists(PFile(playerid))) { dini_IntSet(PFile(playerid),"VipMember",2); } Vinfo[playerid][VipLevel] = 2; VipRank = "Gold VIP"; } if(vip == 3) { GetPlayerName(playerid, Name, sizeof(Name)); format(String, sizeof(String), "%s has set you become a Gold member.",Name); SendClientMessage(id,green, String); if(!dini_Exists(PFile(playerid))) { dini_Create(PFile(playerid)); dini_IntSet(PFile(playerid),"VipMember",3); } else if(dini_Exists(PFile(playerid))) { dini_IntSet(PFile(playerid),"VipMember",3); } Vinfo[playerid][VipLevel] = 3; VipRank = "Premium VIP"; } return 1; }