01.01.2013, 19:00
hey guys
i made when player buy stocks for his business it increase in scriptfile, but 2 problems i need help with them
1. for example i bought 1600 stocks, then i bought 10 stocks, in the script files it will be 10 stocks
2. yeah it's saved in scriptfile but it isn't getting loaded after restart
CODE:
i made when player buy stocks for his business it increase in scriptfile, but 2 problems i need help with them
1. for example i bought 1600 stocks, then i bought 10 stocks, in the script files it will be 10 stocks
2. yeah it's saved in scriptfile but it isn't getting loaded after restart
CODE:
pawn Код:
if(playerinbiz(playerid))
{
if(strcmp(text,"5",true)==0)
{
if(BusinessInfo[GetPlayerBusinessID(playerid)][BizBalance]>=400)
{
BusinessInfo[GetPlayerBusinessID(playerid)][BizBalance] -=400;
GivePlayerMoneyEx(playerid, -400);
SendClientMessage(playerid, Green, "You have purchased 800 stocks for your business and paid $400");
BusinessInfo[GetPlayerBusinessID(playerid)][BizStock] += 800;
}
else SendClientMessage(playerid, COLOR_RED, "You don't have enough money in your business account to buy this amount of stocks.");
}
else if(strcmp(text,"6", true)==0)
{
if(BusinessInfo[GetPlayerBusinessID(playerid)][BizBalance]>=800)
{
BusinessInfo[GetPlayerBusinessID(playerid)][BizBalance] -=800;
GivePlayerMoneyEx(playerid, -800);
SendClientMessage(playerid, Green, "You have purchased 1600 stocks for your business and paid $800");
BusinessInfo[GetPlayerBusinessID(playerid)][BizStock] += 1600;
}
else SendClientMessage(playerid, COLOR_RED, "You don't have enough money in your business account to buy this amount of stocks.");
}
format(ffile,sizeof(ffile),"Business/%i.ini",GetPlayerBusinessID(playerid));
dini_Set(ffile, "BizStock",BusinessInfo[GetPlayerBusinessID(playerid)][BizStock]);
format(ffile,sizeof(ffile),"Business/%i.ini",GetPlayerBusinessID(playerid));
dini_Set(ffile, "BizBalance",BusinessInfo[GetPlayerBusinessID(playerid)][BizBalance]);
return 0;
}