19.01.2014, 11:33
pawn Код:
CMD:lockb(playerid, params[])
{
new string[128], idx, done, lockdone;
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pBiz])
{
if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[PlayerInfo[playerid][pBiz]][bX], BizInfo[PlayerInfo[playerid][pBiz]][bY], BizInfo[PlayerInfo[playerid][pBiz]][bZ]))
{
if(!BizInfo[PlayerInfo[playerid][pBiz]][bStatus])
{
BizInfo[PlayerInfo[playerid][pBiz]][bStatus] = 1;
format(string, sizeof(string), "[Business ID: %d]\nBusiness Type: %s\nBusiness Owner: %s\nStatus: %s", PlayerInfo[playerid][pBiz], RBT(PlayerInfo[playerid][pBiz]), BizInfo[PlayerInfo[playerid][pBiz]][bOwner], RBS(PlayerInfo[playerid][pBiz]));
UpdateDynamic3DTextLabelText(BizInfo[PlayerInfo[playerid][pBiz]][bText], COLOR_WHITE, string);
format(string, sizeof(string), "* %s takes out their business keys and unlocks it.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
GameTextForPlayer(playerid, "~g~Business Unlocked", 3500, 3);
done = 0;
lockdone = 0;
}
else if(BizInfo[PlayerInfo[playerid][pBiz]][bStatus])
{
BizInfo[PlayerInfo[playerid][pBiz]][bStatus] = 0;
format(string, sizeof(string), "[Business ID: %d]\nBusiness Type: %s\nBusiness Owner: %s\nStatus: %s", PlayerInfo[playerid][pBiz], RBT(PlayerInfo[playerid][pBiz]), BizInfo[PlayerInfo[playerid][pBiz]][bOwner], RBS(PlayerInfo[playerid][pBiz]));
UpdateDynamic3DTextLabelText(BizInfo[PlayerInfo[playerid][pBiz]][bText], COLOR_WHITE, string);
format(string, sizeof(string), "* %s takes out their business keys and locks it.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
GameTextForPlayer(playerid, "~r~Business Locked", 3500, 3);
done = 1;
lockdone = 1;
}
}
}
return 1;
}