Quote:
Originally Posted by MultiKill
Poste o codigo na parte onde cria a Pickup.
|
pawn Код:
Business_CreateEntrance(BusID)
{
// Setup local variables
new Msg[128], Float:x, Float:y, Float:z, BusType, Icon;
// Get the coordinates of the house's pickup (usually near the door)
x = ABusinessData[BusID][BusinessX];
y = ABusinessData[BusID][BusinessY];
z = ABusinessData[BusID][BusinessZ];
// Get the business-type and icon
BusType = ABusinessData[BusID][BusinessType];
Icon = ABusinessInteriors[BusType][IconID];
// Add a dollar-sign to indicate this business
ABusinessData[BusID][PickupID] = CreateDynamicPickup(1274, 1, x, y, z, 0);
// Add a map-icon depending on which type the business is
ABusinessData[BusID][MapIconID] = CreateDynamicMapIcon(x, y, z, Icon, 0, 0, 0, -1, 150.0);
// Add a new 3DText at the business's location (usually near the door)
if (ABusinessData[BusID][Owned] == true)
{
// Create the 3DText that appears above the business-pickup (displays the businessname, the name of the owner and the current level)
format(Msg, 128, TXT_PickupBusinessOwned, ABusinessData[BusID][BusinessName], ABusinessData[BusID][Owner], ABusinessData[BusID][BusinessLevel]);
ABusinessData[BusID][DoorText] = CreateDynamic3DTextLabel(Msg, 0x008080FF, x, y, z + 1.0, 50.0);
}
else
{
// Create the 3DText that appears above the business-pickup (displays the price of the business and the earnings)
format(Msg, 128, TXT_PickupBusinessForSale, ABusinessInteriors[BusType][InteriorName], ABusinessInteriors[BusType][BusPrice], ABusinessInteriors[BusType][BusEarnings]);
ABusinessData[BusID][DoorText] = CreateDynamic3DTextLabel(Msg, 0x008080FF, x, y, z + 1.0, 50.0);
}
}
/criarempresa:
pawn Код:
COMMAND:criarempresa(playerid, params[])
{
// Setup local variables
new BusinessList[2000];
// Send the command to all admins so they can see it
SendAdminText(playerid, "/criarempresa", params);
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player's admin-level is at least 5
if (APlayerData[playerid][PlayerLevel] >= 5)
{
// Check if the player isn't inside a vehicle
if (GetPlayerVehicleSeat(playerid) == -1)
{
// Construct the list of businesses
for (new BusType = 1; BusType < sizeof(ABusinessInteriors); BusType++)
{
format(BusinessList, sizeof(BusinessList), "%s%s\n", BusinessList, ABusinessInteriors[BusType][InteriorName]);
}
// Let the player choose a business-type via a dialog
ShowPlayerDialog(playerid, DialogCreateBusSelType, DIALOG_STYLE_LIST, "Escolha o tipo de empresa:", BusinessList, "Selecionar", "Cancelar");
}
else
SendClientMessage(playerid, 0xFF0000FF, "[AMC] Vocк nгo pode criar uma empresa e dentro de um veнculo.");
}
}
else
return 0;
// Let the server know that this was a valid command
return 1;
}