Quote:
Originally Posted by SELL
when they change team, then Points are reset. using the instructions above code. but how to do so by using the command !takeover Points are not reset
|
Code:
HookEvent("player_team", Reset_Points);
bool bTakeOver[MAXPLAYERS];
public Action Reset_Points(Handle hEvent, char[] sEventName, bool bDontBroadcast){
int iClientIndex = GetClientOfUserId(GetEventInt(hEvent, "userid"));
if(IsClientSurvivor(iClientIndex) || IsClientInfected(iClientIndex)){
if(bTakeOver[iClientIndex] == true)
bTakeOver[iClientIndex] = false;
else
PlayerData[iClientIndex][iPlayerPoints] = 0;
return;
}
else{ // If player moved to spectator
bTakeOver[iClientIndex] = true;
}
}
Try this. People can still go around this by switching to spectator before moving to the other team; but if takeover works like I think it does, this
should work for what you are trying to do.
__________________