Attach paused 3dtext to a player -
Cypress - 04.08.2010
Hello again.
I need to do so if a player will pause it will show that he is paused.
I want to show it on players body with 3dtext on them. The 3dtext color red, message to display "paused".
So it will show that the pleyer who paused "paused"
Thanks for the help.
Re: Attach paused 3dtext to a player -
VictorMartinez - 05.08.2010
and for the notice... this IS possible for the people who say it's not b/c i've seen it on a server and it works. Personally i don't know how though...
Re: Attach paused 3dtext to a player -
Kar - 05.08.2010
Quote:
Originally Posted by VictorMartinez
and for the notice... this IS possible for the people who say it's not b/c i've seen it on a server and it works. Personally i don't know how though...
|
Point In Your Post? he knows its possible. you have no reason for posting<.<
Re: Attach paused 3dtext to a player -
Flake. - 05.08.2010
Partyserver uses this i happen to know how it works, Pressing Esc is the same as Alt + Tab so just use that
Re: Attach paused 3dtext to a player -
Cypress - 05.08.2010
EDIT: I made the script but know i don't know how to hide the 3dtext if player is back. Here is the script.
Код:
new Text3D:Paused[MAX_PLAYERS];
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(PRESSED(KEY_ACTION) && (KEY_FIRE))
{
Paused[playerid] = Create3DTextLabel("Paused",COLOR_LRED,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToPlayer(Paused[playerid], playerid, 0.0, 0.0, 3.0);
}
return 1;
}
Now i need to hide it when player is back... BTW how?
Re: Attach paused 3dtext to a player -
Mike Garber - 05.08.2010
Check If the player moves.
Re: Attach paused 3dtext to a player -
iggy1 - 05.08.2010
I havn't tested but maybe this will work (if OnPlayerKeyStateChange works while paused probably does)
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(GetPVarInt(playerid,"ispaused")==1)
{
if(PRESSED(KEY_ACTION) && (KEY_FIRE))
{
Delete3DTextLabel(paused[playerid]);
DeletePVar(playerid,"ispaused");
return 1;
}
}
if(PRESSED(KEY_ACTION) && (KEY_FIRE))
{
Paused[playerid] = Create3DTextLabel("Paused",COLOR_LRED,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToPlayer(Paused[playerid], playerid, 0.0, 0.0, 3.0);
SetPVarInt(playerid,"ispaused",1);
}
return 1;
}
Re: Attach paused 3dtext to a player -
Mike Garber - 05.08.2010
I highly doubt It does when you're not in the game.
Re: Attach paused 3dtext to a player -
iggy1 - 05.08.2010
Does it still not have to check if keys are being pressed? like to unpause? I thought you was ingame untill you quit.
Re: Attach paused 3dtext to a player -
Cypress - 05.08.2010
Quote:
Originally Posted by iggy1
I havn't tested but maybe this will work (if OnPlayerKeyStateChange works while paused probably does)
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if(GetPVarInt(playerid,"ispaused")==1) { if(PRESSED(KEY_ACTION) && (KEY_FIRE)) { Delete3DTextLabel(paused[playerid]); DeletePVar(playerid,"ispaused"); return 1; } } if(PRESSED(KEY_ACTION) && (KEY_FIRE)) { Paused[playerid] = Create3DTextLabel("Paused",COLOR_LRED,30.0,40.0,50.0,40.0,0); Attach3DTextLabelToPlayer(Paused[playerid], playerid, 0.0, 0.0, 3.0); SetPVarInt(playerid,"ispaused",1); } return 1; }
|
Will this work?