not reading right
#1

hy guys i have a sistem that if you type a command it gives you a dialog that you need to type the id of player you want to give money and after you typed this dialog will apear

Код HTML:
if(dialogid == DIALOG_PREMIUEVENT2)
		{
		    if(DialogExploit(inputtext)) return SendClientMessage(playerid, COLOR_WHITE, "Ai folosit caractere nepermise in componenta noului tau nume.");
            new banipentruevent = strval(inputtext);
			if(MoneyACheck(playerid, banipentruevent, 1, 1000000)) return 1;
        	if(GetPlayerCash(playerid) < banipentruevent) return SendClientMessage(playerid, COLOR_WHITE, "Tu nu ai suficienti bani.");

	       	if(GetPlayers(splayer) == INVALID_PLAYER_ID) return InvalidPlayer(playerid);
			else if(GetPlayers(splayer) == 1000) return ToManyResults(playerid);
			else if(GetPlayers(splayer) == 1001) return ShowResults(playerid, splayer);
			else giveplayerid = GetPlayers(splayer);

	        GivePlayerCash(playerid, -banipentruevent);
	        GivePlayerCash(giveplayerid, banipentruevent);
			format(gString, sizeof(gString), "Organizatorul event-ului %s ia acordat premiu %d$ lui %s , pentru castigarea event-ului.",GetName(playerid), GetName(giveplayerid));
		    SendClientMessageToAll(COLOR_WHITE, gString);
			format(string, sizeof(string), "(!) {FFFFFF}%s (%d) a primit suma de banii trimisa de tine, motiv: castigatorul event-ului.", GetName(id), id);
			SendClientMessage(playerid, COLOR_WHITE, string);
			format(string, sizeof(string), "(!) {FFFFFF}%s (%d) ti-a oferit %d , motiv: castigarea event-ului.", GetName(playerid), playerid, banipentruevent);
			SendClientMessage(id, COLOR_WHITE, string);
		}
ok so i have at me 100.000.000$ and in my bank acc i have 1.000.000$ and i just put 1.000$ on that dialog but it say's "you have no money"
why?
Reply
#2

pawn Код:
if(GetPlayerCash(playerid) < banipentruevent) return SendClientMessage(playerid, COLOR_WHITE, "Tu nu ai suficienti bani.");
I'll assume that's the problem.

You're putting 1.000$ in the dialog box? It will return 1 with strval.
Anyway, show us your GetPlayerCash function.
Reply
#3

Код HTML:
stock GetPlayerCash(playerid)
{
	return Cash[playerid];
}
and

Код HTML:
stock GivePlayerCash(playerid, money)
{
	    Cash[playerid] += money;
	    ResetMoneyBar(playerid);
	    UpdateMoneyBar(playerid, Cash[playerid]);
	    PlayerInfo[playerid][pCash] = Cash[playerid];
	    Update(playerid, pCashx);
        return Cash[playerid];
}
Reply
#4

You didn't answer my question...

Quote:

You're putting 1.000$ in the dialog box?

If yes, try putting just 1000.
Reply
#5

i am not putting 1.000$ i am putting 1000

and now i have another problem when i send money to someone with that it gives me back and he wont get the money

Код HTML:
GivePlayerCash(playerid, -banipentruevent);
	        GivePlayerCash(giveplayerid, banipentruevent);
Reply
#6

Maybe because giveplayerid = playerid? Make a debug:

pawn Код:
new debug_str[35];
format(debug_str, 35, "playerid = %d, giveplayerid = %d", playerid, giveplayerid);
SendClientMessage(playerid, -1, debug_str);
Show GetPlayers function and how you set a value to splayer.
Reply
#7

Код HTML:
function GetPlayers(option[])
{
	new nrr = 0, id = 1002;
	if(IsNumeric(option)) {
		new i = strval(option);
		if(IsPlayerConnected(i))
		id = i;
		else id = INVALID_PLAYER_ID;
	} else {
		foreach(new i : Player) {
			if(strfind(GetName(i), option, true) != -1)
			{
				nrr ++;
			}
		}
		if(nrr > 10) id = 1000;
		if(nrr == 0) id = INVALID_PLAYER_ID;
		if(nrr > 1 && nrr <= 10) id = 1001;

		foreach(new i : Player) {
			if(strfind(GetName(i), option, true) != -1 && id == 1002)
			{
				id = i;
			}
		}
	}
	return id;
}
the message's are getting right that's the point

and the funny thing i have a FS that gives me money just by GivePlayerMoney(playerid, amount); and i am getting the money but on my FS i can't they money will give me back and he wont receive them
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)