Stupid textdraws... -
PerformerFX - 21.06.2013
Deleted
Re: Stupid textdraws... -
Vince - 21.06.2013
I doubt it. If an error tells you that the amount of arguments isn't correct, what is the first thing you do? Right, you check your arguments.
PlayerTextDraw functions require a
playerid.
Re: Stupid textdraws... -
Antonio144 - 21.06.2013
Change
pawn Код:
TD = CreatePlayerTextDraw(3.666702, 281.659332, "/god:");
// TO
TD[playerid] = CreatePlayerTextDraw(3.666702, 281.659332, "/god:");
And as stated above add playerid.
AW: Re: Stupid textdraws... -
PerformerFX - 21.06.2013
Quote:
Originally Posted by Antonio144
Change
And as stated above add playerid.
|
But where and how?
Re: Stupid textdraws... -
RedFusion - 21.06.2013
https://sampwiki.blast.hk/wiki/CreatePlayerTextDraw
CreatePlayerTextDraw(playerid,.....)
AW: Stupid textdraws... -
PerformerFX - 21.06.2013
YES FINALLY THANKS
AW: Stupid textdraws... -
PerformerFX - 21.06.2013
Shit. I got no error codes but the overall code doesn't work :/
Код:
new God[MAX_PLAYERS] = 0;
new PlayerText:TD[MAX_PLAYERS];
//PlayerConnect
{
TD[playerid] = CreatePlayerTextDraw(playerid,3.666702, 281.659332, "/god:");
PlayerTextDrawLetterSize(playerid,TD[playerid], 0.285999, 1.371851);
PlayerTextDrawAlignment(playerid,TD[playerid], 1);
PlayerTextDrawColor(playerid,TD[playerid], -1);
PlayerTextDrawSetShadow(playerid,TD[playerid], 2);
PlayerTextDrawSetOutline(playerid,TD[playerid], 0);
PlayerTextDrawBackgroundColor(playerid,TD[playerid], 51);
PlayerTextDrawFont(playerid,TD[playerid], 2);
PlayerTextDrawSetProportional(playerid,TD[playerid], 1);
new text[32];
switch(God[playerid])
{
case 0: format(text, sizeof(text), "/god: AUS");
case 1: format(text, sizeof(text), "/god: AN");
}
PlayerTextDrawSetString(playerid, TD[playerid], text);
PlayerTextDrawShow(playerid, TD[playerid]);
//PlayerSpawn
God[playerid] = 1;
//Playercommand
if(strcmp("/god", cmdtext, true, 10) == 0)
{
if (God[playerid] == 1)
{
SendClientMessage(playerid, Rot, "God Modus aus. Du bist nun Verwundbar!");
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
God[playerid] = 0;
return 1;
}
else if(God[playerid] == 0)
{
SendClientMessage(playerid, Hellblau, "God Modus an. Du bist nun Unverwundbar.");
God[playerid] = 1;
SetPlayerArmour(playerid, 10000);
SetPlayerHealth(playerid, 10000);
return 1;
}
Does someone know an answer? The Textdraw just keeps on "/god: AUS" no matter what I do
Re: Stupid textdraws... -
Antonio144 - 21.06.2013
When player spawns you need to update the textdraw.
And the switch on OnPlayerConnect is redundant. I mean, when player connects God[] will always be 0. This might not be the full code so it is possible I am wrong.
AW: Stupid textdraws... -
PerformerFX - 22.06.2013
Do you have an example?
Re: Stupid textdraws... -
Antonio144 - 22.06.2013
pawn Код:
new God[MAX_PLAYERS] = 0;
new PlayerText:TD[MAX_PLAYERS];
//PlayerSpawn
TD[playerid] = CreatePlayerTextDraw(playerid,3.666702, 281.659332, "/god: AUS");
PlayerTextDrawLetterSize(playerid,TD[playerid], 0.285999, 1.371851);
PlayerTextDrawAlignment(playerid,TD[playerid], 1);
PlayerTextDrawColor(playerid,TD[playerid], -1);
PlayerTextDrawSetShadow(playerid,TD[playerid], 2);
PlayerTextDrawSetOutline(playerid,TD[playerid], 0);
PlayerTextDrawBackgroundColor(playerid,TD[playerid], 51);
PlayerTextDrawFont(playerid,TD[playerid], 2);
PlayerTextDrawSetProportional(playerid,TD[playerid], 1);
PlayerTextDrawShow(playerid, TD[playerid]);
/*When player spawns it will show the textdraw "/god: AUS" (god mode off)*/
//Playercommand
if(strcmp("/god", cmdtext, true, 10) == 0)
{
if (God[playerid] == 1)
{
SendClientMessage(playerid, Rot, "God Modus aus. Du bist nun Verwundbar!");
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
God[playerid] = 0;
new text[32];
format(text, sizeof(text), "/god: AUS");
PlayerTextDrawSetString(playerid, TD[playerid], text);
return 1
}
else if(God[playerid] == 0)
{
SendClientMessage(playerid, Hellblau, "God Modus an. Du bist nun Unverwundbar.");
God[playerid] = 1;
SetPlayerArmour(playerid, 10000);
SetPlayerHealth(playerid, 10000);
new text[32];
format(text, sizeof(text), "/god: AN");
PlayerTextDrawSetString(playerid, TD[playerid], text);
return 1;
}
/*Textdraw will be updated with text of current god mode status*/
I hope I got the idea right.