View Single Post
Nican
Veteran Member
Join Date: Jan 2006
Location: NY
Old 09-22-2007 , 14:43   Re: [Question] Keyvalues GRRR!
Reply With Quote #9

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");
    
    
IsInfecteduserID ] = true;

__________________
http://www.nican132.com
I require reputation!
Nican is offline
Send a message via ICQ to Nican Send a message via MSN to Nican