Posts: 1,782
Threads: 306
Joined: Jan 2010
Reputation:
0
Im trying to make textdraw for specific player only,
And i was wondering, Cause il be using [playerid] tags,
What would i put under OnGameModeInit? For TextDrawCreate ect
Posts: 790
Threads: 7
Joined: Mar 2008
Reputation:
0
Create it under OnPlayerConnect or just create a loop that creates one for each player ID in OnGameModeInit
Posts: 6,340
Threads: 58
Joined: May 2009
Reputation:
0
And if you're going to create it under OnPlayerConnect callback, then don't forget to destroy it at OnPlayerDisconnect callback.
Posts: 2,929
Threads: 160
Joined: Feb 2009
Reputation:
0
Yeah the best way is the first what FUNExtreme said; because if you create the textdraws with a loop for all players some (most of them) are not used.
So just define your textdraw at the top with [MAX_PLAYERS] after it; so now you can give a 'number' to the textdraw. Actually that number is the ID of the player.
Then just use llala[playerid] = TextDrawCreate ..
And under OnPlayerDisconnect:
TextDrawDestroy(llala[playerid]);
Posts: 1,782
Threads: 306
Joined: Jan 2010
Reputation:
0
Thats exactly what im doing
Posts: 6,340
Threads: 58
Joined: May 2009
Reputation:
0
You're doing it in a wrong way. Post your code.