Quote:
Originally Posted by mug1wara
Let me correct myself, unnecessary, but that's just my ocd taking over my eyes.
+ but "Called once a client is authorized and fully in-game".
what if the server is changing map and you join, then the timer won't even be fired anyways
that's my point :p
I'd use OnClientPutInServer
|
Honestly, I have no idea what you are trying to say because none of that makes sense.
https://sm.alliedmods.net/new-api/cl...PostAdminCheck
Quote:
Called once a client is authorized and fully in-game, and after all post-connection authorizations have been performed.
This callback is guaranteed to occur on all clients, and always after each OnClientPutInServer() call.
|
PHP Code:
#include <sourcemod>
#pragma semicolon 1 // Forces the compiler to read only after semicolons (;) [Optional]
#pragma newdecls required // Forces the compiler to read only in new syntax [Optional]
public void OnClientPostAdminCheck(int client) {
CreateTimer(1.0, Timer_Message, GetClientUserId(client), TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE); // Pass the client's userid rather than index (for safety)
}
public Action Timer_Message(Handle hTimer, any iUser)
{
int client = GetClientOfUserId(iUser); // Get client's index from userid
if (0 < client <= MaxClients && IsClientInGame(client)) // Check if the client between 1 and 65 (valid player indexes). Also check if they're still in game.
{
SetHudTextParams(-1.0, -1.0, 20.0, 255, 255, 255, 255, 0, 0.0, 0.0, 0.0);
ShowHudText(client, 1, "Hello World !!");
}
}
Works exactly as it's intended to do.