SA-MP Forums Archive
Fix error - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Fix error (/showthread.php?tid=152153)



Fix error - gecatahh - 02.06.2010

Hello again with my errors :P,
Now i get that error on that line:
Код:
C:\Users\User\Desktop\GTA\Drift\Drift\gamemodes\Drift.pwn(2944) : error 033: array must be indexed (variable "-unknown-")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Here is the line 2944...
pawn Код:
//line 2944--->
if(HouseInfo[h][hName] == "Name") return SendClientMessage(playerid, COLOR_WHITE, ".:: [ERROR]: No one has bought this house so you cannot rent from here.");



Re: Fix error - gecatahh - 03.06.2010

Help please because i cant find why its happens that..


Re: Fix error - whitedragon - 03.06.2010

did you not mean something like this?

pawn Код:
if(HouseInfo[h][hName] == Name)



Re: Fix error - gecatahh - 03.06.2010

no its a text there... need to have "----"...Because its like "State House"


Re: Fix error - whitedragon - 03.06.2010

Quote:
Originally Posted by gecatahh
no its a text there... need to have "----"...Because its like "State House"
show holy cmd


Re: Fix error - gecatahh - 03.06.2010

pawn Код:
dcmd_renthouse(playerid,params[]) { // This needs to be intergrated with your players .ini account
    #pragma unused params
    if(IsPlayerConnected(playerid)){
        for(new h = 0; h <= MAX_HOUSES; h++){
          if(PlayerToPoint(PTP_RADIUS, playerid, HouseInfo[h][hExitX], HouseInfo[h][hExitY], HouseInfo[h][hExitZ])){
              if(HouseInfo[h][hName] == "Name") return SendClientMessage(playerid, COLOR_WHITE, ".:: [ERROR]: No one has bought this house so you cannot rent from here.");
            if(PlayerInfo[playerid][pHouse] != -1) return SendClientMessage(playerid, COLOR_WHITE, ".:: [ERROR]: You are allready renting a house. Use /unrenthouse to stop renting there.");
              PlayerInfo[playerid][pHouse] = h;
              SendFormattedMessage(playerid, COLOR_WHITE, ".:: [HOUSE]: You are now renting from %s.", HouseInfo[h][hName]);
            } } }
    return true;
}



Re: Fix error - dice7 - 03.06.2010

Use strcmp for comparing strings
https://sampwiki.blast.hk/wiki/Strcmp


Re: Fix error - gecatahh - 03.06.2010

Thanks i will try now.Now not have error but need to see it works. Thanks.d