[HELP]Texdraw score help
#1

im making one script and i got there errors

Код:
C:\Users\Tin\Desktop\g\gamemodes\script.pwn(367) : error 028: invalid subscript (not an array or too many subscripts): "Textdraw5"
C:\Users\Tin\Desktop\g\gamemodes\script.pwn(367) : warning 215: expression has no effect
C:\Users\Tin\Desktop\g\gamemodes\script.pwn(367) : error 001: expected token: ";", but found "]"
C:\Users\Tin\Desktop\g\gamemodes\script.pwn(367) : error 029: invalid expression, assumed zero
C:\Users\Tin\Desktop\g\gamemodes\script.pwn(367) : fatal error 107: too many error messages on one line
Here are codes:

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new score = GetPlayerScore(killerid);
    format(string, sizeof(string),"Murders:%d" ,score+1);
    TextDrawSetString(Textdraw5[killerid],string);

	return 1;
}
Reply
#2

Make sure you have
pawn Код:
new
    Text: Textdraw5[MAX_PLAYERS];
Instead of
pawn Код:
new
    Text: Textdraw5;
If you want to create a TextDraw just for a player, then use this :
https://sampwiki.blast.hk/wiki/CreatePlayerTextDraw

e.g :
pawn Код:
new
    PlayerText: Textdraw5[ MAX_PLAYERS ];

public OnPlayerConnect( playerid )
{
    Textdraw5[ playerid ] = CreatePlayerTextDraw .....
    PlayerTextDrawShow( playerid, Textdraw5[ playerid ] )
    return 1;
}

public OnPlayerDeath( playerid, killerid, reason )
{
    PlayerTextDrawSetString( playerid, Textdraw5[ playerid ], "Hello" );
    return 1;
}
Reply
#3

thank you now it works
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)