Textdraw not showing up? - 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: Textdraw not showing up? (
/showthread.php?tid=183489)
Textdraw not showing up? -
Naxix - 15.10.2010
Hi, i was makeing a textdraw to display some text for each class at OnPlayerRequestClass, but for some reason it's not showing up at all. Tho textdraws isn't my strongest side either, but i made em before.
pawn Код:
OnGameModeInnit()
{
RequestSpawn = TextDrawCreate(300.000000,250.000000," ");
TextDrawFont(RequestSpawn, 3);
TextDrawTextSize(RequestSpawn,3,3);
TextDrawColor(RequestSpawn,0x33AA33AA);
}
pawn Код:
OnPlayerRequestClass()
{
new Sstring[40];
switch(5)
{
case 0:
{
if(team1 != 2)
{
format(Sstring,sizeof(Sstring),"Class 1");
TextDrawSetString(RequestSpawn,Sstring);
TextDrawColor(RequestSpawn,0x33AA33AA);
}
else
{
format(Sstring,sizeof(Sstring),"This class is full");
TextDrawSetString(RequestSpawn,Sstring);
TextDrawColor(RequestSpawn,0x33AA33AA);
}
}
// And so on..
pawn Код:
OnPlayerConnect()
{
TextDrawShowForPlayer(playerid,RequestSpawn);
}
Anyone see the problem?
Re: Textdraw not showing up? -
RenisiL - 17.10.2010
Top:
pawn Код:
# define SKIN_1 (0)
# define SKIN_2 (1)
new
Text:RequestSpawn[ MAX_PLAYERS ]
;
After OnGameModeInit:
pawn Код:
for(new playerid = 0; playerid <MAX_PLAYERS; playerid++)
{
RequestSpawn[ playerid ] = TextDrawCreate( 300.000000,250.000000," " );
TextDrawFont ( RequestSpawn[ playerid ] , 3 );
TextDrawTextSize( RequestSpawn[ playerid ], 3, 3 );
TextDrawColor ( RequestSpawn[ playerid ] , 0x33AA33AA );
}
pawn Код:
public OnPlayerRequestClass( playerid, classid )
{
SetPlayerClass( playerid, classid );
gPlayerClass[ playerid ] = classid;
switch ( classid )
{
case SKIN_1:
{
TextDrawSetString( RequestSpawn[ playerid] ,"~w~Class: 1" );
}
case SKIN_2:
{
TextDrawSetString( RequestSpawn[ playerid ],"~w~Class: 2" ) ;
}
}
TextDrawShowForPlayer( playerid, RequestSpawn[ playerid ] );
return true;
}