04.04.2015, 01:37
(
Последний раз редактировалось jaycenter; 04.04.2015 в 03:21.
)
PHP код:
CMD:businessedit(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 133
{
SendClientMessageEx(playerid, COLOR_GRAD2, "Ban khong du kha nang de su dung lenh nay`.");
return 1;
}
new string[128], choice[32], szid, amount;
if(sscanf(params, "s[32]dd", choice, szid, amount))
{
SendClientMessageEx(playerid, COLOR_GREY, "SUDUNG: /businessedit [name] [ID Cua hang] [(Optional)amount]");
SendClientMessageEx(playerid, COLOR_GREY, "Available names: Exterior, Interior, CustomInterior, Kieu");
return 1;
}
if(strcmp(choice, "exterior", true) == 0)
{
GetPlayerPos(playerid, BusinessInfo[szid][bExteriorX], BusinessInfo[szid][bExteriorY], BusinessInfo[szid][bExteriorZ]);
SendClientMessageEx( playerid, COLOR_WHITE, "Ban da chinh sua exterior Cua hang!" );
format(string, sizeof(string), "%s da chinh sua exterior Cua hang (ID %d).", GetPlayerNameEx(playerid), szid);
Log("logs/business.log", string);
DestroyPickupEx(BusinessInfo[szid][bPickupID]);
DestroyDynamic3DTextLabel(BusinessInfo[szid][bTextID]);
if(BusinessInfo[szid][bOwned])
{
if(BusinessInfo[szid][bKieu] == 1)
{
format(string, sizeof(string), "{FFFFFF}Cua Hang Pizza(ID: %d)\nSo huu: %s\n{24D12F}Dang xay dung",szid,BusinessInfo[szid][bOwner]);
}
else
{
format(string, sizeof(string), "{FFFFFF}Cua Hang(ID: %d)\nSo huu: %s\n{24D12F}Dang xay dung",szid,BusinessInfo[szid][bOwner]);
}
}
else
{
if(BusinessInfo[szid][bKieu] == 1)
{
format(string, sizeof(string), "{FFFFFF}Cua Hang Pizza(ID: %d)\n{24D12F}Duoc ban voi gia $%d",szid,BusinessInfo[szid][bValue]);
}
else
{
format(string, sizeof(string), "{FFFFFF}Cua Hang(ID: %d)\n{24D12F}Duoc ban voi gia $%d",szid,BusinessInfo[szid][bValue]);
}
}
if(BusinessInfo[szid][bKieu] == 1)
{
BusinessInfo[szid][bPickupID] = CreatePickupEx(1582, 23, BusinessInfo[szid][bExteriorX], BusinessInfo[szid][bExteriorY], BusinessInfo[szid][bExteriorZ]);
BusinessInfo[szid][bTextID] = CreateDynamic3DTextLabel(string, COLOR_WHITE, BusinessInfo[szid][bExteriorX], BusinessInfo[szid][bExteriorY], BusinessInfo[szid][bExteriorZ]+0.5,30.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 30.0);
}
else
{
BusinessInfo[szid][bPickupID] = CreatePickupEx(1274, 23, BusinessInfo[szid][bExteriorX], BusinessInfo[szid][bExteriorY], BusinessInfo[szid][bExteriorZ]);
BusinessInfo[szid][bTextID] = CreateDynamic3DTextLabel(string, COLOR_WHITE, BusinessInfo[szid][bExteriorX], BusinessInfo[szid][bExteriorY], BusinessInfo[szid][bExteriorZ]+0.5,30.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 30.0);
}
SaveBusiness();
}
else if(strcmp(choice, "interior", true) == 0)
{
GetPlayerPos(playerid, BusinessInfo[szid][bInteriorX], BusinessInfo[szid][bInteriorY], BusinessInfo[szid][bInteriorZ]);
GetPlayerFacingAngle(playerid, BusinessInfo[szid][bInteriorA]);
SendClientMessageEx( playerid, COLOR_WHITE, "Ban da chinh sua interior Cua hang!" );
SaveBusiness();
format(string, sizeof(string), "%s da chinh sua interior Cua hang (ID %d).", GetPlayerNameEx(playerid), szid);
Log("logs/business.log", string);
BusinessInfo[szid][bInt] = GetPlayerInterior(playerid);
SaveBusiness();
}
else if(strcmp(choice, "custominterior", true) == 0)
{
BusinessInfo[szid][bCustomInterior] = amount;
SendClientMessageEx( playerid, COLOR_WHITE, "Ban da chinh sua custom interior Cua hang." );
format(string, sizeof(string), "%s da chinh sua custom interior Cua Hang (ID %d).", GetPlayerNameEx(playerid), szid);
Log("logs/hedit.log", string);
SaveBusiness();
}
else if(strcmp(choice, "kieu", true) == 0)
{
if(amount == 0)
{
SendClientMessageEx( playerid, COLOR_WHITE, "Ban da xoa kieu cua hang!" );
format(string, sizeof(string), "%s da xoa kieu Cua hang (ID %d).", GetPlayerNameEx(playerid), szid);
Log("logs/business.log", string);
DestroyPickupEx(BusinessInfo[szid][bPickupID]);
DestroyDynamic3DTextLabel(BusinessInfo[szid][bTextID]);
format(string, sizeof(string), "{FFFFFF}Cua Hang(ID: %d)\n{24D12F}Dang xay dung",szid);
BusinessInfo[szid][bTextID] = CreateDynamic3DTextLabel( string, COLOR_WHITE, BusinessInfo[szid][bExteriorX], BusinessInfo[szid][bExteriorY], BusinessInfo[szid][bExteriorZ]+0.5,10.0, .testlos = 1, .streamdistance = 10.0);
BusinessInfo[szid][bPickupID] = CreatePickupEx(1274, 23, BusinessInfo[szid][bExteriorX], BusinessInfo[szid][bExteriorY], BusinessInfo[szid][bExteriorZ]);
BusinessInfo[szid][bKieu] = 0;
}
if(amount == 1)
{
SendClientMessageEx( playerid, COLOR_WHITE, "Ban da chinh kieu cua hang la Cua hang Pizza!" );
format(string, sizeof(string), "%s da xoa kieu Cua hang (ID %d).", GetPlayerNameEx(playerid), szid);
Log("logs/business.log", string);
DestroyPickupEx(BusinessInfo[szid][bPickupID]);
DestroyDynamic3DTextLabel(BusinessInfo[szid][bTextID]);
format(string, sizeof(string), "{FFFFFF}Cua Hang Pizza(ID: %d)\n{24D12F}Dang xay dung",szid);
BusinessInfo[szid][bTextID] = CreateDynamic3DTextLabel( string, COLOR_WHITE, BusinessInfo[szid][bExteriorX], BusinessInfo[szid][bExteriorY], BusinessInfo[szid][bExteriorZ]+0.5,10.0, .testlos = 1, .streamdistance = 10.0);
BusinessInfo[szid][bPickupID] = CreatePickupEx(1582, 23, BusinessInfo[szid][bExteriorX], BusinessInfo[szid][bExteriorY], BusinessInfo[szid][bExteriorZ]);
BusinessInfo[szid][bKieu] = 1;
}
SaveBusiness();
}
SaveBusiness();
return 1;
}
Someone help me fix please....
TY!!