Textdraw not showing up?
#1

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

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;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)