10.12.2016, 11:52
Hi.. i have problem, my script not working. i use /asellhouse, but i must use /sellbiz again to sell it.
PHP код:
CMD:asellbizz(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 99999 || PlayerInfo[playerid][pShopTech] == 0)
{
SendClientMessageEx(playerid,COLOR_WHITE,"Co Owner Admin Only or Shop Tech");
return 1;
}
new string[128], biz;
new businesstype[128];
if(sscanf(params, "d", biz)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /asellbiz [bizid]");
if(IsPlayerInRangeOfPoint(playerid, 3.0,BizzInfo[biz][bEntranceX],BizzInfo[biz][bEntranceY],BizzInfo[biz][bEntranceZ]))
{
if(PlayerInfo[BizzInfo[biz][bOwner]][pPBiskey2] == biz)
{
PlayerInfo[BizzInfo[biz][bOwner]][pPBiskey2] = 0;
return 1;
}
else if(PlayerInfo[BizzInfo[biz][bOwner]][pPBiskey] == biz)
{
PlayerInfo[BizzInfo[biz][bOwner]][pPBiskey] = 0;
}
if(BizzInfo[biz][bType] > 0)
{
if(BizzInfo[biz][bType] == 1) { businesstype = "24-7";}
else if(BizzInfo[biz][bType] == 2) { businesstype = "Clothes Store";}
else if(BizzInfo[biz][bType] == 3) { businesstype = "Club";}
else if(BizzInfo[biz][bType] == 4) { businesstype = "Ammunation";}
else if(BizzInfo[biz][bType] == 5) { businesstype = "Casino";}
else if(BizzInfo[biz][bType] == 6) { businesstype = "Restaurant";}
else if(BizzInfo[biz][bType] == 7) { businesstype = "Paintball";}
else if(BizzInfo[biz][bType] == 8) { businesstype = "Bank";}
else if(BizzInfo[biz][bType] == 9) { businesstype = "Electronic Store";}
else if(BizzInfo[biz][bType] == 10) { businesstype = "Equipment Store";}
else if(BizzInfo[biz][bType] == 11) { businesstype = "Sex shop";}
}
else
{
businesstype = "Not Available";
}
BizzInfo[biz][bOwned] = 0;
BizzInfo[biz][bLocked] = 1;
format(BizzInfo[biz][bOwner], 128, "Nobody" );
format(BizzInfo[biz][bMessage], 255, "Nothing" );
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SaveBusiness(biz);
DestroyDynamicPickup(BizzInfo[biz][bPickupID]);
BizzInfo[biz][bPickupID] = CreateDynamicPickup(1273, 23, BizzInfo[biz][bEntranceX], BizzInfo[biz][bEntranceY], BizzInfo[biz][bEntranceZ]);
DestroyDynamic3DTextLabel(business1[biz]);
format(string, sizeof(string), "{FF0000}[%s Sell Bizz]{0080FF}\nPrice: $%d\nLevel: %d\nBizz ID: %d\n/buybiz untuk membeli bizz", businesstype,BizzInfo[biz][bBuyPrice],BizzInfo[biz][bLevelNeeded], biz);
business2[biz] = CreateDynamic3DTextLabel(string, COLOR_WHITE, BizzInfo[biz][bEntranceX], BizzInfo[biz][bEntranceY], BizzInfo[biz][bEntranceZ]+0.75,10.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,0,-1,-1, 100.0);
}
SendClientMessageEx(playerid, COLOR_WHITE, "You need to be near your house(exterior) in order to sell it.");
return 1;
}