format(string, sizeof(string), "* %s pushes the door and enters the shop.", RPN(playerid));
for(new idx=1; idx<MAX_BIZ; idx++)
{
if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]))
{
if(!BizInfo[idx][bStatus] && PlayerInfo[playerid][pBiz] != idx && !PlayerInfo[playerid][pVBiz]) return SendClientMessage(playerid, COLOR_GREY, "This business is closed.");
if(BizInfo[idx][bType] == 1) // 24/7 Business
{
format(string, sizeof(string), "* %s pushes the door and enters the shop.", RPN(playerid));
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPlayerPos(playerid, -25.884498,-185.868988,1003.546875);
SetPlayerFacingAngle(playerid, 357.5915);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 17);
SetPlayerVirtualWorld(playerid, idx+6000);
format(string, sizeof(string), "** Welcome to %s's 24/7 Market (( /buy )) **", BizInfo[idx][bOwner]);
SendClientMessage(playerid, COLOR_ORANGE, string);
return 1;
}
new string[150];
for(new idx=1; idx<MAX_BIZ; idx++)
{
if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]))
{
if(!BizInfo[idx][bStatus] && PlayerInfo[playerid][pBiz] != idx && !PlayerInfo[playerid][pVBiz]) return SendClientMessage(playerid, COLOR_GREY, "This business is closed.");
if(BizInfo[idx][bType] == 1) // 24/7 Business
{
new string[150];
format(string, sizeof(string), "* %s pushes the door and enters the shop.", RPN(playerid));
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPlayerPos(playerid, -25.884498,-185.868988,1003.546875);
SetPlayerFacingAngle(playerid, 357.5915);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 17);
SetPlayerVirtualWorld(playerid, idx+6000);
format(string, sizeof(string), "** Welcome to %s's 24/7 Market (( /buy )) **", BizInfo[idx][bOwner]);
SendClientMessage(playerid, COLOR_ORANGE, string);
return 1;
}
pawn Код:
|
format(BizInfo[idx][bOwner], 32, "%s", RPNU(playerid));
format(string, sizeof(string), "%s\n\n{FFFFFF}%s\nOwner: %s\nID: %d", RBS(idx), RBT(idx), BizInfo[idx][bOwner], idx);
UpdateDynamic3DTextLabelText(BizInfo[idx][bText], COLOR_WHITE, string);
SendClientMessage(playerid, COLOR_GREEN, " You have successfully bought a business.");
SendClientMessage(playerid, COLOR_WHITE, " Type /bizhelp to view your business commands.");
format(string, sizeof(string), "%s has bought business id %d.", RPN(playerid), idx);
Log("logs/business.log", string);
idx = MAX_BIZ;
done = 1;
SaveBiz();
}
if(idx == MAX_BIZ-1 && !done)
{
SendClientMessage(playerid, COLOR_GREY, "This business is owned by someone else.");
}
}
if(idx == MAX_BIZ-1 && !done)
{
SendClientMessage(playerid, COLOR_GREY, "You are not near a buyable business.");
}
}
return 1;
}
CMD:sellbiztomarket(playerid, params[])
{
new string[128];
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!PlayerInfo[playerid][pBiz] && !PlayerInfo[playerid][pVBiz]) return SendClientMessage(playerid, COLOR_GREY, "You don't own a business.");
if(sscanf(params, "s[8]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sellbiztomarket [confirm]");
if(!strcmp(params, "confirm", true))
{
new done;
if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[PlayerInfo[playerid][pBiz]][bX], BizInfo[PlayerInfo[playerid][pBiz]][bY], BizInfo[PlayerInfo[playerid][pBiz]][bZ]))
{
GiveZaiatMoney(playerid, (75*BizInfo[PlayerInfo[playerid][pBiz]][bPrice])/100);
BizInfo[PlayerInfo[playerid][pBiz]][bStatus] = 0;
format(BizInfo[PlayerInfo[playerid][pBiz]][bOwner], 32, "The State");
format(string, sizeof(string), "%s\n\n{FFFFFF}%s\nOwner: %s\nID: %d", RBS(PlayerInfo[playerid][pBiz]), RBT(PlayerInfo[playerid][pBiz]), BizInfo[PlayerInfo[playerid][pBiz]][bOwner], PlayerInfo[playerid][pBiz]);
UpdateDynamic3DTextLabelText(BizInfo[PlayerInfo[playerid][pBiz]][bText], COLOR_WHITE, string);
SendClientMessage(playerid, COLOR_GREEN, " You have successfully sold your business to The State. (75 percent of original price was paid back)");
format(string, sizeof(string), "%s has sold business id %d to the market.", RPN(playerid), PlayerInfo[playerid][pBiz]);
Log("logs/business.log", string);
PlayerInfo[playerid][pBiz] = 0;
done = 1;
}
if(!done)
{
new idx = PlayerInfo[playerid][pVBiz];
if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]))
{
GiveZaiatMoney(playerid, (75*BizInfo[idx][bPrice])/100);
BizInfo[idx][bStatus] = 0;
format(BizInfo[idx][bOwner], 32, "The State");
format(string, sizeof(string), "%s\n\n{FFFFFF}%s\nOwner: %s\nID: %d", RBS(idx), RBT(idx), BizInfo[idx][bOwner], idx);
UpdateDynamic3DTextLabelText(BizInfo[idx][bText], COLOR_WHITE, string);
SendClientMessage(playerid, COLOR_GREEN, " You have successfully sold your business to The State. (75 percent of original price was paid back)");
format(string, sizeof(string), "%s has sold business id %d to the market.", RPN(playerid), idx);
Log("logs/business.log", string);
PlayerInfo[playerid][pVBiz] = 0;
done = 1;
SaveBiz();
}
RPN(playerid)
{
new Name[ MAX_PLAYER_NAME ], i = -1;
GetPlayerName( playerid, Name, MAX_PLAYER_NAME );
while( Name[ ++i ] )
if( Name[ i ] == '_' )
Name[ i ] = ' ';
return Name;
}
OK I see where you at, you have copy-pasted from somewhere and expect to work :/
You can't copy-paste, you should adjust other codes to your scripts.. I can give you RPN function but it won't help you alot ( but will fix 90% errors showed in screenshot ) pawn Код:
|