Viking

Members
  • Content Count

    258
  • Joined

  • Last visited

  • Days Won

    9

Viking last won the day on January 12

Viking had the most liked content!

Community Reputation

18 Good

10 Followers

About Viking

  • Rank
    Senior Member

Recent Profile Visitors

1044 profile views
  1. When the bots do not spawn then the class selection does mit work for them. Compare Thema bot Script with an other mod where it works.
  2. @NeHo There is no player involved, so this loop will go on and on unless it restarts after round/map change.
  3. Alright, i found your problem... In your giveXp function you are forcing rankID 54 at every run and that's why the rank does not update correctly. In fact your are still rank 1 but with the rankxp of rank 55, so your are a negative amount away from the required xp to reach rank 2. Easy fix: for(i = 0; i < giveXp.size; i++) { self giveXp( giveXp[ i ], i ); wait .1; } and giveXp( amount, nextRank ) { newXp = amount; self.pers["rankxp"] = newXp; self maps\mp\gametypes\_persistence::statSet( "rankxp", newXp ); rankId = nextRank; self.pers["rank"] = rankId; self maps\mp\gametypes\_persistence::statSet( "rank", rankId ); self maps\mp\gametypes\_persistence::statSet( "minxp", int(level.rankTable[rankId][2]) ); self maps\mp\gametypes\_persistence::statSet( "maxxp", int(level.rankTable[rankId][7]) ); self maps\mp\gametypes\_rank::updateRank(); } Works for me
  4. This might help you. Didnt know this works, but it seems that you really can use existing ranks on a Modded Server https://cod4x.me/index.php?/forums/topic/4331-custom-maps-on-cod4x-server/
  5. Viking

    Libcod

    I guess you should ask that on their forums. Isn't that a modification just like cod4x?
  6. You are calling giveXp inside the for loop as a thread. I guess that's the problem
  7. Install/repair the "Microsoft Visual C++ Redistributable".RRight now I am not at the PC to check which ones are installed (or required for cod4) but you could check that on your machine and tell your friend.
  8. I really would like to help you but to be honest i don't understand your problem. Some short things i noticed in your first post. I think you already know that otherwise your scripts won't even load but i say it anyways. if ( player.getGUID(); == "2310346615436562540") should be if ( player getGUID() == "2310346615436562540") And the word "and" is not a valid statement for multiple if clauses Try one of these: if ( player getGUID() == "123...") { //action } else if ( player getGUID() == "456...") { //action } else if ( player getGUID() == "789...") { //action } switch(player getGuid) { case "1234...": iPrintLn("action 1"); break case "5678...": iPrintLn("action 2"); break default: break; }
  9. Hey, i am running the latest cod4x version but somehow my bots keep their upcounting names. No matter what i write to the function paramater. bot = addTestClient("Viking"); but the bot still connects as "bot 0" any idea?
  10. There is no way to copy the ranks from stock to modded cod4. However, you can either use modwarfare where all stuff is available. or add a little Script to the mod folder that auto ranks up every player to level 55 and unlocks weapons and stuff. Or (not tested yet) set up a stock server with a script that creates a backup text file of all important stats. Then copy over this text file to the modded server and wait for the player connecting. When he shows up then load the Text file and "copy" his old stats to the new Profile.
  11. Viking

    botnames.txt

    As far as i know was it removed when the new_arch branch was released. You can now set the name inside the gsc code: https://github.com/callofduty4x/CoD4x_Server/blob/4a404408470359b1f8cb4d2eaa3b7cd8eee48c7a/src/sv_client.c#L1239 The old branch was loading the botnames.txt like that: (same file as above) gentity_t* SV_AddBotClient(){ int i, p, cntnames, read; unsigned short qport; client_t *cl = NULL; const char* denied; char name[16]; char botnames[128][16]; char userinfo[MAX_INFO_STRING]; netadr_t botnet; usercmd_t ucmd; fileHandle_t file; mvabuf; //Find a free serverslot for our bot for ( i = sv_privateClients->integer; i < sv_maxclients->integer; i++) { cl = &svs.clients[i]; if (cl->state == CS_FREE) { break; } } if( i == sv_maxclients->integer ) return NULL; //No free slot //Getting a new name for our bot FS_SV_FOpenFileRead("botnames.txt", &file); if(!file){ cntnames = 0; }else{ for(cntnames = 0; cntnames < 128; cntnames++){ read = FS_ReadLine(botnames[cntnames], 16, file); if(read <= 0) break; if(strlen(botnames[cntnames]) < 2) break; } FS_FCloseFile(file); } if(!cntnames){ Q_strncpyz(name,va("bot%d", i),sizeof(name)); }else{ Q_strncpyz(name,botnames[rand() % cntnames],sizeof(name)); for(p = 0; p < sizeof(name); p++){ if(name[p] == '\n' || name[p] == '\r') name[p] = 0; } } //Connect our bot Com_RandomBytes((byte*) &qport, sizeof(short)); *userinfo = 0; Info_SetValueForKey( userinfo, "cg_predictItems", "1"); Info_SetValueForKey( userinfo, "color", "4"); Info_SetValueForKey( userinfo, "head", "default"); Info_SetValueForKey( userinfo, "model", "multi"); Info_SetValueForKey( userinfo, "snaps", "20"); Info_SetValueForKey( userinfo, "rate", "99999"); Info_SetValueForKey( userinfo, "name", name); Info_SetValueForKey( userinfo, "protocol", va("%i", sv_protocol->integer)); Info_SetValueForKey( userinfo, "qport", va("%hi", qport)); Com_Memset(&botnet,0,sizeof(botnet)); botnet.type = NA_BOT; Info_SetValueForKey( userinfo, "ip", NET_AdrToString( &botnet ) ); //gotnewcl: Com_Memset(cl, 0x00, sizeof(client_t)); cl->power = 0; //Sets the default power for the client // (build a new connection // accept the new client // this is the only place a client_t is ever initialized) Q_strncpyz(cl->legacy_pbguid, "BOT-Client",33); // save the pbguid // save the userinfo Q_strncpyz(cl->userinfo, userinfo, 1024 ); cl->unsentVoiceData = 0; cl->hasVoip = 0; cl->gentity = SV_GentityNum(i); cl->clscriptid = Scr_AllocArray(); denied = ClientConnect(i, cl->clscriptid); if ( denied ) { Com_Printf("Bot couldn't connect: %s\n", denied); SV_FreeClientScriptId(cl); return NULL; } Com_Printf( "Going from CS_FREE to CS_CONNECTED for %s num %i\n", name, i); // save the addressgamestateMessageNum // init the netchan queue Netchan_Setup( NS_SERVER, &cl->netchan, botnet, qport, cl->unsentBuffer, sizeof(cl->unsentBuffer), cl->fragmentBuffer, sizeof(cl->fragmentBuffer)); /* for(index = 0; index < MAX_RELIABLE_COMMANDS; index++ ){ if(index < MAX_RELIABLE_COMMANDS / 2){ cl->reliableCommands[index] = &cl->lowReliableCommands[index & (MAX_RELIABLE_COMMANDS - 1)]; } else { cl->reliableCommands[index] = &svse.extclients[i].highReliableCommands[index & (MAX_RELIABLE_COMMANDS - 1)]; } } */ cl->state = CS_CONNECTED; cl->nextSnapshotTime = svs.time; cl->lastPacketTime = svs.time; cl->lastConnectTime = svs.time; SV_UserinfoChanged(cl); Q_strncpyz(cl->name, name, sizeof(cl->name)); Q_strncpyz(cl->shortname, name, sizeof(cl->shortname)); /* ClientSetUsername(i, name); */ SV_UpdateClientConfigInfo(cl); // when we receive the first packet from the client, we will // notice that it is from a different serverid and that the // gamestate message was not just sent, forcing a retransmit cl->gamestateMessageNum = -1; //newcl->gamestateMessageNum = -1; cl->canNotReliable = 1; //Let enter our new bot the game Com_Memset(&ucmd, 0, sizeof(ucmd)); SV_ClientEnterWorld(cl, &ucmd); return SV_GentityNum(i); }