SA-MP Forums Archive
easy afk system - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: easy afk system (/showthread.php?tid=224582)



easy afk system - marinov - 12.02.2011

I know its easy, but its my first time using 3dTextLabels so plz help me


pawn Code:
if(strcmp(cmdtext, "/afk", true) == 0)
    {
        if(IsAFK[playerid] == 0)
        {
            AFKLabel[playerid] = Create3DTextLabel("This Player Is AFK!", RED, 0.0, 0.0, 1000.0, 40.0, 0, 0);
            TogglePlayerControllable(playerid, 0);
            IsAFK[playerid] = 1;
            Attach3DTextLabelToPlayer(AFKLabel[playerid], playerid, 0.0, 0.0, 0.7);
            return 1;
        }
        if(IsAFK[playerid] == 1)
        {
            SendClientMessage(playerid, RED, "You're already AFK!");
            return 1;
        }
    }
    if(strcmp(cmdtext, "/back", true) == 0)
    {
        if(IsAFK[playerid] == 1)
        {
            TogglePlayerControllable(playerid, 1);
            IsAFK[playerid] = 0;
            Delete3DTextLabel(AFKLabel[playerid]);
            return 1;
        }
        if(IsAFK[playerid] == 0)
        {
            SendClientMessage(playerid, RED, "You were here already!");
            return 1;
        }
    }


pawn Code:
C:\Users\Marino (Desktop)\Desktop\new samp\gamemodes\Zombie_Outbreak_Original_Updating.pwn(2432) : warning 213: tag mismatch
C:\Users\Marino (Desktop)\Desktop\new samp\gamemodes\Zombie_Outbreak_Original_Updating.pwn(2435) : warning 213: tag mismatch
C:\Users\Marino (Desktop)\Desktop\new samp\gamemodes\Zombie_Outbreak_Original_Updating.pwn(2450) : warning 213: tag mismatch
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Warnings.



Re: easy afk system - [L3th4l] - 12.02.2011

pawn Code:
new Text3D:AFKLabel[MAX_PLAYERS];



Re: easy afk system - marinov - 12.02.2011

ohh I see, it was like this before :

pawn Code:
new PlayerText3D:AFKLabel[MAX_PLAYERS];

Thanx man