Attach paused 3dtext to a player
#1

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.
Reply
#2

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...
Reply
#3

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<.<
Reply
#4

Partyserver uses this i happen to know how it works, Pressing Esc is the same as Alt + Tab so just use that
Reply
#5

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?
Reply
#6

Check If the player moves.
Reply
#7

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;
}
Reply
#8

I highly doubt It does when you're not in the game.
Reply
#9

Does it still not have to check if keys are being pressed? like to unpause? I thought you was ingame untill you quit.
Reply
#10

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)