3DTEXTLABEL help -
UnAngel - 10.09.2012
Hello i start to bullid a mask system but i have problem its work only to id 0 please help me
PHP код:
public OneSecondPublic(playerid)
{
Delete3DTextLabel(Mask[playerid]);
new Float: Health, Float: Armour, ArmourMathFlaw, HealthMathFlaw;
GetPlayerHealth(playerid, Health);
GetPlayerArmour(playerid, Armour);
HealthMathFlaw = floatround(Health, floatround_ceil);
ArmourMathFlaw = floatround(Armour, floatround_ceil);
MaskedName[playerid] = Player[playerid][MaskRandom];
format(sendername, MAX_PLAYER_NAME, "Mask[%d]\nHP:%d AR:%d",MaskedName[playerid],HealthMathFlaw,ArmourMathFlaw);
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
Mask[playerid] = Create3DTextLabel(sendername,WHITE,x,y,z+2,20,0,0);
Attach3DTextLabelToPlayer(Mask[playerid],playerid,0.0,0.0,0.0);
)
Re: 3DTEXTLABEL help -
Roko_foko - 10.09.2012
Where do you call this OneSecondPublic?
Re: 3DTEXTLABEL help -
UnAngel - 11.09.2012
on gamemodeint
OneSecondTimer = SetTimer("OneSecondPublic", 1000, true);
Re: 3DTEXTLABEL help -
clarencecuzz - 11.09.2012
There is no 'playerid' parameter in OnGameModeInit...
You need to use this in a public function that involves a playerid parameter, for example, in a command under OnPlayerCommandText or OnPlayerConnect etc.
Re: 3DTEXTLABEL help -
mamorunl - 11.09.2012
Plus that you cannot create the playerid parameter out of the blue. You have to assign it to the timer with SetTimerEx("OneSecondPublic", 1000, true, "i", playerid);
Re: 3DTEXTLABEL help -
Audiophr3ak - 11.09.2012
PHP код:
public OneSecondPublic()
{
for (new i; i < MAX_PLAYERS; i++)
{
new Float: Health, Float: Armour, ArmourMathFlaw, HealthMathFlaw;
GetPlayerHealth(i, Health);
GetPlayerArmour(i, Armour);
HealthMathFlaw = floatround(Health, floatround_ceil);
ArmourMathFlaw = floatround(Armour, floatround_ceil);
MaskedName[i] = Player[i][MaskRandom];
format(sendername, MAX_PLAYER_NAME, "Mask[%d]\nHP:%d AR:%d",MaskedName[playerid],HealthMathFlaw,ArmourMathFlaw);
Update3DTextLabelText(Mask[i], 0xFFFFFFFF, sendername);
}
return 1;
}
Re: 3DTEXTLABEL help -
clarencecuzz - 11.09.2012
Quote:
Originally Posted by Audiophr3ak
PHP код:
public OneSecondPublic()
{
for (new i; i < MAX_PLAYERS; i++)
{
new Float: Health, Float: Armour, ArmourMathFlaw, HealthMathFlaw;
GetPlayerHealth(i, Health);
GetPlayerArmour(i, Armour);
HealthMathFlaw = floatround(Health, floatround_ceil);
ArmourMathFlaw = floatround(Armour, floatround_ceil);
MaskedName[i] = Player[i][MaskRandom];
format(sendername, MAX_PLAYER_NAME, "Mask[%d]\nHP:%d AR:%d",MaskedName[playerid],HealthMathFlaw,ArmourMathFlaw);
Update3DTextLabelText(Mask[i], 0xFFFFFFFF, sendername);
}
return 1;
}
|
Wrong...
pawn Код:
public OnGameModeInit()
{
SetTimer("OneSecondPublic", 1000, true);
return 1;
}
forward OneSecondPublic();
public OneSecondPublic()
{
for (new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new Float: Health, Float: Armour, ArmourMathFlaw, HealthMathFlaw;
GetPlayerHealth(i, Health);
GetPlayerArmour(i, Armour);
HealthMathFlaw = floatround(Health, floatround_ceil);
ArmourMathFlaw = floatround(Armour, floatround_ceil);
MaskedName[i] = Player[i][MaskRandom];
format(sendername, MAX_PLAYER_NAME, "Mask[%d]\nHP:%d AR:%d",MaskedName[i],HealthMathFlaw,ArmourMathFlaw);
Update3DTextLabelText(Mask[i], 0xFFFFFFFF, sendername);
}
}
return 1;
}
Re: 3DTEXTLABEL help -
Audiophr3ak - 11.09.2012
Quote:
Originally Posted by clarencecuzz
Wrong...
pawn Код:
public OnGameModeInit() { SetTimer("OneSecondPublic", 1000, true); return 1; }
forward OneSecondPublic(); public OneSecondPublic() { for (new i; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { new Float: Health, Float: Armour, ArmourMathFlaw, HealthMathFlaw; GetPlayerHealth(i, Health); GetPlayerArmour(i, Armour); HealthMathFlaw = floatround(Health, floatround_ceil); ArmourMathFlaw = floatround(Armour, floatround_ceil); MaskedName[i] = Player[i][MaskRandom]; format(sendername, MAX_PLAYER_NAME, "Mask[%d]\nHP:%d AR:%d",MaskedName[i],HealthMathFlaw,ArmourMathFlaw); Update3DTextLabelText(Mask[i], 0xFFFFFFFF, sendername); } } return 1; }
|
WRONG?! You trollin' meh? He already forwarded that function and made a timer.
Re: 3DTEXTLABEL help -
mamorunl - 11.09.2012
You forgot to check if the player is connected which could've caused some unexpected side effects
Re: 3DTEXTLABEL help -
Audiophr3ak - 11.09.2012
Quote:
Originally Posted by mamorunl
You forgot to check if the player is connected which could've caused some unexpected side effects
|
IK, i just edited it basically to make it work atleast.