Remove Score Offline?
#1

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;
}
Reply
#2

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.");
Reply
#3

Ok thanks and i use Y_INI.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)