View Single Post
Desktop
AlliedModders Donor
Join Date: Sep 2009
Location: C:\Users\Default\
Old 02-20-2020 , 12:47   Re: [TUT] SourcePawn Scripting - Tips, Basics to Advanced
Reply With Quote #22

I think it would be nice to add the usage of RequestFrame instead of CreateTimer with 0.1 seconds to execution as a good practice.

For example:
PHP Code:
public Action EventOnPlayerConnectedFull(Event eventchar[] namebool dontBroadcast){

    
int client GetClientOfUserId(GetEventInt(event"userid"));
    
    
RequestFrame(view_as<RequestFrameCallback>(MoveToSpectator), client);
}
public 
Action MoveToSpectator(any data){
    
    
ChangeClientTeam(dataCS_TEAM_NONE);

__________________
Massive Infection:: Piu-Games
Desktop is offline