02.03.2011, 16:17
Bem, voce nгo explicou o "parou de responder"
De qualquer forma, eu analisei possнveis problemas que a funзгo CreatePlayerTextDraw podia estar dando, entгo arrumei pra voce
Lembre-se que TextDrawCreate sу pode ser usado no OnGameModeInit/OnFilterScriptInit.
Aqui estб, se nгo continuar causando problemas, espere outro membro do fуrum para ajudб-lo.
Espero ter ajudado
De qualquer forma, eu analisei possнveis problemas que a funзгo CreatePlayerTextDraw podia estar dando, entгo arrumei pra voce
Lembre-se que TextDrawCreate sу pode ser usado no OnGameModeInit/OnFilterScriptInit.
Aqui estб, se nгo continuar causando problemas, espere outro membro do fуrum para ajudб-lo.
pawn Code:
#if defined _PlayerTextDraw_included
#endinput
#endif
#define _PlayerTextDraw_included
#include <a_samp>
/*
LeonardoLeal
Autor: Dr_Pawno
Versгo: 0.1
*/
/*
native CreatePlayerTextDraw(textdrawid, Float:x, Float:y, string[])
native SetPlayerTextDrawString(playerid, textdrawid, string[])
native ShowPlayerTextDraw(playerid, textdrawid, bool:Show)
native SetPlayerTextDrawColor(playerid, textdrawid, cor)
native SetPlayerTextDrawBGColor(playerid, textdrawid, cor)
native SetPlayerTextDrawFont(playerid, textdrawid, fonte)
native SetPlayerTextDrawLetterSize(playerid, textdrawid, Float:x, Float:y)
native SetPlayerTextDrawOutline(playerid, textdrawid, tamanho)
native SetPlayerTextDrawProportional(playerid, textdrawid, tipo)
*/
#define MAX_PLAYERS_IN_GAME 50
new Text:PTEXTDRAW[(MAX_PLAYERS_IN_GAME+1)][51];
stock CreatePlayerTextDraw(textdrawid, Float:x, Float:y, string[])
{
for(new i = 0;i <= MAX_PLAYERS_IN_GAME;i++)
{
PTEXTDRAW[i][textdrawid] = TextDrawCreate(x, y, string);
}
return 1;
}
stock SetPlayerTextDrawString(playerid, textdrawid, string[])
{
TextDrawSetString(PTEXTDRAW[playerid][textdrawid], string);
return 1;
}
stock ShowPlayerTextDraw(playerid, textdrawid, bool:Show)
{
if(Show)
{
TextDrawShowForPlayer(playerid, PTEXTDRAW[playerid][textdrawid]);
}
else
{
TextDrawHideForPlayer(playerid, PTEXTDRAW[playerid][textdrawid]);
}
return 1;
}
stock SetPlayerTextDrawColor(playerid, textdrawid, cor)
{
TextDrawColor(PTEXTDRAW[playerid][textdrawid], cor);
return 1;
}
stock SetPlayerTextDrawBGColor(playerid, textdrawid, cor)
{
TextDrawBackgroundColor(PTEXTDRAW[playerid][textdrawid], cor);
return 1;
}
stock SetPlayerTextDrawFont(playerid, textdrawid, fonte)
{
TextDrawFont(PTEXTDRAW[playerid][textdrawid], fonte);
return 1;
}
stock SetPlayerTextDrawLetterSize(playerid, textdrawid, Float:x, Float:y)
{
TextDrawLetterSize(PTEXTDRAW[playerid][textdrawid], Float:x, Float:y);
return 1;
}
stock SetPlayerTextDrawOutline(playerid, textdrawid, tamanho)
{
TextDrawSetOutline(PTEXTDRAW[playerid][textdrawid], tamanho);
return 1;
}
stock SetPlayerTextDrawProportional(playerid, textdrawid, tipo)
{
TextDrawSetProportional(PTEXTDRAW[playerid][textdrawid], tipo);
return 1;
}
stock StopPlayerTextDraw()
{
for(new i = 0;i <= MAX_PLAYERS_IN_GAME;i++)
{
for(new td = 0;td <= MAX_PLAYERS_IN_GAME;td++)
{
TextDrawDestroy(PTEXTDRAW[i][td]);
}
}
return 1;
}
Espero ter ajudado