/// Load the configuration void LoadSettings() { returncode = DEFAULT_RETURNCODE; // The path to the configuration file. char szCurDir[MAX_PATH]; GetCurrentDirectory(sizeof(szCurDir), szCurDir); string scPluginCfgFile = string(szCurDir) + "\\flhook_plugins\\hookext.ini"; clients.clear(); struct PlayerData *pPD = 0; while(pPD = Players.traverse_active(pPD)) { uint client = HkGetClientIdFromPD(pPD); wstring charname = Players.GetActiveCharacterName(client); string filename = GetCharfilename(charname) + ".fl"; CHARACTER_ID charid; strcpy(charid.szCharFilename, filename.c_str()); CharacterSelect(charid,client); } }
void Arcade() { int selectedplayer,nextmap,nextplayer,won=1; Location locat; int Played[5],i,playedCount=1,exists=1; //Loading of data voice_set_playmode(Dramatic, PLAYMODE_LOOP); Cinematic1(); voice_ramp_volume(Dramatic,1000,Music_volume); rest(1000); selectedplayer=CharacterSelect(); if(selectedplayer==-1) { voice_stop(Dramatic); return; } Played[0]=selectedplayer; while(playedCount<5) { if(won) { exists=1; while(exists) { nextplayer=Random(0,4); player1=selectedplayer; player2=nextplayer; exists=0; for (i=0; i<playedCount; i++) { if(Played[i]==nextplayer) { exists=1; } } } Played[playedCount]=nextplayer; playedCount++; nextmap=Random(0,4); } CinematicVoice(selectedplayer,nextplayer,nextmap); voice_stop(Dramatic); switch(GamePlay(selectedplayer,nextplayer,nextmap,1)) { case 0: voice_stop(Dramatic); return; case 1: won=1; CinematicWin(selectedplayer,nextplayer); break; case 2: won=0; if(!GameOver(selectedplayer)) { voice_stop(Dramatic); return; } break; } Savegame(); } voice_stop(Dramatic); }