Quote:
Originally Posted by xf117
That does not make any sense
PHP Code:
if (teamold != teamnew, client)
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:event, String: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?