Raised This Month: $ Target: $400
 0% 

Item Buy System - how to detect a spitter ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Skorpion1976
Veteran Member
Join Date: Jun 2009
Location: Austria
Old 01-11-2010 , 14:09   Item Buy System - how to detect a spitter ?
Reply With Quote #1

You might know the zombieshop/item buy system. In this code here the player gets points every xx player_hurt events. I set the value to 3.
Thatīs ok for all except spitter. Just think of Sugarmill elevator arriving below.This is a joke as everytime all survivors get spitted on, become incapped and spitter collects a tremendous amount of points. I was thinking of something like this: If attacker == spitter --> every 5th player_hurt event give spitter 1 point. Is that possible anyway O_O ? How would the code for that look like ? I am no programmer

Code:
public Action:HurtPoints(Handle:event, String:event_name[], bool:dontBroadcast)
{
    new client = GetClientOfUserId(GetEventInt(event, "userid"));
    new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
    if (attacker > 0 && attacker <= MaxClients)
    {
        if (pointsteam[attacker] != SURVIVORTEAM)
        {
            if (pointsteam[client] == SURVIVORTEAM)
            {
                if(pointson)
                {
                    pointshurtcount[attacker] += 1;
                    if(pointshurtcount[attacker] >= 3)
                    {
                        PrintToChat(attacker, "[SM] Multiple damage! + %d %s",GetConVarInt(pointshurt),"point.");
                        points[attacker] += GetConVarInt(pointshurt);
                        pointshurtcount[attacker] -= 3;
                    }
                }
            }
        }
    }
}
Skorpion1976 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:21.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode