forward Business_TransactionTimer();
public Business_TransactionTimer()
{
// Increase the variable by one
BusinessTransactionTime++;
// And save it to the file
BusinessTime_Save();
}
// This function sets ownership to the given player
Business_SetOwner(playerid, BusID)
{
// Setup local variables
new BusSlotFree, Name[24], Msg[128], BusType;
// Get the first free business-slot from this player
BusSlotFree = Player_GetFreeBusinessSlot(playerid);
// Check if the player has a free business-slot
if (BusSlotFree != -1)
{
// Get the player's name
GetPlayerName(playerid, Name, sizeof(Name));
// Store the business-id for the player
APlayerData[playerid][Business][BusSlotFree] = BusID;
// Get the business-type
BusType = ABusinessData[BusID][BusinessType];
// Let the player pay for the business
RewardPlayer(playerid, -ABusinessInteriors[BusType][BusPrice], 0);
// Set the business as owned
ABusinessData[BusID][Owned] = true;
// Store the owner-name for the business
format(ABusinessData[BusID][Owner], 24, Name);
// Set the level to 1
ABusinessData[BusID][BusinessLevel] = 1;
// Set the default business-name
format(ABusinessData[BusID][BusinessName], 100, ABusinessInteriors[BusType][InteriorName]);
// Store the current transaction-time (this is used so the player can only retrieve cash from the business from the moment he bought it)
ABusinessData[BusID][LastTransaction] = BusinessTransactionTime;
// Also, update 3DText of this business
Business_UpdateEntrance(BusID);
// Save the player-file (and also his houses/businesses)
PlayerFile_Save(playerid);
// Let the player know he bought the business
format(Msg, 128, TXT_PlayerBoughtBusiness, ABusinessInteriors[BusType][BusPrice]);
SendClientMessage(playerid, 0xFFFFFFFF, Msg);
}
else
SendClientMessage(playerid, 0xFFFFFFFF, TXT_PlayerOwnsMaxBusinesses);
return 1;
}
// This function pays the current earnings of the given business to the player
Business_PayEarnings(playerid, BusID)
{
new Msg[2000];
new BusType = ABusinessData[BusID][BusinessType];
new Earnings = (BusinessTransactionTime + ABusinessData[BusID][LastTransaction]) * ABusinessInteriors[BusType][BusEarnings] * ABusinessData[BusID][BusinessLevel];
ABusinessData[BusID][LastTransaction] = BusinessTransactionTime;
RewardPlayer(playerid, Earnings, 0);
format(Msg, 2000, "{a9c4e4}Vocк ganhou na sua empresa {00ff00}R${ffffff}%i{a9c4e4} desde a sua ъltima retirada.", Earnings);
SendClientMessage(playerid, 0xFFFFFFFF, Msg);
}
|
Onde estб o GivePlayerMoney? se nгo estou enganado era para dar dinheiro ao proprietario correto? teria que ter o GivePlayerMoney..
Se nгo conseguir ainda me chama no Skype > live:nasser.tornado |
|
PPC_Business |