Welcome TextDraw... - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Welcome TextDraw... (
/showthread.php?tid=165758)
Welcome TextDraw... -
Zafire1410 - 06.08.2010
Hi, i want make when player spawn appears a textdraw saying "Welcome Name_LastName" and after 4 seconds dissapears.. i make this code but the textdraw dont appears :S help me if the code is wrong..
Top Code
Код:
new Text:bienvenido[MAX_PLAYERS];
OnPlayerConnect
Код:
TextBienvenido(playerid);
TextBienvenido Function
Код:
public TextBienvenido(playerid)
{
bienvenido[playerid] = TextDrawCreate(8.000000, 420.000000, "Bienvenido");
TextDrawBackgroundColor(bienvenido[playerid], 255);
TextDrawFont(bienvenido[playerid], 0);
TextDrawLetterSize(bienvenido[playerid], 0.689999, 2.499999);
TextDrawColor(bienvenido[playerid], -1);
TextDrawSetOutline(bienvenido[playerid], 0);
TextDrawSetProportional(bienvenido[playerid], 1);
TextDrawSetShadow(bienvenido[playerid], 1);
}
OnPlayerSpawn
Код:
TextDrawShowForPlayer(playerid, bienvenido[playerid]);
SetTimerEx("TerminarBienvenida", 4000, 0, "i", playerid);
TerminarBienvenida Function
Код:
public TerminarBienvenida(playerid)
{
TextDrawHideForPlayer(playerid, bienvenido[playerid]);
}
OnPlayerDisconnect
Код:
public OnPlayerDisconnect(playerid, reason)
{
TextDrawHideForAll(bienvenido[playerid]);
TextDrawDestroy(bienvenido[playerid]);
return 1;
}
Re: Welcome TextDraw... -
PotH3Ad - 06.08.2010
Try this:
pawn Код:
new Text:bienvenido;
public OnFilterScriptInit()
{
bienvenido = TextDrawCreate(8.000000, 420.000000, "_");
TextDrawBackgroundColor(bienvenido, 255);
TextDrawFont(bienvenido, 0);
TextDrawLetterSize(bienvenido, 0.689999, 2.499999);
TextDrawColor(bienvenido, -1);
TextDrawSetOutline(bienvenido, 0);
TextDrawSetProportional(bienvenido, 1);
TextDrawSetShadow(bienvenido, 1);
TextDrawHideForAll(bienvenido);
return 1;
}
public OnFilterScriptExit()
{
TextDrawDestroy(bienvenido);
return 1;
}
public OnPlayerSpawn(playerid)
{
Bienvenida(playerid);
return 1;
}
stock Bienvenida(playerid)
{
new str[60], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(str, sizeof(str), "Bienvenido %s", pName);
TextDrawSetString(bienvenido, str);
TextDrawShowForPlayer(playerid, bienvenido);
SetTimerEx("TerminarBienvenida", 4000, 0, "i", playerid);
}
public TerminarBienvenida(playerid)
{
TextDrawHideForPlayer(playerid, bienvenido);
return 1;
}
Re: Welcome TextDraw... -
Zafire1410 - 06.08.2010
Quote:
Originally Posted by PotH3Ad
Try this:
pawn Код:
new Text:bienvenido;
public OnFilterScriptInit() { bienvenido = TextDrawCreate(8.000000, 420.000000, "_"); TextDrawBackgroundColor(bienvenido, 255); TextDrawFont(bienvenido, 0); TextDrawLetterSize(bienvenido, 0.689999, 2.499999); TextDrawColor(bienvenido, -1); TextDrawSetOutline(bienvenido, 0); TextDrawSetProportional(bienvenido, 1); TextDrawSetShadow(bienvenido, 1); TextDrawHideForAll(bienvenido); return 1; }
public OnFilterScriptExit() { TextDrawDestroy(bienvenido); return 1; }
public OnPlayerSpawn(playerid) { Bienvenida(playerid); return 1; }
stock Bienvenida(playerid) { new str[60], pName[MAX_PLAYER_NAME]; GetPlayerName(playerid, pName, sizeof(pName)); format(str, sizeof(str), "Bienvenido %s", pName); TextDrawSetString(bienvenido, str); TextDrawShowForPlayer(playerid, bienvenido); SetTimerEx("TerminarBienvenida", 4000, 0, "i", playerid); }
public TerminarBienvenida(playerid) { TextDrawHideForPlayer(playerid, bienvenido); return 1; }
|
The problem there is.. is the same textdraw name "bienvenido" and if appears in a player and enter another player at the same time.. is a bug will change the string veri fats and dont said the correct name... i need to use diferente textdraws for every single player.. i used bienvenido[MAX_PLAYERS] for that but i think my code is wrong...
Sorry For My Bad English.. i speak spanish...