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:
@ -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.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user