17.04.2013, 10:53
I've this code to buy bombs:
The problem is in the message:
It should be:
Playername (id) bought 5 bombs (example) for 15000 CSCash each (already defined BOMBPRICE). Total Spent: It should do 15000 x 5 bombs = 75000
But it shows the "Total Spent" and "For %d CSCash each" with wrong values.
Whats wrong?
pawn Код:
format(message, sizeof(message), "You bought %d bombs for %d CSCash each - Total Spent: %d CSCash", bombs,BOMBPRICE,BOMBPRICE * bombs);
SCM(playerid, 0x33CCFFAA, message);
pInfo[playerid][Bombs] += bombs;
GiveCash(playerid, -BOMBPRICE * bombs);
new Year, Month, Day, Hour, Minute, Second;
getdate(Year, Month, Day);
gettime(Hour, Minute, Second);
new pname[MAX_PLAYER_NAME];
new msg[400];
new ok[400];
GetPlayerName(playerid, pname, 24);
format(msg, sizeof(msg), "%s (%d) bought %d bombs for %d CSCash each - Total Spent: %d CSCash - CSCash Left: %i - %02d/%02d/%02d - %02d:%02d:%02d", pname,playerid,bombs,BOMBPRICE * bombs,GetCash(playerid),Day,Month,Year,Hour,Minute,Second);
format(ok, sizeof(ok), "1,7%s (%d) bought %d bombs for %d CSCash each - Total Spent: %d CSCash - CSCash Left: %i - %02d/%02d/%02d - %02d:%02d:%02d", pname,playerid,bombs,BOMBPRICE * bombs,GetCash(playerid),Day,Month,Year,Hour,Minute,Second);
SendMessageToAdmins(0xA86EFC77, msg);
IRC_Say(gGroupID, IRC_ACHANNEL, ok);
ShopLog(msg);
pawn Код:
%s (%d) bought %d bombs for %d CSCash each - Total Spent: %d CSCash - CSCash Left: %i
Playername (id) bought 5 bombs (example) for 15000 CSCash each (already defined BOMBPRICE). Total Spent: It should do 15000 x 5 bombs = 75000
But it shows the "Total Spent" and "For %d CSCash each" with wrong values.
Whats wrong?