show gametextforplayer idle/desktop
#1

Hi I would like to make a gametextforplayer to a player who is shooting an idle player.

Sample: If player1 is idle mode/afk and player2 is shooting the player1, then show gametextforplayer to player2 for 3 seconds like "Player is IDLE"


Thanks in advance. Looking forward.
Reply
#2

Do you have any codes for checking if the player is afk?
Reply
#3

Quote:
Originally Posted by RedWolfX
Посмотреть сообщение
Do you have any codes for checking if the player is afk?
Sorry I forgot to add. This is without command or without typing any commands like /afk.
I just want to make it automatic.

>> Check if player1 is idle, if player1 is idle and player2 is shooting player1 then show gametextforplayer to player2 "This player is idle" Additional to this. The idle time is around 5 minutes, if player1 didn't made any movements for 5 minutes then set him idle.
Reply
#4

You could use Smart AFKTabbing (Detect AFK, Alt-Tab, and Macro) and use it onplayertakedamage

EDIT: I will post a code on OnPlayerDamage in a bit

EDIT2: This is just an example code on how it could be done. This is with the AFK include

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    IsPlayerAFKing{playerid}
    {
        GameTextForPlayer(issuerid, "The player you're attacking is afk", 5000, 2)
    }
    return 1;
}
Reply
#5

Quote:
Originally Posted by RedWolfX
Посмотреть сообщение
You could use Smart AFKTabbing (Detect AFK, Alt-Tab, and Macro) and use it onplayertakedamage
aww sweet! this is what I am looking for and it would be great if you help me with the script for onplayertakedamage.

EDIT: I tried to search and I found this auto afk system without typing anything /afk. But can you show me what will I put in onplayertakedamage?

https://sampforum.blast.hk/showthread.php?tid=381125

Thanks for your effort +rep

EDIT: I liked your simple script than the link I posted. Too much coding, I just need to detect idle and send a player2 a gametextforplayer
Reply
#6

Quote:
Originally Posted by kbalor
Посмотреть сообщение
aww sweet! this is what I am looking for and it would be great if you help me with the script for onplayertakedamage.

EDIT: I tried to search and I found this auto afk system without typing anything /afk. But can you show me what will I put in onplayertakedamage?

https://sampforum.blast.hk/showthread.php?tid=381125

Thanks for your effort +rep
Thank you

And it with the AFK system you found, it can something like this:

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(Player[playerid][Inactive] == true)
    {
        GameTextForPlayer(issuerid, "The player you're attacking is afk", 5000, 2)
    }
    return 1;
}
Something like that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)