public OnPlayerPause(playerid)
{
new name[MAX_PLAYER_NAME], string[44];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s has Paused",name);
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);
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
return 0;
}
|
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 ?
|
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;
}
