12.06.2018, 03:21
I made 2 commands /mask, sellbusiness
the mask have a problem that's when i bought a mask from 24/7 then i type /mask it says you put the mask off and when i type it again it says you don't have a mask. I really don't know what's the problem.
I want the mask command to be work like if you bought a mask you can toggle it on/off here is the codes:
/sellbusiness is that when you bought a biz and you want to sell it its say you are not near a biz or this is not your business.
Codes:
the mask have a problem that's when i bought a mask from 24/7 then i type /mask it says you put the mask off and when i type it again it says you don't have a mask. I really don't know what's the problem.
I want the mask command to be work like if you bought a mask you can toggle it on/off here is the codes:
pawn Код:
CMD:mask(playerid, params[])
{
if(pInfo[playerid][pMask] == 0)
return SendClientMessage(playerid, -1, "You don't have a mask");
new string[128];
switch (pInfo[playerid][pMask])
{
case 0:
{
SendClientMessage(playerid, -1, "You have put a mask on.");
pInfo[playerid][pMask] = 1;
}
case 1:
{
SendClientMessage(playerid, -1, "You have put a mask off.");
pInfo[playerid][pMask] = 0;
}
}
return 1;
}
/sellbusiness is that when you bought a biz and you want to sell it its say you are not near a biz or this is not your business.
Codes:
pawn Код:
CMD:sellbusiness(playerid, params[])
{
new bool:biz = false;
for(new i = 1; i < MAX_BIZ; i++)
{
if (IsPlayerInRangeOfPoint(playerid, 1.0, biz_info[i][biz_pos_entrance][0], biz_info[i][biz_pos_entrance][1], biz_info[i][biz_pos_entrance][2]))
{
if (isequal(pName(playerid), biz_info[i][biz_name], true))
{
biz = true;
GivePlayerMoney(playerid, biz_info[i][biz_price]);
new szString[256];
biz_info[i][biz_owner] = EOS;
format(szString, sizeof szString, "FOR SALE!\nBUSINESS TYPE: %s BUSINESS ID: %i\nPRICE: $%d BUY NOW!", BizTypeFormat(biz_info[i][biz_type]), i, biz_info[i][biz_price]);
UpdateDynamic3DTextLabelText(biz_info[i][biz_text3d], 0x00FF00AA, szString);
return SCM(playerid, -1, "Done! You have sold your business.");
}
}
}
if (!biz)
return SCM(playerid, -1, "You are not near a business or this is not your business.");
return 1;
}