Diferenta fata de SendClientMessage simplu? Acesta e pe TextDraw
Sa incepem!
Code:
/* avem nevoie de un textdraw simplu pt a arata jucatorului acest mesaj pe ecran nu in chat. */
new
Text:SCMT[ MAX_PLAYERS ]; // numele textraw-ului pe care il avem
/* mergem in OnPlayerConnect */
public OnPlayerConnect( playerid )
{
/* textdraw-ul nostru, cu numele SCMT care a fost definit prin variabila globala la inceput */
SCMT[playerid] = TextDrawCreate(36.000000, 144.000000, "_");
TextDrawBackgroundColor(SCMT[playerid], 255);
TextDrawFont(SCMT[playerid], 2);
TextDrawLetterSize(SCMT[playerid], 0.250000, 1.099999);
TextDrawColor(SCMT[playerid], -1);
TextDrawSetOutline(SCMT[playerid], 0);
TextDrawSetProportional(SCMT[playerid], 1);
TextDrawSetShadow(SCMT[playerid], 1);
TextDrawUseBox(SCMT[playerid], 1);
TextDrawBoxColor(SCMT[playerid], 118);
TextDrawTextSize(SCMT[playerid], 220.000000, 5.000000);
return 1;
}
/* in orice loc al GM-ului */
stock SendTD(playerid, text[], time)
{
TextDrawSetString(SCMT[playerid], text); // modifica textdraw-ul cu textul introdus in functia dvs.
SetTimerEx("TimeHideForPlayer", time, 1, "i", playerid); // ascunde textdraw-ul cu textul dvs. dupa timpul introdus in functie
return TextDrawShowForPlayer(playerid, SCMT[playerid]); // arata textdraw-ul cu textul din functia dvs.
}
forward TimeHideForPlayer(playerid);
public TimeHideForPlayer(playerid) TextDrawHideForPlayer(playerid, SCMT[playerid]);
/* exemplu cum poti folosi in gm aceasta functie */
CMD:test(playerid) {
SendTD(playerid, " Testarea acestei functii", 500);
return 1;
}
Autor: HEMINGWAY