Question

Добрый день, что делаю не так?

error 022: must be lvalue (non-constant)

GetString(PI[playerid][pBankCard], "None") = !GetString(PI[playerid][pBankCard], "None");

Share this post


Link to post

2 answers to this question

  • 0

@Vitalik) В PAWN нельзя функции присваивать значение. 

Share this post


Link to post
  • 0
case dBuy24_7:
        {
         	if(!response) return true;
            new business_id = GetPVarInt(playerid, "business_id_menu"),
        	price = gShopCosts[listitem],
        	string[128];
			if(!cardoplata[playerid])
			{
				if(GetMoney(playerid) < price)
				{
					SendErrorMessage(playerid, "У Вас не хватает денег!");
					return true;
				}
			}
			else
			{
			    if(GetString(PI[playerid][pBankCard], "None"))return SendErrorMessage(playerid, "У Вас нет банковской карты!");
				if(PI[playerid][pBank] < price)
				{
					SendErrorMessage(playerid, "У Вас на банковском счету не хватает денег!");
					return true;
				}
			}
	        switch(listitem)
	            {
	            	case 0:
	            	{
	            		if(business_info[business_id][WAREHOUSE] < gShopProd[listitem])
	            			return SendErrorMessage(playerid, "На складе бизнеса нет товара!");

	                    GivePlayerWeapon(playerid, 43, 30);

	                    SendClientMessage(playerid, COLOR_DGREEN,
	            			"Вы приобрели фотоаппарат.");
	            	}
	            	default:
					{
					    cardoplata[playerid] = !cardoplata[playerid];
					    SendClientMessage(playerid, COLOR_DGREEN, "[ Информация ] {ffffff}Вы успешно сменили способ оплаты!");
					    MagazineList(playerid);
					}
	            }
				if(!cardoplata[playerid]) GivePlayerMoney_UP(playerid, price, false);
				else GiveBankMoney(playerid, price, "24/7", false);
				
				business_info[business_id][MONEY] += price;
				business_pay[business_id] += price;
				business_info[business_id][WAREHOUSE] -= gShopProd[listitem];
				SaveBusinessEx(business_id, "MONEY", business_info[business_id][MONEY], "d");
				SaveBusinessEx(business_id, "WAREHOUSE", business_info[business_id][WAREHOUSE], "d");
     			MagazineList(playerid);
			}
        }

 

35 минут назад, DEST сказал:

@Vitalik) В PAWN нельзя функции присваивать значение. 

Я понял спасибо, теперь такая ошибка [18:00:22] [debug] Run time error 4: "Array index out of bounds"
[18:00:22] [debug]  Attempted to read/write array element at index 10 in array of size 10
[18:00:22] [debug] AMX backtrace:
[18:00:22] [debug] #0 003f17f0 in public ac_OnDialogResponse (playerid=0, dialogid=87, response=1, listitem=10, inputtext[]=@008a2700 "") at C:\Users\Vitalik\Desktop\1122\gamemodes\update.pwn:17406
[18:00:22] [debug] #1 00013328 in public OnDialogResponse (playerid=0, dialogid=87, response=1, listitem=10, inputtext[]=@008a2700 "") at C:\Users\Vitalik\Desktop\1122\pawno\include\nex-ac.inc:3849

Share this post


Link to post
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content