Problem
#1

Well, i'm using the OnPlayerPause Include..
Now this is the part of it

PHP код:
public OnPlayerPause(playerid)
{
    new 
name[MAX_PLAYER_NAME], string[44];
    
GetPlayerName(playeridnamesizeof(name));
    
format(stringsizeof(string), "%s has Paused",name);
    
SendClientMessageToAll(COLOR_LIGHTBLUEstring);
    return 
0;
}
public 
OnPlayerUnPause(playerid)
{
    new 
name[MAX_PLAYER_NAME], string[44];
    
GetPlayerName(playeridnamesizeof(name));
    
format(stringsizeof(string), "%s has Returned",name);
    
SendClientMessageToAll(COLOR_LIGHTBLUEstring);
    return 
0;

I want to add something like if he PAUSES, it will make a 3DText above his head, and it will disappear when he comes back. I made one, but it dosen't DELETE when the player comes back. Please help, thanks
Reply
#2

you made a new variable ontop of your other one "string" so i assume it will delete when you call the new one in onplayerunpause ?
Reply
#3

Quote:
Originally Posted by English-Conceptz
Посмотреть сообщение
you made a new variable ontop of your other one "string" so i assume it will delete when you call the new one in onplayerunpause ?
You mean the Message? Oh there's no problem in it. only in the 3DText
Reply
#4

no i meant :

new string[44];
Reply
#5

Try this:
Код:
new Text3D:AFKLabel[MAX_PLAYERS] // Add this ABOVE OnFilterScriptInit() or OnGameModeInit()
public OnPlayerPause(playerid) 
{ 
    new name[MAX_PLAYER_NAME], string[44];
     
    GetPlayerName(playerid, name, sizeof(name)); 
    format(string, sizeof(string), "%s has Paused",name);
    AFKLabel[playerid] = Create3DTextLabel("Player is AFK",0xFFFF00AA,0,0,0,50,-1,1);
    Attach3DTextLabelToPlayer(AFKLabel[playerid], playerid, 0,0,0);    
    SendClientMessageToAll(COLOR_LIGHTBLUE, string); 
    return 0; 
} 

public OnPlayerUnPause(playerid) 
{ 
    new name[MAX_PLAYER_NAME], string[44]; 
    GetPlayerName(playerid, name, sizeof(name)); 
    format(string, sizeof(string), "%s has Returned",name);
    Delete3DTextLabel(AFKLabel[playerid]); 
    SendClientMessageToAll(COLOR_LIGHTBLUE, string); 
    return 0; 
}
Reply
#6

Thank you very much, +Rep from me
- Working now
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)