[HELP]Texdraw score help - 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: [HELP]Texdraw score help (
/showthread.php?tid=416483)
[HELP]Texdraw score help -
Ryder1997 - 17.02.2013
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;
}
Re: [HELP]Texdraw score help -
greentarch - 17.02.2013
Make sure you have
pawn Код:
new
Text: Textdraw5[MAX_PLAYERS];
Instead of
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;
}
Re: [HELP]Texdraw score help -
Ryder1997 - 17.02.2013
thank you now it works