wierd foreach problem
#1

when i shutdown the server, i want it to save all properties
Код:
public OnGameModeExit()
{
    foreach(Business, f) { SavePlayerFactory(f); }
    foreach(Business, b) { SavePlayerBusiness(b); }
    foreach(House, h) { SavePlayerHouse(h); }
    return 1;
}
The functions work allright, tested. But this doesnt work!
Reply
#2

I am pretty new to foreach, but try creating a public function
pawn Код:
forward GameModeSetupExitFunc();
...
public GameModeSetupExitFunc()
{
     foreach(Business, f) { SavePlayerFactory(f); }
     foreach(Business, b) { SavePlayerBusiness(b); }
     foreach(House, h) { SavePlayerHouse(h); }
     SetTimer("GameModeExit",4000,false);
     return 1;
}
Reply
#3

Have you defined Business and House correctly? You need to tell foreach what it should loop. If you have, please show that code, too.
Reply
#4

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
Have you defined Business and House correctly? You need to tell foreach what it should loop. If you have, please show that code, too.
Oh thanks i had an typo there.. I had Factory, Business, Houses
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)