invalid expression, assumed zero
#1

PHP код:
                        if(!BusinessData[i][Closed])
                        {
                            if(!
strcmp(BusinessInteriors[][e_businessint], "Unavailable"))
                            {
                                
Player_GoToBusiness(playeridi);
                            }
                        }
                        else
                        {
                            
Error(playerid"You can't enter this business right now.");
                        }
                    } 
i'm trying to do if the business interiors name is Unavailable,the player won't execute Player_GoToBusiness

Business interiors(in case if needed)
PHP код:
new
    
BusinessInteriors[][e_businessint] = {
        {
"24/7 1", -25.884498, -185.8689881003.54687517},
        {
"24/7 2"6.091179, -29.2718981003.54943810},
        {
"24/7 3", -30.946699, -89.6095961003.54687518},
        {
"24/7 4", -25.132598, -139.0669861003.54687516},
        {
"24/7 5", -27.312299, -29.2775991003.5572504},
        {
"24/7 6", -26.691598, -55.7148971003.5468756},
        {
"Ammunation 1"286.148986, -40.6443971001.5156251},
        {
"Ammunation 2"286.800994, -82.5475991001.5156254},
        {
"Ammunation 3"296.919982, -108.0719981001.5156256},
        {
"Ammunation 4"314.820983, -141.431991999.6015627},
        {
"Ammunation 5"316.524993, -167.706985999.5937506},
        {
"Sex Shop", -103.559165, -24.2256061000.7187503},
        {
"Binco"207.737991, -109.0199961005.13281215},
        {
"Didier Sachs"204.332992, -166.6949921000.52343714},
        {
"ProLaps"207.054992, -138.8049921003.5078123},
        {
"Sub Urban"203.777999, -48.4923971001.8046871},
        {
"Victim"226.293991, -7.4315291002.2109375},
        {
"Zip"161.391006, -93.1591561001.80468718},
        {
"Alhambra"493.390991, -22.7227991000.67968717},
        {
"Bar"501.980987, -69.150199998.75781211},
        {
"Burger Shot"375.962463, -65.8168481001.50781210},
        {
"Cluckin' Bell"369.579528, -4.4872941001.8588869},
        {
"Well Stacked Pizza"373.825653, -117.2709041001.4995115},
        {
"Strip Club"1204.809936, -11.5867991000.9218752},
        {
"Pleasure Domes", -2640.7629391406.682006906.4609373},
        {
"Barber 1"411.625976, -21.4332981001.8046872},
        {
"Barber 2"418.652984, -82.6397931001.8046873},
        {
"Barber 3"412.021972, -52.6498981001.89843712},
        {
"Tatoo Parlour", -204.439987, -26.4539981002.27343716},
        {
"Unavailable"0.00.00.00}
    }; 
Reply
#2

bump
Reply
#3

Need more information the your code

use bucle Foreach in your first code ?
Reply
#4

Quote:
Originally Posted by Eloy
Посмотреть сообщение
Need more information the your code

use bucle Foreach in your first code ?
what do you mean?
Reply
#5

Show your enum of business.
Reply
#6

Код:
if(!strcmp(BusinessInteriors[][e_businessint], "Unavailable"))
That's the line that it's refering to isn't it...

Код:
if(!strcmp(BusinessInteriors[WHY NO VALUE?][e_businessint], "Unavailable"))
You can't just expect it to simply pull things out of thin air.

Код:
if(!strcmp(BusinessInteriors[i][e_businessint], "Unavailable"))
There looks to be more issues in this section of code as well, as the logic behind your checks seems messed up a little.

You check if they are open, then check if they haven't got Unavailable, and don't advise if it's unavailable.
Reply
#7

i'm moving the code to player_gotobusiness function,but when I compile it,the pawncc crashes

PHP код:
Player_GoToBusiness(playeridbusinessid)
{
    if(
BusinessInteriorsBusinessData[businessid][Type] ][InteriorName], "Unavailable")) return 0;
    
SetPVarInt(playerid"BusinessPickup"gettime() + 8);
    
InBusiness[playerid] = businessid;
    
SetPlayerVirtualWorld(playeridbusinessid);
    new 
type BusinessData[businessid][Type];
    
SetPlayerInterior(playeridBusinessInteriors[type][InteriorID]);
    
SetPlayerPos(playeridBusinessInteriors[type][InteriorX], BusinessInteriors[type][InteriorY], BusinessInteriors[type][InteriorZ]);
    if(
Player_OwnsBusiness(playeridbusinessid))
    {
        
BusinessData[businessid][LastVisited] = gettime();
        
BusinessData[businessid][Save] = true;
    }

    
Info(playerid"Use {3498DB}/business {FFFFFF}to open the business menu.");
    
Info(playerid"Use {3498DB}/exitbiz {FFFFFF}to leave the business.");
    return 
1;

Reply
#8

It must be a stock right?
Reply
#9

Not really,you can just put the function name

https://sampforum.blast.hk/showthread.php?tid=570635
Reply
#10

Uhmm , didn't know anyways thanks though .
O.T: You might have missed a colon.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)