03.05.2012, 20:19
Create the textdraw OnPlayerConnect, not OnGameModeInit. You can't pass a playerid parameter OnGameModeInit, hense why the looped value ( [ i ] ) is giving you an error.
OnPlayerConnect, do it like this..
Of course, after this, don't forget to set either a global or per-player timer to update the string every (1?) second or so.
SetTimerEx (per-player) or SetTimer will suffice for this.
OnPlayerConnect, do it like this..
pawn Код:
public OnPlayerConnect ( playerid )
{
YourTextDraw [ playerid ] = TextDrawCreate(498.000000, 80.000000, "Cash: $");
TextDrawBackgroundColor(YourTextDraw [ playerid ], 1711276202);
TextDrawFont(YourTextDraw [ playerid ], 3);
TextDrawLetterSize(YourTextDraw [ playerid ], 0.329998, 1.799999);
TextDrawColor(YourTextDraw [ playerid ], -1);
TextDrawSetOutline(YourTextDraw [ playerid ], 1);
TextDrawSetProportional(YourTextDraw [ playerid ], 1);
TextDrawUseBox(YourTextDraw [ playerid ], 1);
TextDrawBoxColor(YourTextDraw [ playerid ], 255);
TextDrawTextSize(YourTextDraw [ playerid ], 606.000000, 4.000000);
TextDrawShowForPlayer( playerid, YourTextDraw [ playerid ] );
return true;
}
SetTimerEx (per-player) or SetTimer will suffice for this.