Pkayer 3D Text Label :(
#2

Something like this ?

PHP код:
    if(strcmp(cmdtext,"/afk",true)==0)
    {
        if(
IsPlayerConnected(playerid))
        {
            {
                if(
afk[playerid] == 0)
                {
                    if(
AfkTimerTimer[playerid]) return SendClientMessage(playerid,COLOR_GREY,"   You must wait 3 seconds before using that again !");
                    
GetPlayerPos(playeridPlayerPosition[playerid][PosX], PlayerPosition[playerid][PosY], PlayerPosition[playerid][PosZ]);
                    
AfkTimerTimer[playerid] = 1;
                    
SendClientMessage(playeridCOLOR_GREY,"You must remain in your current position for 10 seconds.");
                    
SetTimerEx("AfkTimer",10*1000,0,"i",playerid);
                    return 
1;
                }
                else
                {
                    
SetPlayerColor(playeridTCOLOR_WHITE);
                    
format(stringsizeof(string), "[AdmWarning]: %s Is no longer AFK",PlayerName(playerid));
                    
ABroadCast(COLOR_YELLOW,string,1);
                    
SetPlayerHealth(playerid30);
                    
AfkTimerTimer[playerid] = 0;
                    
Delete3DTextLabel(AFKLabel[playerid]);
                    
SendClientMessage(playeridCOLOR_GREY"You are no longer in AFK mode, and you are now able to move again!");
                    
TogglePlayerControllable(playerid1);
                    
afk[playerid] = 0;
                    return 
1;
                }
            }
        }
        return 
1;
    } 
And

PHP код:
public AfkTimer(playerid)
{
    if(!
IsPlayerConnected(playerid)) return 0;
    if(
AfkTimerTimer[playerid])
    {
        new 
Float:XFloat:YFloat:Z;
        
GetPlayerPos(playeridXYZ);
        if(
PlayerPosition[playerid][PosX] == && PlayerPosition[playerid][PosY] == && PlayerPosition[playerid][PosZ] == Z)
        {
            
SetPlayerColor(playeridTCOLOR_LIGHTGREEN);
            
SetPlayerHealth(playerid999);
            
AFKLabel[playerid] = Create3DTextLabel("Player is AFK",0x008B00FF,0,0,0,50,-1,1);
            
Attach3DTextLabelToPlayer(AFKLabel[playerid], playerid0,0,0);
            
SendClientMessage(playeridCOLOR_GREY"You are now AFK, and you are not able to move.(type /afk to exit the AFK mode)");
              
TogglePlayerControllable(playerid0);
            
afk[playerid] = 1;
            
AfkTimerTimer[playerid] = 0;
            
SendClientMessage(playeridCOLOR_YELLOW"You are now AFK.");
        }
        else
        {
            
AfkTimerTimer[playerid] = 0;
            
SendClientMessage(playeridCOLOR_GREY"   You have moved from your position !");
        }
    }
    return 
1;

And at the Top :

PHP код:
forward AfkTimer(playerid); 
Reply


Messages In This Thread
Pkayer 3D Text Label :( - by Thresholdold - 28.11.2011, 08:33
Re: Pkayer 3D Text Label :( - by -CaRRoT - 28.11.2011, 08:36
Re: Pkayer 3D Text Label :( - by Thresholdold - 28.11.2011, 08:40
Re: Pkayer 3D Text Label :( - by -CaRRoT - 28.11.2011, 08:42
Re: Pkayer 3D Text Label :( - by System64 - 28.11.2011, 08:42
Re: Pkayer 3D Text Label :( - by -CaRRoT - 28.11.2011, 08:46
Re: Pkayer 3D Text Label :( - by Thresholdold - 28.11.2011, 08:48
Re: Pkayer 3D Text Label :( - by -CaRRoT - 28.11.2011, 08:52
Re: Pkayer 3D Text Label :( - by Aira - 28.11.2011, 09:26
Re: Pkayer 3D Text Label :( - by System64 - 28.11.2011, 09:48

Forum Jump:


Users browsing this thread: 3 Guest(s)