http://wiki.alliedmods.net/KeyValues...d_Scripting%29
PHP Code:
public Action:HookPlayerActivate(Handle:event, const String:name[], bool:dontBroadcast){
new userID = GetEventInt(event,"userid");
decl String:userString[64];
Format(userString,sizeof(userString),"apocalyptica:%i",userID);
new Handle:roundPlayersConfig = CreateKeyValues("roundPlayers");
decl String:path[PLATFORM_MAX_PATH];
BuildPath(Path_SM,path,PLATFORM_MAX_PATH,"configs/km/es_round_players.txt");
FileToKeyValues(roundPlayersConfig,path);
if(!KvJumpToKey(roundPlayersConfig,userString)){
CloseHandle(roundPlayersConfig);
return;
}
KvSetNum(roundPlayersConfig,"IsInfected",0);
KeyValuesToFile(roundPlayersConfig,path);
CloseHandle(roundPlayersConfig);
}
2. I HIGHLY recommend you not doing that, just use a normal array instead:
PHP Code:
new bool:IsInfected[MAXPLAYERS + 1];
public Action:HookPlayerActivate(Handle:event, const String:name[], bool:dontBroadcast){
new userID = GetEventInt(event,"userid");
IsInfected[ userID ] = true;
}
__________________