SA-MP Forums Archive
ForEach or Where? - 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: ForEach or Where? (/showthread.php?tid=314542)



ForEach or Where? - milanosie - 30.01.2012

hey guys! I need to ask you something.

I want to use a CMD for every house CarInfo[i][owner] == PlayerInfo[playerid][Pid]

Do I need to use: where or ForEach?

and how to use them? thanks


Re: ForEach or Where? - rinori - 30.01.2012

pawn Код:
foreach(Player, i)
{
//code below



Re: ForEach or Where? - milanosie - 30.01.2012

What I mean is,

I want to change the status of the house for every house that has [owner] == PlayerInfo[playerid][owner] (Pid is custom define) , And what does Player Mean in foreach?


Re: ForEach or Where? - rinori - 30.01.2012

// For each player (all MAX_PLAYERS online defined in 'i')
So when you want to change it for all players it goes like
pawn Код:
PlayerInfo[i][owner]