SafePlayerMoney
#3

I am using LARP, when I use just GivePlayerMoney on the filterscript it won't edit the ini file I tried using,

Код:
		PlayerInfo[playerid][pCash] += 250;
		new string[128];
		new plname[MAX_PLAYER_NAME];
		GivePlayerMoney(playerid, 250);
		ScriptMoneyUpdated[playerid] = 1;
		format(string, sizeof(string),"LARP/Users/%s.ini", plname);
		new totalcash = dini_Int(string,"Money") + 250;
		dini_IntSet(string,"Money",totalcash);
The gamemode I am using uses another way somehow to edit the inifile they use "SafeGivePlayerMoney"

So when I am giving the money from the filterscript I use /fixmoney and it takes it away.....

this is the function for SafeGivePlayerMoney in the gamemode

Код:
public SafeGivePlayerMoney(plyid, amounttogive)
{
	ScriptMoneyUpdated[plyid] = 1;
	new RemoveMoney = ScriptMoney[plyid] + amounttogive;
	new AddMoney = ScriptMoney[plyid] + amounttogive;
	new string[20];
	format(string, sizeof(string),"$%d",amounttogive);
	if (amounttogive < 0)
	{
	    if(ReceivedMoney[plyid] == 0)
		{
		    if(!IsAtTransfender(plyid) && !IsAtPaySpray(plyid))
		    {
			    TextDrawHideForPlayer(plyid, Textdraw52[plyid]);
				ReceivedMoney[plyid] = 1;
				TextDrawColor(Textdraw52[plyid], 0xFF0000FF);
				TextDrawSetString(Textdraw52[plyid], string);
				TextDrawShowForPlayer(plyid, Textdraw52[plyid]);
				MoneyTimer[plyid] = SetTimerEx("RedMoney",125,true,"i",plyid);
			}
		}
		else
		{
		    if(!IsAtTransfender(plyid) && !IsAtPaySpray(plyid))
		    {
		 		KillTimer(MoneyTimer[plyid]);
		 		ReceivedMoney[plyid] = 1;
		 		TextDrawHideForPlayer(plyid, Textdraw52[plyid]);
			    TextDrawColor(Textdraw52[plyid], 0xFF0000FF);
			    TextDrawSetString(Textdraw52[plyid], string);
			    TextDrawShowForPlayer(plyid, Textdraw52[plyid]);
			    MoneyTimer[plyid] = SetTimerEx("RedMoney",125,true,"i",plyid);
			}
		}
		GivePlayerMoney(plyid, amounttogive);
		ScriptMoney[plyid] = RemoveMoney;
	}
	else
	{
		if(ReceivedMoney[plyid] == 0)
		{
		    if(!IsAtTransfender(plyid) && !IsAtPaySpray(plyid))
		    {
			    TextDrawHideForPlayer(plyid, Textdraw52[plyid]);
				ReceivedMoney[plyid] = 1;
				TextDrawColor(Textdraw52[plyid], 0x00FF00FF);
				TextDrawSetString(Textdraw52[plyid], string);
				TextDrawShowForPlayer(plyid, Textdraw52[plyid]);
				MoneyTimer[plyid] = SetTimerEx("GreenMoney",125,true,"i",plyid);
			}
		}
		else
		{
		    if(!IsAtTransfender(plyid) && !IsAtPaySpray(plyid))
		    {
		 		KillTimer(MoneyTimer[plyid]);
		 		ReceivedMoney[plyid] = 1;
		 		TextDrawHideForPlayer(plyid, Textdraw52[plyid]);
			    TextDrawColor(Textdraw52[plyid], 0x00FF00FF);
			    TextDrawSetString(Textdraw52[plyid], string);
			    TextDrawShowForPlayer(plyid, Textdraw52[plyid]);
			    MoneyTimer[plyid] = SetTimerEx("GreenMoney",125,true,"i",plyid);
			}
		}
		ScriptMoney[plyid] = AddMoney;
		GivePlayerMoney(plyid, amounttogive);
	}
 	ScriptMoneyUpdated[plyid] = 0;
	return 1;
}
btw congratz on the 500 posts MOH

I even tried porting in all the Safe function into the filterscript... with no luck!
Reply


Messages In This Thread
SafePlayerMoney - by ronnie3148 - 31.03.2011, 08:44
Re: SafePlayerMoney - by Medal Of Honor team - 31.03.2011, 08:48
Re: SafePlayerMoney - by ronnie3148 - 31.03.2011, 09:01
Re: SafePlayerMoney - by ronnie3148 - 31.03.2011, 10:52
Re: SafePlayerMoney - by Calgon - 31.03.2011, 12:32
Re: SafePlayerMoney - by ronnie3148 - 31.03.2011, 21:41

Forum Jump:


Users browsing this thread: 1 Guest(s)