Quote:
Originally Posted by good_live
How exactly does this work?
|
-N- Arms Fix:
Player Spawn -> Force set default model & arms
Eg. SM Skinchooser 4.2:
Player Spawn -> Wait 0.5s -> Set player arms/gloves -> Wait 2.0s -> Set player skin
PHP Code:
HookEvent("player_spawn", Event_PlayerSpawn);
public Action Event_PlayerSpawn(Handle event, const char[] name, bool dontBroadcast) {
int client = GetClientOfUserId(GetEventInt(event, "userid"));
CreateTimer(0.5, Timer_PostSpawn, client);
}
public Action Timer_PostSpawn(Handle timer, any client) {
// First set player arms!
GiveArms(client);
// Set player model after 2 seconds
CreateTimer(2.0, Timer_Spawn, client);
}
public void GiveArms(int client) {
// Only if player have default arms -> -N- Arms Fix
if(!isValidClient(client) || !hasDefaultArms(client)) return;
...
}
public Action Timer_Spawn(Handle timer, int client) {
...
}
__________________