Strings and textdraws?
#1

Hello, I am wondering if i can place a string or a enum value in a textdraw, like this
pawn Код:
Textdraw0 = TextDrawCreate(300.000000, 412.000000, "kills: PlayerInfo[playerid[pKills]");
if somebody could help me i'd be VERY, VERY thankful.
Reply
#2

new string[116];
format(string, sizeof(string), "Kills : %d", PlayerInfo[playerid][pKills]);
TextDrawSetString(TextDrawName, string);
Reply
#3

will try it, brb :P
Reply
#4

pawn Код:
C:\Archivos de programa\Rockstar Games\GTA San Andreas\SA-MP 0.3b\Server 0.3b\gamemodes\fierroharb.pwn(176) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
pawn Код:
public OnGameModeInit()
{
    // other shit
    Textdraw1 = TextDrawCreate(70.000000, 431.000000, "kills: %d");
    TextDrawAlignment(Textdraw1, 2);
    TextDrawBackgroundColor(Textdraw1, 0);
    TextDrawFont(Textdraw1, 3);
    TextDrawLetterSize(Textdraw1, 0.709999, 1.500000);
    TextDrawColor(Textdraw1, 2021837055);
    TextDrawSetOutline(Textdraw1, 0);
    TextDrawSetProportional(Textdraw1, 1);
    TextDrawSetShadow(Textdraw1, 1);
    TextDrawUseBox(Textdraw1, 1);
    TextDrawBoxColor(Textdraw1, 255);
    TextDrawTextSize(Textdraw1, 125.000000, 712.000000);
    new string[116];
    format(string, sizeof(string), "Kills : %d", PlayerInfo[playerid][pKills]);
    TextDrawSetString(Textdraw0, string);
// more other shit
Reply
#5

As you can see, the OnGameModeInit doesn't have the parameters "playerid".

You must put it on a callback that has playerid.
Reply
#6

Quote:
Originally Posted by ViruZZzZ_ChiLLL
Посмотреть сообщение
As you can see, the OnGameModeInit doesn't have the parameters "playerid".

You must put it on a callback that has playerid.
Like OnPlayerSpawn?
Reply
#7

yes, or OnPlayerConnect, and remember to always update it OnPlayerDeath

This forum requires that you wait 120 seconds between posts. Please try again in 11 seconds.
Reply
#8

Quote:
Originally Posted by i514x_
Посмотреть сообщение
yes, or OnPlayerConnect, and remember to always update it OnPlayerDeath

This forum requires that you wait 120 seconds between posts. Please try again in 11 seconds.
Thanks for everything if something goes wrong I will post it
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)