03.07.2015, 19:25
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
{
// 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