View Single Post
Naow
Senior Member
Join Date: Feb 2009
Old 07-20-2009 , 08:27   Re: [L4D] Survivor Upgrades
Reply With Quote #171

PHP Code:
//==================================================================================================
// Kill upgrades:
// Gives upgrade:    everytime a player kills 120 infected
HookEvent("infected_death"KillUpgrades);
public 
Action:KillUpgrades(Handle:eventString:ename[], bool:dontBroadcast)
{
    new 
client             GetClientOfUserId(GetEventInt(event"attacker"));
    new 
bool:minigun     GetEventBool(event"minigun");
    new 
bool:blast         GetEventBool(event"blast");
    
    if(
client)
    {
        
// normal kills only
        
if (!minigun && !blast
            
'// previously declared global'
            
killcount[client] += 1;

            
i.e: new killcount[MAXPLAYERS+1];

            
        
// Gives a upgrade everytime a player kills 120 infected
        
if ((killcount[client]%120) == && killcount[client] > 1)
        {
            if(
IsClientInGame(client)==true && GetClientTeam(client)==2)
            {
                
decl String:name[64];
                
GetClientName(clientname64);
                
PrintToChatAll("\x05[ \x04%s\x01 won a upgrade for killing %d infected.",namekillcount[client]);
                
GiveClientUpgrades(client1);
            }
        }
    }
    
    return 
Plugin_Continue;

PHP Code:
/home/groups/sourcemod/upload_tmp/phpWoHpPb.sp(1068) : error 027invalid character constant
/home/groups/sourcemod/upload_tmp/phpWoHpPb.sp(1068) : warning 217loose indentation
/home/groups/sourcemod/upload_tmp/phpWoHpPb.sp(1068) : error 017undefined symbol "declared"
/home/groups/sourcemod/upload_tmp/phpWoHpPb.sp(1068) : error 017undefined symbol "global"
/home/groups/sourcemod/upload_tmp/phpWoHpPb.sp(1068) : fatal error 127too many error messages on one line

Compilation aborted
.
4 Errors
Here is the part of the code for the kill feature , why it doesn't work?

Thx

Last edited by Naow; 07-20-2009 at 08:34.
Naow is offline