Made a admin command for refreshing class data on one or more players.

Updated infect module to use new reload function.
Fixed typo in command description.
Known issue: Models isn't always restored on zr_human. If "default" is used, there's practically no model change. Possible solution: Store path in a buffer when the player join a team and select a model. Then read from that buffer when "default" is used.
This commit is contained in:
richard
2009-06-18 03:33:09 +02:00
parent 9cac025358
commit 4d48cd65de
4 changed files with 99 additions and 5 deletions

View File

@ -717,6 +717,33 @@ bool:ClassReloadPlayerCache(client, classindex, cachetype = ZR_CLASS_CACHE_MODIF
return true;
}
/**
* Refresh the specified player's cache and re-apply attributes.
*
* @param client The client index.
* @return True if successful, false otherwise.
*/
bool:ClassReloadPlayer(client)
{
new activeclass;
// Get active class index.
activeclass = ClassGetActiveIndex(client);
// Validate index.
if (activeclass < 0)
{
return false;
}
// Refresh cache and re-apply attributes.
ClassOnClientDeath(client); // Dummy event to clean up stuff.
ClassReloadPlayerCache(client, activeclass);
ClassApplyAttributes(client);
return true;
}
/**
* Reset all class attribute multipliers to 1.0.
*/