27.03.2014, 12:14
Use this code
pawn Код:
//Put this under OnGameModeInit
Textdraw0 = TextDrawCreate(446.000000, 366.000000, "Info~n~Owner: name_name~n~Business type~n~Status:~n~~r~Closed / Open");
TextDrawBackgroundColor(Textdraw0, 255);
TextDrawFont(Textdraw0, 1);
TextDrawLetterSize(Textdraw0, 0.500000, 1.000000);
TextDrawColor(Textdraw0, -1);
TextDrawSetOutline(Textdraw0, 0);
TextDrawSetProportional(Textdraw0, 1);
TextDrawSetShadow(Textdraw0, 1);
TextDrawUseBox(Textdraw0, 1);
TextDrawBoxColor(Textdraw0, 255);
TextDrawTextSize(Textdraw0, 612.000000, -9.000000);
//Replace your current function with this
public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
new string[256];
for(new b = 1;b < sizeof(BusinessInfo);b++)// Loopd through all the businesses again.
{
if(pickupid == BusinessInfo[b][bOutsideIcon])//Checks if it's a biz pickup.
{
if(BusinessInfo[b][bOwned] == 0)//Checks if it is owned.
{
format(string, sizeof(string), "~g~Name:~w~%s~n~~w~This business is ~g~for sale!~n~~r~Price:~g~%i~n~BizType:~w~%s~n~~g~BizID:~w~%i", BusinessInfo[b][bName], BusinessInfo[b][bPrice], BusinessType(b), b);//Formats a string with all the info.
TextDrawSetString(Textdraw0, string);
TextDrawShowForPlayer(playerid, Textdraw0);
}
if(BusinessInfo[b][bOwned] == 1)//Checks if it owned.
{
format(string, sizeof(string), "~g~Name:~w~%s~n~~g~Owner:~w~%s~n~~g~BizType:~w~%s ~n~~g~BizID:~w~%i", BusinessInfo[b][bName], BusinessInfo[b][bOwner], BusinessType(b), b);//Formats a string with all the info.
TextDrawSetString(Textdraw0, string);
TextDrawShowForPlayer(playerid, Textdraw0);
}
}
}
return 1;
}