Raised This Month: $51 Target: $400
 12% 

[L4D2] Points Resetter


Post New Thread Reply   
 
Thread Tools Display Modes
noxman
Member
Join Date: Jun 2012
Old 02-01-2014 , 16:15   Re: [L4D2] Points Resetter
Reply With Quote #11

Quote:
Originally Posted by xf117 View Post
That does not make any sense
PHP Code:
if (teamold != teamnewclient
And you are clearing the whole array, that is why it points are being reset for each player.
Something like that will do
PHP Code:
public Action:Event_TeamChange(Handle:eventString:event_name[], bool:dontBroadcast) {

    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    new 
teamnew GetEventInt(event"team");
    new 
teamold GetEventInt(event"oldteam");

    if (
teamold != teamnew && IsAllowedReset()) {
        
points[client] = GetConVarInt(StartPoints);
        
hurtcount[client] = 0;
        
protectcount[client] = 0;
        
headshotcount[client] = 0;
        
killcount[client] = 0;
        
wassmoker[client] = 0;
    }
    
    
tanksspawned 0;
    
witchsspawned 0;
    
PrintToChat(client"[PS]The Points are been reset to 200.");

This code works perfect. But i have a question. how i can ignore the reseter if a switch to afk mode and back.

for example: Iam currently on survivor/infected team => switch to infected/survivor => Points are reset to 200.

Iam on survivor/infected team => switch to spec mode and back => point should be not reset.

is that possible?
noxman 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 00:46.


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