View Single Post
J0BL3SS
Senior Member
Join Date: Sep 2020
Location: Turkey/Istanbul
Old 02-02-2021 , 13:45   Re: [Subplugin] Gravity
Reply With Quote #3

Quote:
Originally Posted by WhiteFalcon View Post
You shouldn't pass raw index to timer since a client may leave/rejoin mid-rage and his index become invalid, use GetClientSerial/GetClientFromSerial or GetClientUserId/GetClientOfUserId
I still don't understannd how timers work. Should have i use like that? Or should i check player is valid or not in the timer void?

Code:
CreateTimer(GRV_Duration[Num][bossClientIdx], SetGravity, GetClientUserId(iClient), TIMER_FLAG_NO_MAPCHANGE);

public Action SetGravity(Handle timer, int iClient)
{
	SetEntityGravity(iClient, 1.0);
}
__________________
My Steam Profile
My Discord Name: J0BL3SS#5320 | j0bl3ss

I don't really look at steam or alliedmodders, contact me from discord if you need it.

Last edited by J0BL3SS; 02-02-2021 at 13:50.
J0BL3SS is offline