Playerid!
#1

Код:
C:\Users\Taha\Desktop\Modern Century Roleplay\gamemodes\mw2.pwn(88) : error 017: undefined symbol "playerid"
C:\Users\Taha\Desktop\Modern Century Roleplay\gamemodes\mw2.pwn(89) : error 017: undefined symbol "playerid"
C:\Users\Taha\Desktop\Modern Century Roleplay\gamemodes\mw2.pwn(90) : error 017: undefined symbol "playerid"
C:\Users\Taha\Desktop\Modern Century Roleplay\gamemodes\mw2.pwn(91) : error 017: undefined symbol "playerid"
C:\Users\Taha\Desktop\Modern Century Roleplay\gamemodes\mw2.pwn(92) : error 017: undefined symbol "playerid"
C:\Users\Taha\Desktop\Modern Century Roleplay\gamemodes\mw2.pwn(93) : error 017: undefined symbol "playerid"
C:\Users\Taha\Desktop\Modern Century Roleplay\gamemodes\mw2.pwn(94) : error 017: undefined symbol "playerid"
C:\Users\Taha\Desktop\Modern Century Roleplay\gamemodes\mw2.pwn(95) : error 017: undefined symbol "playerid"
Код:
	AButton[playerid] = CreatePlayerTextDraw(playerid,181 ,167 , "Army");
	PlayerTextDrawBackgroundColor(playerid,AButton[playerid], 255);
	PlayerTextDrawFont(playerid,AButton[playerid], 1);
	PlayerTextDrawLetterSize(playerid,AButton[playerid], 1.500000, 1.500000);
	PlayerTextDrawColor(playerid,AButton[playerid], -1);
	PlayerTextDrawSetOutline(playerid,AButton[playerid], 0);
	PlayerTextDrawSetProportional(playerid,AButton[playerid], 1);
	PlayerTextDrawSetShadow(playerid,AButton[playerid], 1);
Please help. Thank u!
Reply
#2

I assume you are doing this under OnGameInit, if so, you will need to use foreach so you can set every player's textdraw.
pawn Код:
foreach(Player, i)
{
        AButton[i] = CreatePlayerTextDraw(i,181 ,167 , "Army");
    PlayerTextDrawBackgroundColor(i,AButton[i], 255);
    PlayerTextDrawFont(i,AButton[i], 1);
    PlayerTextDrawLetterSize(i,AButton[i], 1.500000, 1.500000);
    PlayerTextDrawColor(i,AButton[i], -1);
    PlayerTextDrawSetOutline(i,AButton[i], 0);
    PlayerTextDrawSetProportional(i,AButton[i], 1);
    PlayerTextDrawSetShadow(i,AButton[i], 1);
}
Reply
#3

Quote:
Originally Posted by dominik523
Посмотреть сообщение
I assume you are doing this under OnGameInit, if so, you will need to use foreach so you can set every player's textdraw.
pawn Код:
foreach(Player, i)
{
        AButton[i] = CreatePlayerTextDraw(i,181 ,167 , "Army");
    PlayerTextDrawBackgroundColor(i,AButton[i], 255);
    PlayerTextDrawFont(i,AButton[i], 1);
    PlayerTextDrawLetterSize(i,AButton[i], 1.500000, 1.500000);
    PlayerTextDrawColor(i,AButton[i], -1);
    PlayerTextDrawSetOutline(i,AButton[i], 0);
    PlayerTextDrawSetProportional(i,AButton[i], 1);
    PlayerTextDrawSetShadow(i,AButton[i], 1);
}
yes i do it under GameModeInit. Now whenn i use ur:
Код:
C:\Users\Taha\Desktop\Modern Century Roleplay\gamemodes\mw2.pwn(88) : error 010: invalid function or declaration
I included foreach and all
Reply
#4

Use it under OnPlayerConnect, as OnGameModeInit doesn't have playerid.
Reply
#5

in what line you get this error ?
Reply
#6

replace playerid with MAX_PLAYERS
Reply
#7

It's per-player textdraw so it must be in OnPlayerConnect and not in any other callback with loops.
Quote:
Originally Posted by MatriXgaMer
Посмотреть сообщение
replace playerid with MAX_PLAYERS
Array index out of bounds.
Reply
#8

You can't set player text draws to non players, unless you are using global text draws.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)