How would i do this
#1

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
Reply
#2

Create it under OnPlayerConnect or just create a loop that creates one for each player ID in OnGameModeInit
Reply
#3

And if you're going to create it under OnPlayerConnect callback, then don't forget to destroy it at OnPlayerDisconnect callback.
Reply
#4

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]);
Reply
#5

Quote:
Originally Posted by » RyDeR «
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]);
Ok done all that,
But when i connect the textdraw dosent show,
I tried putting TextDrawShowForPlayer aswell,
Still wont work, The only way it works if i put,
pawn Код:
new playerid;
OnPlayerConnect(playerid);
Under OnGameModeInit
Reply
#6

You're doing it wrong.

http://forum.sa-mp.com/index.php?top...3323#msg993323
Reply
#7

Thats exactly what im doing
Reply
#8

You're doing it in a wrong way. Post your code.
Reply
#9

pawn Код:
public OnPlayerConnect(playerid)
{
  TDMCash[playerid] = TextDrawCreate(405.000000, 425.000000, "~w~TDM Cash: ~g~$0");
    TextDrawBackgroundColor(TDMCash[playerid], 255);
    TextDrawFont(TDMCash[playerid], 3);
    TextDrawLetterSize(TDMCash[playerid], 0.590000, 2.000000);
    TextDrawColor(TDMCash[playerid], -1);
    TextDrawSetOutline(TDMCash[playerid], 1);
    TextDrawSetProportional(TDMCash[playerid], 1);

    AdminCheck[playerid] = TextDrawCreate(405.000000, 395.000000, "~w~Are you admin: ~r~No");
    TextDrawBackgroundColor(AdminCheck[playerid], 255);
    TextDrawFont(AdminCheck[playerid], 3);
    TextDrawLetterSize(AdminCheck[playerid], 0.589999, 2.000000);
    TextDrawColor(AdminCheck[playerid], -1);
    TextDrawSetOutline(AdminCheck[playerid], 1);
    TextDrawSetProportional(AdminCheck[playerid], 1);
    TextDrawUseBox(AdminCheck[playerid], 1);
    TextDrawBoxColor(AdminCheck[playerid], 255);
    TextDrawTextSize(AdminCheck[playerid], 599.000000, 20.000000);
   
    TextDrawShowForPlayer(playerid, Text:TDMCash[playerid]);
    TextDrawShowForPlayer(playerid, Text:AdminCheck[playerid]);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)