01.01.2017, 12:28
Try this. The error explains all.
PHP код:
CMD:editbiz(playerid, params[])
{
new Usage[128], id, string[ 128 ];
if( sscanf( params, "ds[128]", id, Usage) )
{
if( PlayerInfo[playerid][pAdmin] >= 9)
{
SendClientMessage( playerid, COLOR_WHITE, "USAGE: /movebiz [businessid] [name]" );
SendClientMessage( playerid, COLOR_GREY, "Available Names: Exterior, Interior" );
}
}
else
{
if( PlayerInfo[playerid][pAdmin] >= 9)
{
format( string, sizeof( string ), "Businesses/Business_%d.ini", id);
if(strcmp(Usage, "exterior", true) == 0 )
{
if(!dini_Exists(string))
{
SendClientMessage( playerid, COLOR_GREY, "Invalid Business ID!" );
return 1;
}
else
{
BizzInfo[id][bExteriorID] = GetPlayerInterior( playerid );
GetPlayerPos( playerid, BizzInfo[id][bEntranceX], BizzInfo[id][bEntranceY], BizzInfo[id][bEntranceZ]);
if(BizzInfo[id][bOwned] == 1)
{
new i = id;
DestroyDynamicPickup(BizzInfo[id][bPickupID]);
DestroyDynamic3DTextLabel(business1[id]);
BizzInfo[id][bPickupID] = CreateDynamicPickup(19133, 23, BizzInfo[id][bEntranceX], BizzInfo[id][bEntranceY], BizzInfo[id][bEntranceZ], 0, -1, -1, 150.0 );
format(string, sizeof(string), "{FF0000}[%s]\n"YELLOW_E"Owner: %s\n"GREEN_E"%s\n"YELLOW_E"Status : %s\n"GREEN_E"Bizz ID: %d",BT(id), BizzInfo[i][bOwner], BizzInfo[i][bMessage],BL(id),i);
business1[id] = CreateDynamic3DTextLabel(string, COLOR_WHITE, BizzInfo[id][bEntranceX], BizzInfo[id][bEntranceY], BizzInfo[id][bEntranceZ]+0.75,10.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,0,-1,-1, 100.0);
}
else
{
DestroyDynamicPickup(BizzInfo[id][bPickupID]);
DestroyDynamic3DTextLabel(business2[id]);
BizzInfo[id][bPickupID] = CreateDynamicPickup(19133, 23, BizzInfo[id][bEntranceX], BizzInfo[id][bEntranceY], BizzInfo[id][bEntranceZ], 0, -1, -1, 150.0 );
format(string, sizeof(string), "{FF0000}[%s Dijual]\n"YELLOW_E"Harga: $%d\n"GREEN_E"Level: %d\n"YELLOW_E"Bizz ID: %d\n((/buybiz)) ", BT(id),BizzInfo[id][bBuyPrice],BizzInfo[id][bLevelNeeded], id);
business2[id] = CreateDynamic3DTextLabel(string, COLOR_WHITE, BizzInfo[id][bEntranceX], BizzInfo[id][bEntranceY], BizzInfo[id][bEntranceZ]+0.75,10.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,0,-1,-1, 100.0);
}
SendClientMessage( playerid, COLOR_WHITE, "Exterior changed!" );
SaveBusiness(id);
}
}
else if(strcmp(Usage, "interior", true) == 0 )
{
if(!dini_Exists(string))
{
SendClientMessage( playerid, COLOR_GREY, "Invalid Business ID!" );
return 1;
}
else
{
GetPlayerPos( playerid, BizzInfo[id][bExitX], BizzInfo[id][bExitY], BizzInfo[id][bExitZ]);
BizzInfo[id][bInteriorID] = GetPlayerInterior( playerid );
SendClientMessage( playerid, COLOR_WHITE, "Interior changed!" );
SaveBusiness(id);
}
}
}
}
return 1;
}