SA-MP Forums Archive
Remove Score Offline? - 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: Remove Score Offline? (/showthread.php?tid=515298)



Remove Score Offline? - Blackazur - 25.05.2014

Hello, how can i make that i can remove score if the player is offline and that you cant give lower than 0 Score? Also not -1, -2 score blabla.

Код:
CMD:removexp(playerid,params[])
{
		    new targetid,givexp,string[256];
			if(sscanf(params, "ui", targetid, givexp)) return SendClientMessage(playerid,-1,""chat" Usage: /removexp [playerid] [amount]");
		    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,""chat""COL_RED" Player is not connected/online.");

			pInfo[targetid][pXP] -= givexp;

			format(string, sizeof(string), ""chat""COL_RED" %s %s (%d) has removed %s (%d) %d XP",GetAdminName(playerid),PlayerName(playerid),playerid,PlayerName(targetid),targetid,givexp);
			SendClientMessageToAll(-1,string);

	return 1;
}



Re: Remove Score Offline? - Jack_Leslie - 25.05.2014

To remove the score offline, it depends on what file system you use. You would need to open the file, edit the value, and close the file. I can't give an example as I don't know what file system you're using, but to make it so the exp can't go below 0 just do:
pawn Код:
if(givexp < 0) return SendClientMessage(playerid, -1, "Exp can't go below 0.");



AW: Remove Score Offline? - Blackazur - 25.05.2014

Ok thanks and i use Y_INI.