Help Server Money
#1

Well i have problem with the server money i have searched before i posted and didn't find anything so i posted When i use any admin command to give players money after they spend some example: A player has 3milion$ he spends 2milion on a firm and he buys the firm but his money go to -2milion not just like that even if the player dies and many other ways i don't know why it keeps doing that any suggestions?
Reply
#2

Do you use some Anti MoneyHack ?
Reply
#3

So when a player buys a $2 Million firm and he has $3 Million, the player's money gets set to $-2 Million?

It would be easier to help if we could see that section of the code (what happens when a player buys the firm)
Reply
#4

i don't use a money anti hack and its not only when buying a firm when you buy anything, deposit money , die , pay a ticket to the police... I don't really know how to fix it and where to find the problem i have a public SafeResetPlayerMoney but don't know is it because of it?
Reply
#5

How do you give money ? With GivePlayerMoney?

Show one command with money ...
Reply
#6

Here is the admin /setmoney command

Код:
	if(strcmp(cmd, "/setmoney", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Koristi: /setmoney [ID na Igrac/Del od Imeto] [novac]");
				return 1;
			}
			new playa;
			new money;
			playa = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			money = strval(tmp);
			if (PlayerInfo[playerid][pAdmin] >= 1337)
			{
			    if(IsPlayerConnected(playa))
			    {
			        if(playa != INVALID_PLAYER_ID)
			        {
						SafeResetPlayerMoney(playa);
						SafeGivePlayerMoney(playa, money);
						GetPlayerName(playa, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						format(string, 256, "|DL|%s mu gi podesi parite na %s na $%d.", sendername,giveplayer,money);
						SendAdminMessage(WHITE,string);
						SaveAccounts();
						OnPropUpdate();
						}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "Ne ste ovlasteni za taa Komanda!");
			}
		}
		return 1;
	}
Reply
#7

SafeGivePlayerMoney seems an AntiMoneyHack.

Show this function
Reply
#8

here are they
Код:
public SafeGivePlayerMoney(plyid, amounttogive)
{
	new curHour, curMinute, curSecond;
	gettime(curHour, curMinute, curSecond);
	ScriptMoneyUpdated[plyid] = curSecond;
	if (amounttogive < 0)
	{
		GivePlayerMoney(plyid, amounttogive);
		ScriptMoney[plyid] = (ScriptMoney[plyid] + amounttogive);
	}
	else
	{
		ScriptMoney[plyid] = (ScriptMoney[plyid] + amounttogive);
		GivePlayerMoney(plyid, amounttogive);
	}
	return 1;
}

public SafeResetPlayerMoney(plyid)
{
	new curHour, curMinute, curSecond;
	gettime(curHour, curMinute, curSecond);
	ScriptMoneyUpdated[plyid] = curSecond;
	ResetPlayerMoney(plyid);
	ScriptMoney[plyid] = 0;
	return 1;
}
i added the reset money too
Reply
#9

Why would you separate SafeGiveMoney into the two if/else statements if they both do the same thing? Are these the only added Money related callbacks?
Reply
#10

Quote:
Originally Posted by Yuryfury
Посмотреть сообщение
Why would you separate SafeGiveMoney into the two if/else statements if they both do the same thing? Are these the only added Money related callbacks?
there are some stocks
Код:
stock GivePlayerCash(playerid, money)
{
    Cash[playerid] += money;
    ResetMoneyBar(playerid);//Resets money in the original bar
    UpdateMoneyBar(playerid,Cash[playerid]);//Puts money in the original bar
    return Cash[playerid];
}
stock SetPlayerCash(playerid, money)
{
    Cash[playerid] = money;
    ResetMoneyBar(playerid);//Resets money in the original bar    
    UpdateMoneyBar(playerid,Cash[playerid]);//Puts money in the original bar
    return Cash[playerid];
}
stock ResetPlayerCash(playerid)
{
    Cash[playerid] = 0;
    ResetMoneyBar(playerid);//Resets money in the original bar
    UpdateMoneyBar(playerid,Cash[playerid]);//Puts money in the original bar
    return Cash[playerid];
}
stock GetPlayerCash(playerid)
{
    return Cash[playerid];
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)