SA-MP Forums Archive
3DTextLabels - 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: 3DTextLabels (/showthread.php?tid=240728)



3DTextLabels - Snipa - 16.03.2011

pawn Код:
new Text3D:aduty[MAX_PLAYERS];
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
DeletePlayer3DTextLabel(playerid,aduty[playerid]); // line 2480
return 1;
}

pawn Код:
public OnPlayerSpawn(playerid)
{
if(PInfo[playerid][Duty] == 1)
    {
        Attach3DTextLabelToPlayer(aduty[playerid], playerid, 0.0, 0.0, 0.7);
        SetPlayerSkin(playerid, 217);
        SetPlayerHealth(playerid, 10000);
        GivePlayerWeapon(playerid, 38, 100000);
    }
    return 1;
}
For the adminduty cmd:

pawn Код:
command(adminduty,playerid,params[])
{
    if(PInfo[playerid][Level] >=1 || IsPlayerAdmin(playerid))
    {
        new name[MAX_PLAYER_NAME], string[128];
        GetPlayerName(playerid,name,25);
        ACMDM(playerid,"ADMINDUTY");
        if(PInfo[playerid][Duty] == 0)
        {
            SetPlayerSkin(playerid,217);
            GivePlayerWeapon(playerid,38,999999);
            SetPlayerTeam(playerid, 0);
            PInfo[playerid][Duty] = 1;
            Adminduty = SetTimerEx("AdminDuty",500,true,"d",playerid);
            format(string,sizeof(string),"Administrator %s is now on Admin Duty",name);
            SendClientMessageToAll(RED,string);
            aduty[playerid] = Create3DTextLabel("On-Duty admin, DO NOT ATTACK",RED,0.0,40.0,0.0,0.0,0);
            Attach3DTextLabelToPlayer(aduty[playerid],playerid,0,5,0);
        }
        else
        {
            GivePlayerMoney(playerid,500);
            ResetPlayerWeapons(playerid);
            SetPlayerHealth(playerid,0);
            PInfo[playerid][Duty] = 0;
            format(string,sizeof(string),"Administrator %s is now off Admin Duty",name);
            SendClientMessageToAll(RED,string);
            DeletePlayer3DTextLabel(playerid,aduty[playerid]); //line 2798
            KillTimer(Adminduty);
        }
    }
    else return SendClientMessage(playerid,RED,"You are not a high enough level to use this command");
       
    return 1;
}
Compiling warnings:
Код:
C:\Users\Chris\Documents\Serv\Server\gamemodes\COS.pwn(2480) : warning 213: tag mismatch
C:\Users\Chris\Documents\Serv\Server\gamemodes\COS.pwn(2798) : warning 213: tag mismatch
I looked @ wiki for params, etc, but it still says tag mismatch..


Re: 3DTextLabels - Stigg - 16.03.2011

Nevermind. Read it wrong.


Re: 3DTextLabels - Gertin - 16.03.2011

In line 2798 try use
pawn Код:
Delete3DTextLabel( aduty[ playerid ] );
And in other line too .


Re: 3DTextLabels - Snipa - 16.03.2011

Quote:
Originally Posted by Gertin
Посмотреть сообщение
In line 2798 try use
pawn Код:
Delete3DTextLabel( aduty[ playerid ] );
And in other line too .
Thanks, worked.


Re: 3DTextLabels - Gertin - 16.03.2011

Kk, np