SA-MP Forums Archive
Playerid! - 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)
+--- Thread: Playerid! (/showthread.php?tid=487986)



Playerid! - UnknownOwner - 16.01.2014

Код:
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!


Re: Playerid! - dominik523 - 16.01.2014

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



Re: Playerid! - UnknownOwner - 16.01.2014

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


Re: Playerid! - iOxide - 16.01.2014

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


Re: Playerid! - Omar55555 - 16.01.2014

in what line you get this error ?


Re: Playerid! - MatriXgaMer - 16.01.2014

replace playerid with MAX_PLAYERS


Re: Playerid! - Konstantinos - 16.01.2014

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.


AW: Playerid! - BigETI - 16.01.2014

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