Help | Attach3DTextLabelToPlayer
#1

I want to do, when an admin goes on duty it will create an 3dtextlabel which says 'ADMIN DUTY - DO NOT ATTACK' and i can't do it i dont know why it's not working ;/

please help .

PHP код:
אני רוצה שיהיה טקסט צף מעל הראש של האדמין שעולה לדיוטי ואני לא מצליח כל הזמן אני מנסה לא מצליח מנסה לא מצליח 
בבקשה עזרה !!!
PHP Code:
    if(
strcmp(cmd"/adminduty"true) == || strcmp(cmd"/aduty"true) == 0
    { 
        if(
IsPlayerConnected(playerid)) 
        { 
            if(
PlayerInfo[playerid][pAdmin] > 0
            { 
                if(
AdminDuty[playerid] == 0
                { 
                    
AdminDuty[playerid] = 1
                    
SetPlayerSkin(playerid,0); 
                    
SetPlayerArmour(playerid999); 
                    
SetPlayerHealth(playerid999); 
                    
SetPlayerColor(playerid,TEAM_ADMIN_COLOR); 
                    
GetPlayerName(playeridsendernamesizeof(sendername)); 
                    
format(stringsizeof(string), "Admin [ID: %d] %s is now ON duty",playeridsendername); 
                    
SendClientMessageToAll(COLOR_RED,string); 
                    return 
1
                } 
                else if(
AdminDuty[playerid] == 1
                { 
                    
AdminDuty[playerid] = 0
                    
SetPlayerSkin(playerid,PlayerInfo[playerid][pModel]); 
                    
SetPlayerArmour(playerid0); 
                    
SetPlayerHealth(playerid100); 
                    
SetPlayerToTeamColor(playerid); 
                    
GetPlayerName(playeridsendernamesizeof(sendername)); 
                    
format(stringsizeof(string), "Admin [ID: %d] %s is now OFF duty",playeridsendername); 
                    
SendClientMessageToAll(COLOR_WHITE,string); 
                    return 
1
                } 
            } 
            else 
            { 
                
SendClientMessage(playeridCOLOR_GREY"* You're not the admin!"); 
                return 
1
            } 
        } 
        return 
1
    }  
&
#1514;ודה 
Reply
#2

pawn Код:
// At the top of the Script
new Text3D:ADMIN;
// At OnGameModeInit
ADMIN = Create3DTextLabel("Admin ON-DUTY", 0xFFFFFFFF, 999.99, 999.99, 999.99 )

// The Command....
if(strcmp(cmd, "/adminduty", true) == 0 || strcmp(cmd, "/aduty", true) == 0)
{
    new PlayerText3D: textAdmin;
    if(IsPlayerConnected(playerid))
    {
        if(PlayerInfo[playerid][pAdmin] > 0)
        {
            if(AdminDuty[playerid] == 0)
            {
                AdminDuty[playerid] = 1;
                SetPlayerSkin(playerid,0);
                SetPlayerArmour(playerid, 999);
                SetPlayerHealth(playerid, 999);
                SetPlayerColor(playerid,TEAM_ADMIN_COLOR);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                textAdmin = Attach3DTextLabelToPlayer( ADMIN, playerid, 0.0, 0.0, 3.0 );
                format(string, sizeof(string), "Admin [ID: %d] %s is now ON duty",playerid, sendername);
                SendClientMessageToAll(COLOR_RED,string);
                return 1;
            }
            else if(AdminDuty[playerid] == 1)
            {
                AdminDuty[playerid] = 0;
                SetPlayerSkin(playerid,PlayerInfo[playerid][pModel]);
                SetPlayerArmour(playerid, 0);
                SetPlayerHealth(playerid, 100);
                SetPlayerToTeamColor(playerid);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                DeletePlayer3DTextLabel( playerid, textAdmin );
                format(string, sizeof(string), "Admin [ID: %d] %s is now OFF duty",playerid, sendername);
                SendClientMessageToAll(COLOR_WHITE,string);
                return 1;
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "* You're not the admin!");
            return 1;
        }
    }
    return ( 1 );
}
Reply
#3

errors....

PHP код:
C:\Users\User\Desktop\Universal Mode\Multi.pwn(10573) : warning 202number of arguments does not match definition
C
:\Users\User\Desktop\Universal Mode\Multi.pwn(10573) : warning 202number of arguments does not match definition
C
:\Users\User\Desktop\Universal Mode\Multi.pwn(20517) : warning 219local variable "pAdmin" shadows a variable at a preceding level
C
:\Users\User\Desktop\Universal Mode\Multi.pwn(20524) : warning 219local variable "pAdmin" shadows a variable at a preceding level
C
:\Users\User\Desktop\Universal Mode\Multi.pwn(20531) : error 022must be lvalue (non-constant)
C:\Users\User\Desktop\Universal Mode\Multi.pwn(20531) : error 017undefined symbol "ADMIN"
C:\Users\User\Desktop\Universal Mode\Multi.pwn(20524) : warning 203symbol is never used"pAdmin"
C:\Users\User\Desktop\Universal Mode\Multi.pwn(20544) : warning 213tag mismatch
C
:\Users\User\Desktop\Universal Mode\Multi.pwn(20517) : warning 203symbol is never used"pAdmin" 
Reply
#4

Edited the first Post
Reply
#5

another errors...

PHP код:
C:\Users\User\Desktop\Universal Mode\Multi.pwn(10575) : warning 202number of arguments does not match definition
C
:\Users\User\Desktop\Universal Mode\Multi.pwn(10575) : warning 202number of arguments does not match definition
C
:\Users\User\Desktop\Universal Mode\Multi.pwn(20519) : warning 219local variable "pAdmin" shadows a variable at a preceding level
C
:\Users\User\Desktop\Universal Mode\Multi.pwn(20533) : warning 213tag mismatch
C
:\Users\User\Desktop\Universal Mode\Multi.pwn(20533) : warning 204symbol is assigned a value that is never used"tAdmin"
C:\Users\User\Desktop\Universal Mode\Multi.pwn(20546) : error 017undefined symbol "tAdmin"
C:\Users\User\Desktop\Universal Mode\Multi.pwn(20519) : warning 203symbol is never used"pAdmin" 
Reply
#6

Edited again, and PUT ALL THE STUFF in your Script, Add the new Text3D: Admin;...
Reply
#7

PHP код:
C:\Users\User\Desktop\Universal Mode\Multi.pwn(10575) : warning 202number of arguments does not match definition
C
:\Users\User\Desktop\Universal Mode\Multi.pwn(10575) : warning 202number of arguments does not match definition
C
:\Users\User\Desktop\Universal Mode\Multi.pwn(20526) : warning 219local variable "tAdmin" shadows a variable at a preceding level
C
:\Users\User\Desktop\Universal Mode\Multi.pwn(20533) : warning 213tag mismatch
C
:\Users\User\Desktop\Universal Mode\Multi.pwn(20533) : warning 204symbol is assigned a value that is never used"tAdmin" 
;/
Reply
#8

Try now with the First Post !
Reply
#9

i would like to no how this could work with ladmin ?
Reply
#10

anyone make this to work with ladmin ? ive tried but i get errors
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)