/minuscash /minusscore
#1

Can you please help me make a /minuscash and /minusscore out of this script below?

Код:
COMMAND:givecash(playerid, params[])
{
	if(PlayerInfo[playerid][AdminLevel] >= LEVEL_givecash)
	{
	    new player, amount;
	    if(sscanf(params, "ui", player, amount))
	    {
         	GameTextForPlayer(playerid, "~g~/givecash ~w~<id/name> <amount>", 3000, 3);
	        return 1;
	    }

		if(IsPlayerConnected(player) && player != INVALID_PLAYER_ID)
		{
			new string[128];
			format(string,sizeof(string),"%s(%d) has given you cash of $%d", GetName(playerid), playerid, amount);
			SendClientMessage(player, GREY, string);
			format(string,sizeof(string),"You gave %s(%d) a cash of $%d", GetName(player), player, amount);
			SendClientMessage(playerid, GREY, string);
			GivePlayerMoney(player, amount);
		}
		else
		{
			GameTextForPlayer(playerid, "~r~Player is unavailable", 3000, 3);
		}
	}
	else
	{
		SendClientMessage(playerid, RED, NO_PERM);
	}
	return 1;
}
Код:
COMMAND:givescore(playerid,params[])
{
	if(PlayerInfo[playerid][AdminLevel] >= LEVEL_givescore)
	{
	    new player, amount;
	    if(sscanf(params, "ui", player, amount))
	    {
         	GameTextForPlayer(playerid, "~g~/givescore ~w~<name/id> <score>", 3000, 3);
	        return 1;
	    }
		if(IsPlayerConnected(player) && player != INVALID_PLAYER_ID)
		{
			new string[128];
			if(player != playerid)
			{
				format(string,sizeof(string),"%s(%d) has given you a score of %d", GetName(playerid), playerid,amount);
				SendClientMessage(player,GREY,string);
				format(string,sizeof(string),"You gave %s(%d) a score of %d",GetName(player), player);
				SendClientMessage(playerid,GREY,string);
			}
			else
			{
				format(string,sizeof(string),"You give yourself a score of %d",amount);
				SendClientMessage(playerid,GREY,string);
			}
   			SetPlayerScore(player, GetPlayerScore(player)+ amount);
		}
	 	else
	 	{
		 	GameTextForPlayer(playerid, "~r~player is unavailable", 3000, 3);
		}
	}
	else
	{
		SendClientMessage(playerid, RED, NO_PERM);
	}
	UpdateMySQLScore(playerid);
	return 1;
}
Reply


Messages In This Thread
/minuscash /minusscore - by enzo27 - 13.11.2013, 15:52
Re: /minuscash /minusscore - by StuartD - 13.11.2013, 16:41
Re: /minuscash /minusscore - by Reera - 13.11.2013, 19:08

Forum Jump:


Users browsing this thread: 1 Guest(s)