View Single Post
NomisCZ
AlliedModders Donor
Join Date: Mar 2014
Location: Czech_Republic
Old 01-28-2017 , 13:21   Re: [CS:GO] -N- Arms Fix
Reply With Quote #5

Quote:
Originally Posted by good_live View Post
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[] namebool dontBroadcast) {
    
    
int client GetClientOfUserId(GetEventInt(event"userid"));
    
CreateTimer(0.5Timer_PostSpawnclient);
}
public 
Action Timer_PostSpawn(Handle timerany client) {
    
// First set player arms!
    
GiveArms(client);
// Set player model after 2 seconds
    
CreateTimer(2.0Timer_Spawnclient);
}

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 timerint client) {
...

__________________

Last edited by NomisCZ; 01-28-2017 at 13:24.
NomisCZ is offline