01.08.2013, 06:48
(
Последний раз редактировалось DJ_Shocker; 01.08.2013 в 16:06.
Причина: Updated Code to reflect some changes
)
This is a segment of code from the /ad command for players to run ads. The problems that I'm having are:
1. For business ID 38 (Los Santos CNN) the till will not go any higher than 23850, but what's even MORE strange is that it claims that it takes $100 for a 4 letter (1 word) ad, but if you run an ad and only 1 person runs 1 ad, it jumps from $0 in the til, to $23,850. It's supposed to calculate by the entrance fee the owner sets.
2. Business ID 39 (LV CNN) NOTHING goes into the CNN. You can run an ad all day, but it doesn't put the fee into the till.
Here's a segment of the code:
I appreciate any help
1. For business ID 38 (Los Santos CNN) the till will not go any higher than 23850, but what's even MORE strange is that it claims that it takes $100 for a 4 letter (1 word) ad, but if you run an ad and only 1 person runs 1 ad, it jumps from $0 in the til, to $23,850. It's supposed to calculate by the entrance fee the owner sets.
2. Business ID 39 (LV CNN) NOTHING goes into the CNN. You can run an ad all day, but it doesn't put the fee into the till.
Here's a segment of the code:
pawn Код:
if(PlayerToPoint(3.0,playerid,BizzInfo[38][bEntranceX], BizzInfo[38][bEntranceY], BizzInfo[38][bEntranceZ]) || PlayerToPoint(3.0,playerid,BizzInfo[39][bEntranceX], BizzInfo[39][bEntranceY], BizzInfo[39][bEntranceZ]))
{
new payout;
if(PlayerToPoint(3.0,playerid,BizzInfo[38][bEntranceX], BizzInfo[38][bEntranceY], BizzInfo[38][bEntranceZ])) payout = strlen(result) * BizzInfo[38][bEntranceCost]; else payout = strlen(result) * BizzInfo[39][bEntranceCost];
if(GetPlayerCash(playerid) < payout)
{
format(string, sizeof(string), "** You used %d characters, costing $%s, and you do not have this amount.", strlen(result), FormatNumber(payout));
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
GivePlayerCash(playerid, - payout/2);
if(PlayerToPoint(3.0,playerid,BizzInfo[39][bEntranceX], BizzInfo[39][bEntranceY], BizzInfo[39][bEntranceZ]))
{
GiveBizProfit(39, payout/2);
new query[120];
format(query, sizeof(query), "UPDATE biz SET bTill = %d WHERE bID = %d", BizzInfo[39][bTill], 39);
mysql_function_query(g_Handle, query, false, "SendQuery", "");
}
if(PlayerToPoint(3.0,playerid,BizzInfo[38][bEntranceX], BizzInfo[38][bEntranceY], BizzInfo[38][bEntranceZ]))
{
GiveBizProfit(38, payout/2);
new query[120];
format(query, sizeof(query), "UPDATE biz SET bTill = %d WHERE bID = %d", BizzInfo[38][bTill], 38);
mysql_function_query(g_Handle, query, false, "SendQuery", "");
}
format(string, sizeof(string), "Advertisement: %s, Name: %s (Phone: {FFFFFF}%d{18E139})", result, GetPlayerNameEx(playerid),PlayerInfo[playerid][pPnumber]);
OOCNews(CRISTIAN,string);
format(string, sizeof(string), "~r~You paid $%d~n~~w~The Message Contained: %d characters", payout, strlen(result));
GameTextForPlayer(playerid, string, 5000, 1);
AdTimer[playerid] = gettime() + 60;
}
}
return 1;
}