SA-MP Forums Archive
Vip Save - 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)
+--- Thread: Vip Save (/showthread.php?tid=429032)



Vip Save - DerickClark - 07.04.2013

i did /setvip it don't save the player's level
but it show in vip folder but the level to 0 not saved



Код:
COMMAND: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(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 > 6)return SendClientMessage(playerid, COLOR_RED, "Maximum Vip Level Is 6");
    else
	{
  		Pinfo[giveplayerid][VipLevel] = level;
		format(string,sizeof(string),"Admin %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,"VipLevel",Pinfo[playerid][VipLevel]);
	}
	return 1;
}