SA-MP Forums Archive
Enum help - 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)
+--- Thread: Enum help (/showthread.php?tid=448914)



Enum help - thimo - 06.07.2013

Okay i want to do this:
APlayerData[playerid][Houses][HouseSlot]
While the defenition is APlayerData[playerid][Admin]
Now i got an error of
Code:
APlayerData[playerid][Houses][HouseSlot]
The errors:
Code:
C:\Users\Thimo\SkyDrive\GTA sa-mp\Sa-mp 0.3d\gamemodes\ET.pwn(2516) : error 001: expected token: ";", but found "["
C:\Users\Thimo\SkyDrive\GTA sa-mp\Sa-mp 0.3d\gamemodes\ET.pwn(2516) : error 029: invalid expression, assumed zero
C:\Users\Thimo\SkyDrive\GTA sa-mp\Sa-mp 0.3d\gamemodes\ET.pwn(2516) : warning 215: expression has no effect
C:\Users\Thimo\SkyDrive\GTA sa-mp\Sa-mp 0.3d\gamemodes\ET.pwn(2516) : error 001: expected token: ";", but found "]"
C:\Users\Thimo\SkyDrive\GTA sa-mp\Sa-mp 0.3d\gamemodes\ET.pwn(2516) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
While in the enum there is this:
Code:
Houses[MAX_HOUSESPERPLAYER],
It works in PPC trucking and im trying to figure out a way to load the vehicles. He is using that but why wont it work here?


Re: Enum help - nickyW - 06.07.2013

Can you explain better? Give us 2516 line


Re: Enum help - thimo - 06.07.2013

pawn Code:
2512    new HouseID;
2513    for (new HouseSlot; HouseSlot < MAX_HOUSESPERPLAYER; HouseSlot++)
2514    {
2515        // Get the HouseID from this slot
2516        HouseID = APlayerData[playerid][Houses][HouseSlot];
2517        // Check if there is a house in this slot
2518        if (HouseID != 0)
2519            HouseFile_Load(HouseID, true); // Load the cars of the house
2520    }
The problem is i need to use 3 fields. And it wants me to only use two. But since Houses[MAX_HOUSESPERPLAYER] needs a variable aswell it needs to be 3 fields...