business won't be created
#1

Код:
CODE HERE
When i type /createbusiness the dialog show, i choose the business type but after that the business won't be created, any help?
Reply
#2

send the code so you can see the error
Reply
#3

Quote:
Originally Posted by IgorLuiz
Посмотреть сообщение
send the code so you can see the error
CODE HERE
Reply
#4

are all now that does not appear?
show me the command.
Reply
#5

the code is above your post dude! Anyway yeah, with no one of the dialogbox choices are working
Reply
#6

make sure the dialog this goal to create businesses

Ex:
Код:
ShowPlayerDialog(playerid, check here, DIALOG_STYLE_LIST, "businesses:", BusinessList, "Selecionar", "Cancelar");
Reply
#7

Quote:
Originally Posted by IgorLuiz
Посмотреть сообщение
make sure the dialog this goal to create businesses

Ex:
Код:
ShowPlayerDialog(playerid, check here, DIALOG_STYLE_LIST, "businesses:", BusinessList, "Selecionar", "Cancelar");
the dialog menu is showing but if i choose something, nothing happen so i think is dialogbox fault...
Reply
#8

show me the command
Reply
#9

COMMAND:createbusiness(playerid, params[])
{
// If a player hasn't logged in properly, he cannot use this command
if (INT_IsPlayerLoggedIn(playerid) == 0) return 0;
// If the player has an insufficient admin-level (he needs level 5 or RCON admin), exit the command
// returning "SERVER: Unknown command" to the player
if (INT_CheckPlayerAdminLevel(playerid, 5) == 0) return 0;

// Setup local variables
new BusinessList[2000];

// 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, "Choose business-type:", BusinessList, "Select", "Cancel");
}
else
SendClientMessage(playerid, 0xFF0000FF, "You must be on foot to create a business");

// Let the server know that this was a valid command
return 1;
}



public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
// Select the proper dialog to process
switch (dialogid)
{
case DialogCreateBusSelType: Dialog_CreateBusSelType(playerid, response, listitem);
case DialogBusinessMenu: Dialog_BusinessMenu(playerid, response, listitem);
case DialogGoBusiness: Dialog_GoBusiness(playerid, response, listitem);
case DialogBusinessNameChange: Dialog_ChangeBusinessName(playerid, response, inputtext); // Change the name of your business
case DialogSellBusiness: Dialog_SellBusiness(playerid, response); // Sell the business
}

return 0;
}




if u need more feel free to ask
Reply
#10

replace with these and see

command
PHP код:
// Lets the player add new businesses
COMMAND:createbusiness(playeridparams[])
{
    
// Setup local variables
    
new BusinessList[2000];
    
// If a player hasn't logged in properly, he cannot use this command
    
if (INT_IsPlayerLoggedIn(playerid) == 0) return 0;
    
// If the player has an insufficient admin-level (he needs level 5 or RCON admin), exit the command
    // returning "SERVER: Unknown command" to the player
    
if (INT_CheckPlayerAdminLevel(playerid5) == 0) return 0;
    
// Check if the player has logged in
    
if (APlayerData[playerid][LoggedIn] == true)
    {
        
// Check if the player isn't inside a vehicle
        
if (GetPlayerVehicleSeat(playerid) == -1)
        {
            
// Construct the list of businesses
            
for (new BusType 1BusType sizeof(ABusinessInteriors); BusType++)
            {
                
format(BusinessListsizeof(BusinessList), "%s%s\n"BusinessListABusinessInteriors[BusType][InteriorName]);
            }
            
// Let the player choose a business-type via a dialog
            
ShowPlayerDialog(playeridDialogCreateBusSelTypeDIALOG_STYLE_LIST"Escolha o Tipo de Empresa:"BusinessList"Selecionar""Cancelar");
        }
        else
            
SendClientMessage(playerid0xFF0000FF"You must be on foot to create a business");
    }
    else
        return 
0;
    
// Let the server know that this was a valid command
    
return 1;

Business
PHP код:
new ABusinessInteriors[][TBusinessType] =
{
    {
"Dummy",                 0,         0.0,         0.0,         0.0,        0,            0,        0}, // Dummy business (Type 0)
    
{"24/7 (pequeno)",         6,         -26.75,     -55.75,     1003.6,        500000,        200,        52}, // Type 1 (earnings per day: $1200)
    
{"24/7 (Medio)",         18,     -31.0,         -89.5,         1003.6,        750000,        250,        52}, // Type 2 (earnings per day: $1800)
    
{"Bar",                 11,     502.25,     -69.75,     998.8,        350000,        150,        49}, // Type 3 (earnings per day: $840)
    
{"Barbearia (pequena)",         2,         411.5,         -21.25,     1001.8,        300000,        160,        7}, // Type 4 (earnings per day: $720)
    
{"Barbearia (Medio)",        3,         418.75,     -82.5,         1001.8,        350000,        180,        7}, // Type 5 (earnings per day: $840)
    
{"Loja de apostas",         3,         833.25,     7.0,         1004.2,        1500000,    400,    52}, // Type 6 (earnings per day: $3600)
    
{"Burger Shot",         10,     363.5,         -74.5,         1001.5,        750000,        300,        10}, // Type 7 (earnings per day: $1800)
    
{"Casino (4 Dragons)",     10,     2017.25,     1017.75,     996.9,        2500000,    1000,    44}, // Type 8 (earnings per day: $6000)
    
{"Casino (Caligula's)"1,         2234.0,     1710.75,     1011.3,        2500000,    1000,    25}, // Type 9 (earnings per day: $6000)
    
{"Casino (Small)",         12,     1133.0,     -9.5,         1000.7,        2000000,    900,    43}, // Type 10 (earnings per day: $4800)
    
{"Loja de Roupas (Binco)",     15,     207.75,     -109.0,     1005.2,        850000,        300,        45}, // Type 11 (earnings per day: $2040)
    
{"Loja de Roupas (Pro)",         3,         207.0,         -138.75,     1003.5,        850000,        300,        45}, // Type 12 (earnings per day: $2040)
    
{"Loja de Roupas (Urban)",     1,         203.75,     -48.5,         1001.8,        850000,        300,        45}, // Type 13 (earnings per day: $2040)
    
{"Loja de Roupas (Victim)",     5,         226.25,     -7.5,         1002.3,        850000,        300,        45}, // Type 14 (earnings per day: $2040)
    
{"Loja de Roupas (ZIP)",        18,     161.5,         -92.25,     1001.8,        850000,        300,        45}, // Type 15 (earnings per day: $2040)
    
{"Cluckin' Bell",        9,        365.75,     -10.75,      1001.9,        750000,        180,        14}, // Type 16 (earnings per day: $1800)
    
{"Disco (pequeno)",         17,     492.75,        -22.0,         1000.7,        1000000,    250,    48}, // Type 17 (earnings per day: $2400)
    
{"Disco (grande)",         3,         -2642.0,     1406.5,     906.5,        1200000,    350,    48}, // Type 18 (earnings per day: $2880)
    
{"Academia (LS)",             5,         772.0,         -3.0,         1000.8,        500000,        350,        54}, // Type 19 (earnings per day: $1200)
    
{"Academia (SF)",             6,         774.25,     -49.0,         1000.6,        500000,        350,        54}, // Type 20 (earnings per day: $1200)
    
{"Academia (LV)",             7,         774.25,     -74.0,         1000.7,        500000,        350,        54}, // Type 21 (earnings per day: $1200)
    
{"Motel",                 15,     2216.25,     -1150.5,     1025.8,        1000000,    700,    37}, // Type 22 (earnings per day: $2400)
    
{"RC shop",             6,         -2238.75,     131.0,         1035.5,        600000,        189,        46}, // Type 23 (earnings per day: $1440)
    
{"Sex-shop",             3,         -100.25,     -22.75,     1000.8,        800000,        240,        38}, // Type 24 (earnings per day: $1920)
    
{"Matadouro",         1,         933.75,     2151.0,     1011.1,        500000,        250,        50}, // Type 25 (earnings per day: $1200)
    
{"Stadio (Bloodbowl)"15,     -1394.25,     987.5,         1024.0,        1750000,    350,    33}, // Type 26 (earnings per day: $4200)
    
{"Stadio (Kickstart)"14,     -1410.75,     1591.25,     1052.6,        1750000,    350,    33}, // Type 27 (earnings per day: $4200)
    
{"Stadio (8-Track)",     7,         -1396.0,     -208.25,     1051.2,        1750000,    350,    33}, // Type 28 (earnings per day: $4200)
    
{"Stadio (Dirt Bike)"4,         -1425.0,     -664.5,     1059.9,        1750000,    350,    33}, // Type 29 (earnings per day: $4200)
    
{"Clube de Strip (pequeno)",31212.75,    -30.01001.075000012048},    // Tipo 30 (ganhos por dia: R$2880)
    
{"Clube de Strip (grande)",21204.75, -12.51001.090000015048},     // Tipo 31 (ganhos por dia: R$3600)
    
{"Tattoo LS",16, -203.0, -24.251002.350000010039},                  // Tipo 32 (ganhos por dia: R$2400)
    
{"Pizzaria",5372.25, -131.501001.565000020029},                   // Tipo 33 (ganhos por dia: R$4800)
    
{"Posto",181302.519897, -1.7875101001.02825980000050055},          // Tipo 34 (ganhos por dia: R$12000)      
    
{"Hotel",181710.433715, -1669.37927220.22504975000045032},         // Tipo 35 (ganhos por dia: R$10800)      
    
{"Banco",0,2319.714843, -14.83836126.749565100000080052},    
    {
"Oficina",0,-1790.378295,1436.949829,7.18750060000035027},    
    {
"Transportadora",1,1412.639892,-1.787510,1000.92437780000060051}
}; 
Dialog
PHP код:
// This dialog processes the chosen business-type and creates the business
Dialog_CreateBusSelType(playeridresponselistitem)
{
    
// Just close the dialog if the player clicked "Cancel"
    
if(!response) return 1;
    
// Setup some local variables
    
new BusTypeBusIDFloat:xFloat:yFloat:zMsg[128], bool:EmptySlotFound false;
    
// Get the player's position
    
GetPlayerPos(playeridxyz);
    
// Get the business-type from the option the player chose
    
BusType listitem 1;
    
// Find a free business-id
    
for (BusID 1BusID MAX_BUSINESSBusID++)
    {
        
// Check if this business ID is free
        
if (ABusinessData[BusID][BusinessType] == 0)
        {
            
EmptySlotFound true;
            break; 
// Stop processing
        
}
    }
    
// Check if an empty slot has been found
    
if (EmptySlotFound == false)
    {
        
// If no empty slot was found, let the player know about it and exit the function
        
SendClientMessage(playerid0xFFFFFFFF"{FF0000}Numero mбximo de empresas atingido");
        return 
1;
    }
    
// Set some default data at the index of NextFreeBusinessID (NextFreeBusinessID will point to the next free business-index)
    
ABusinessData[BusID][BusinessX] = x;
    
ABusinessData[BusID][BusinessY] = y;
    
ABusinessData[BusID][BusinessZ] = z;
    
ABusinessData[BusID][BusinessType] = BusType;
    
ABusinessData[BusID][BusinessLevel] = 1;
    
ABusinessData[BusID][Owned] = false;
    
// Add the pickup and 3DText at the location of the business-entrance (where the player is standing when he creates the business)
    
Business_CreateEntrance(BusID);
    
// Save the business
    
BusinessFile_Save(BusID);
    
// Inform the player that he created a new house
    
format(Msg128"{00FF00}You've succesfully created business {FFFF00}%i{00FF00}"BusID);
    
SendClientMessage(playerid0xFFFFFFFFMsg);
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)