3DTextLabels
#1

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..
Reply
#2

Nevermind. Read it wrong.
Reply
#3

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

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

Kk, np
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)