Warnings over here!
#1

pawn Код:
dcmd_adon(playerid,params[])
{
    #pragma unused params
    if(InAdminMode[playerid] == 1)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You are already in admin mode.");
        return 1;
    }
    if(IsSpawned[playerid] != 1)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You must be alive and spawned in order to go into admin mode.");
        return 1;
    }
    for(new w=0; w<13; w++)
    {
        GetPlayerWeaponData(playerid,w,PlayerWeapon[playerid][w],PlayerAmmo[playerid][w]);
    }
    InAdminMode[playerid] = Create3DTextLabel("Administrator on duty!\n*Do not Disturb*",0xF600F6FF,30.0,40.0,50.0,40.0,0); // Line 6283
    Attach3DTextLabelToPlayer(InAdminMode[playerid],playerid,0.0,0.0,0.5); // Line 6284

    SendClientMessage(playerid,COLOR_ADMIN,"You are now in admin mode. You have unlimited minigun, health and armour.");
    ResetPlayerWeapons(playerid);
    InAdminMode[playerid] =1;

    GivePlayerWeapon(playerid,38,999999);
    SetPlayerHealth(playerid,999999);
    SetPlayerArmour(playerid,999999);
    return 1;
}
Warnings:
pawn Код:
C:\Users\Bing\Desktop\Started\gamemodes\robbing.pwn(6283) : warning 213: tag mismatch
C:\Users\Bing\Desktop\Started\gamemodes\robbing.pwn(6284) : warning 213: tag mismatch
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase
Hope someone would help me,
Thanks.
Reply
#2

pawn Код:
new InAdminMode:label = Create3DTextLabel("Administrator on duty!\n*Do not Disturb*",0xF600F6FF,30.0, 40.0, 50.0, 40.0, 0, 0);
    Attach3DTextLabelToPlayer(InAdminMode, playerid, 0.0, 0.0, 0.7);
Reply
#3

Change to:
pawn Код:
new Text3D: IAM = Create3DTextLabel("Administrator on duty!\n*Do not Disturb*",0xF600F6FF,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToPlayer(IAM,playerid,0.0,0.0,0.5);
Reply
#4

It worked, Also, Is it possible to Destroy this Label when the player turns off the admin mode?
Reply
#5

Yes,
pawn Код:
if(InAdminMode[playerid] == 0)
{
      DeletePlayer3DTextLabel(playerid, IAM);
}
or use it in turn off admin mode cmd with the if statement
Reply
#6

It is and you should declare it as a global array then.

pawn Код:
// global (under #define):
new Text3D: IAM[MAX_PLAYERS] = {INVALID_3DTEXT_ID, ...};
in OnPlayerConnect:
pawn Код:
IAM[playerid] = INVALID_3DTEXT_ID;
To where it creates the 3d label:
pawn Код:
IAM[playerid] = Create3DTextLabel("Administrator on duty!\n*Do not Disturb*",0xF600F6FF,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToPlayer(IAM[playerid],playerid,0.0,0.0,0.5);
To where it destroys it:
pawn Код:
Delete3DTextLabel(IAM[playerid]);
Reply
#7

@Konstantinos, I did them as you said.
Got 2 warnings from these things again..
pawn Код:
C:\Users\Bing\Desktop\Started\gamemodes\robbing.pwn(289) : warning 213: tag mismatch
C:\Users\Bing\Desktop\Started\gamemodes\robbing.pwn(2497) : warning 213: tag mismatch
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase
pawn Код:
Line 2497 :  IAM[playerid] = INVALID_3DTEXT_ID;
Line 289 :  new Text3D: IAM[MAX_PLAYERS] = {INVALID_3DTEXT_ID, ...};
Quote:

Damn..

Reply
#8

Replace them with these (using its tag):
pawn Код:
new Text3D: IAM[MAX_PLAYERS] = {Text3D: INVALID_3DTEXT_ID, ...};
pawn Код:
IAM[playerid] = Text3D: INVALID_3DTEXT_ID;
Reply
#9

You've solved it, Thank you.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)