View Single Post
Doodil
Senior Member
Join Date: Mar 2012
Old 06-26-2013 , 03:43   Re: Time intervals instead of kills for credits (or certain team kills)
Reply With Quote #2

posting the ".smx" doesn't really help, since this is the compiled version of the code (aka not human readable). If you want to post the code you have to post the ".sp".

To your problem:

Yes that is the part of the code that adds credits. If you want to give the player credits every 5 minutes instead you have to create a timer (timer in the API). For a repeating timer use the flag TIMER_REPEAT (timer flags in the API).

As the optional data value for the CreateTimer function you should pass the userid of the client (Retrieving the userid of a client in the API) and in the callback for the timer you should retrieve the client from the userid (Retrieving the client of a userid in the API) and then check if the player is still in the server. Once you have verified that the client is still on the server you can give him credits in the same way your code-snipped did.


For the team-part:

The GetClientTeam() function (GetClientTeam in the API) allows you to check the team of a player, so if you don't want CTs to get credits for kills you just need to add

Code:
if (GetClientTeam(attacker) == CS_TEAM_CT)
	return;

Last edited by Doodil; 06-26-2013 at 03:49.
Doodil is offline