Problem with Textdraws
#1

I got problem i get 8 erros with:
Код:
H:\samp03dsvr_win32(1)\gamemodes\DP.pwn(215) : error 017: undefined symbol "playerid"
H:\samp03dsvr_win32(1)\gamemodes\DP.pwn(216) : error 017: undefined symbol "playerid"
H:\samp03dsvr_win32(1)\gamemodes\DP.pwn(217) : error 017: undefined symbol "playerid"
H:\samp03dsvr_win32(1)\gamemodes\DP.pwn(218) : error 017: undefined symbol "playerid"
H:\samp03dsvr_win32(1)\gamemodes\DP.pwn(219) : error 017: undefined symbol "playerid"
H:\samp03dsvr_win32(1)\gamemodes\DP.pwn(220) : error 017: undefined symbol "playerid"
H:\samp03dsvr_win32(1)\gamemodes\DP.pwn(221) : error 017: undefined symbol "playerid"
H:\samp03dsvr_win32(1)\gamemodes\DP.pwn(222) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


8 Errors.
And here are the lines
pawn Код:
Stats[playerid] = TextDrawCreate(499.000000, 110.000000, "~r~Kills: ~w~0 ~g~Deaths: ~w~0");
    TextDrawBackgroundColor(Stats[playerid], 255);
    TextDrawFont(Stats[playerid], 2);
    TextDrawLetterSize(Stats[playerid], 0.159999, 1.000000);
    TextDrawColor(Stats[playerid], -1);
    TextDrawSetOutline(Stats[playerid], 0);
    TextDrawSetProportional(Stats[playerid], 1);
    TextDrawSetShadow(Stats[playerid], 1);
Here is variable
pawn Код:
new Text:Stats[MAX_PLAYERS];
I dont know where is problem if someone know reply here
Reply
#2

change place in pawno (new Text:Stats[MAX_PLAYERS]
Reply
#3

pawn Код:
new Text:Stats[MAX_PLAYERS];
Its allready changed!But Still have that problem!
Reply
#4

I bet you've placed these lines under OnGameModeInit or OnFilterScriptInit, am I right?
Reply
#5

Quote:
Originally Posted by [XST]O_x
Посмотреть сообщение
I bet you've placed these lines under OnGameModeInit or OnFilterScriptInit, am I right?
Yes you are!
Reply
#6

Quote:
Originally Posted by SpiderWalk
Посмотреть сообщение
Yes you are!
OnGameModeInit() has no such parameter as playerid therefore the compiler sees it as undefined.
You need to create all of the textdraws in a loops, or more effeciantly under OnPlayerConnect.

pawn Код:
public OnGameModeInit()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        Stats[i] = TextDrawCreate(499.000000, 110.000000, "~r~Kills: ~w~0 ~g~Deaths: ~w~0");            
        TextDrawBackgroundColor(Stats[i], 255);    TextDrawFont(Stats[playerid], 2);    
        TextDrawLetterSize(Stats[i], 0.159999, 1.000000);    
        TextDrawColor(Stats[i], -1);    
        TextDrawSetOutline(Stats[i], 0);    
        TextDrawSetProportional(Stats[i], 1);    
        TextDrawSetShadow(Stats[i], 1);
    }
    return 1;
}
Reply
#7

Quote:
Originally Posted by [XST]O_x
Посмотреть сообщение
OnGameModeInit() has no such parameter as playerid therefore the compiler sees it as undefined.
You need to create all of the textdraws in a loops, or more effeciantly under OnPlayerConnect.

pawn Код:
public OnGameModeInit()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        Stats[i] = TextDrawCreate(499.000000, 110.000000, "~r~Kills: ~w~0 ~g~Deaths: ~w~0");            
        TextDrawBackgroundColor(Stats[i], 255);    TextDrawFont(Stats[playerid], 2);    
        TextDrawLetterSize(Stats[i], 0.159999, 1.000000);    
        TextDrawColor(Stats[i], -1);    
        TextDrawSetOutline(Stats[i], 0);    
        TextDrawSetProportional(Stats[i], 1);    
        TextDrawSetShadow(Stats[i], 1);
    }
    return 1;
}
Thanks
Reply
#8

The code above is really not recommended. Creating 500 (or 800?) text draws, that some of them used for player ids that not really gonna play is a mistake. A better idea is to create the TD under OnPlayerConnect and destroy it later.
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)