SA-MP Forums Archive
Create3Dtext to player(+rep) - 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)
+--- Thread: Create3Dtext to player(+rep) (/showthread.php?tid=505368)



Create3Dtext to player(+rep) - ChristianIvann09 - 08.04.2014

Hi,
Can anyone help me how to fix this? At my Attach3DTextLabelToPlayer. That should be attached when you only go ON duty admin and it should be removed when you go off duty. Then when a players join it randomly attached to them. I dont know why.

Like this: Its so much buggy. I dont know wheres the problem caming from. That 3DLabelText should be only Attached to "ON DUTY ADMIN" and it will be removed when you go OFF DUTY







Please help me

Aduty Code

Код:
CMD:aduty(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, -1, "This is an admin only command!");
	{
			if(PlayerInfo[playerid][pAdminDuty] == 0)
			{

				SendClientMessageEx(playerid, COLOR_YELLOW, "You are now on administrative duty! Remember to check /reports!");
				PlayerInfo[playerid][pAdminDuty] = 1;
				SetPlayerHealth(playerid, 100000);
				SetPlayerArmour(playerid, 100000);
				SetPlayerColor(playerid, COLOR_REALRED);
				//SetPlayerSkin(playerid, 294); - Commented by Voltage
				AdminMode[playerid] = Create3DTextLabel("{FFFF00}Administrator on duty!\n{FF1515}Do not Attack!",0xF600F6FF,30.0,40.0,50.0,40.0,0);
				Attach3DTextLabelToPlayer(AdminMode[playerid],playerid,0.0,0.0,0.5);
				new string[128];
				format(string, sizeof(string), "Administrator %s(ID %d) is now on Admin Duty!", GetPlayerNameEx(playerid), playerid);
				ABroadCast(COLOR_YELLOW, string, 1);
			}
			else
			{
				SendClientMessageEx(playerid, COLOR_RED, "You are now off admin duty!");
				//SetPlayerName(playerid, PlayerInfo[playerid][pNormalName]);
    			Delete3DTextLabel(AdminMode[playerid]);
				SetPlayerHealth(playerid, 100);
				SetPlayerArmour(playerid, 0);
				SetPlayerToTeamColor(playerid);
				//SetPlayerSkin(playerid, 299); - Commented by Voltage
				PlayerInfo[playerid][pAdminDuty] = 0;
				new string[128];
				format(string, sizeof(string), "Administrator %s(ID %d) is now Off Admin Duty! ( Leave the Admin to Roleplay )", GetPlayerNameEx(playerid), playerid);
				ABroadCast(COLOR_YELLOW, string, 1);
			}
	}
	return 1;
}
Thank you very much!!!


Re: Create3Dtext to player(+rep) - iBanner - 08.04.2014

Change all Create3DTextLabel to CreatePlayer3DTextLabel and Delete3DTextLabel to DeletePlayer3DTextLabel


Re: Create3Dtext to player(+rep) - ChristianIvann09 - 08.04.2014

It gives me Warnings

Код:
C:\Users\Cris\Desktop\0.3z Server\Philippines Roleplay (2014)\gamemodes\PHRP_V1.1.pwn(44427) : warning 213: tag mismatch
C:\Users\Cris\Desktop\0.3z Server\Philippines Roleplay (2014)\gamemodes\PHRP_V1.1.pwn(44427) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
The line

Код:
 	DeletePlayer3DTextLabel(AdminMode[playerid]);



Re: Create3Dtext to player(+rep) - ChuckyBabe - 08.04.2014

@ChristianIvann use this

http://forum.sa-mp.com/showthread.ph...77#post2983577

+rep if i help u

EDIT:

That's only a warnings don't worry.. ur script will be compiled even if there is a warnings


Re: Create3Dtext to player(+rep) - ChristianIvann09 - 08.04.2014

Quote:
Originally Posted by ChuckyBabe
Посмотреть сообщение
@ChristianIvann use this

http://forum.sa-mp.com/showthread.ph...77#post2983577

+rep if i help u

EDIT:

That's only a warnings don't worry.. ur script will be compiled even if there is a warnings
But i want my script compiled clean.


Re: Create3Dtext to player(+rep) - Stanford - 08.04.2014

Make sure to take the x,y,z coordinates before you create it.

pawn Код:
AdminMode[playerid] = CreatePlayer3DTextLabel(playerid,"Admin\nON DUTY",0x008080FF,X,Y,Z,40.0);



Re: Create3Dtext to player(+rep) - Stanford - 08.04.2014

I'd recommend using dynamic 3d textlabels, at this situation here:
pawn Код:
AdminMode[playerid] = CreateDynamic3DTextLabel("{FFFF00}Administrator on duty!\n{FF1515}Do not Attack!", 0xF600F6FF, 0, 0, -20, 25, playerid);
Streamer_SetFloatData(STREAMER_TYPE_3D_TEXT_LABEL, AdminMode[playerid] , E_STREAMER_ATTACH_OFFSET_Z, 0.25);



Re: Create3Dtext to player(+rep) - SickAttack - 09.04.2014

Add the following code under OnPlayerDisconnect:
pawn Код:
Delete3DTextLabel(AdminLabel[playerid]);



Re: Create3Dtext to player(+rep) - Hanuman - 09.04.2014

Replace ur line with this
pawn Код:
DeletePlayer3DTextLabel(playerid, AdminMode[playerid]);



Re: Create3Dtext to player(+rep) - Threshold - 09.04.2014

pawn Код:
CMD:aduty(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, -1, "This is an admin only command!");
    if(!PlayerInfo[playerid][pAdminDuty])
    {
        SendClientMessageEx(playerid, COLOR_YELLOW, "You are now on administrative duty! Remember to check /reports!");
        PlayerInfo[playerid][pAdminDuty] = 1;
        SetPlayerHealth(playerid, (Float:0x7F800000));
        SetPlayerArmour(playerid, (Float:0x7F800000));
        SetPlayerColor(playerid, COLOR_REALRED);
        //SetPlayerSkin(playerid, 294); - Commented by Voltage
        AdminMode[playerid] = Create3DTextLabel("Administrator on duty!\n{FF1515}Do not Attack!", 0xFFFF00FF, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(AdminMode[playerid], playerid, 0.0, 0.0, 0.5);
        new string[128];
        format(string, sizeof(string), "Administrator %s(ID %d) is now on Admin Duty!", GetPlayerNameEx(playerid), playerid);
        ABroadCast(COLOR_YELLOW, string, 1);
    }
    else if(PlayerInfo[playerid][pAdminDuty])
    {
        PlayerInfo[playerid][pAdminDuty] = 0;
        SendClientMessageEx(playerid, COLOR_RED, "You are now off admin duty!");
        //SetPlayerName(playerid, PlayerInfo[playerid][pNormalName]);
        SetPlayerHealth(playerid, 100);
        SetPlayerArmour(playerid, 0);
        SetPlayerToTeamColor(playerid);
        //SetPlayerSkin(playerid, 299); - Commented by Voltage
        Delete3DTextLabel(AdminMode[playerid]);
        new string[128];
        format(string, sizeof(string), "Administrator %s(ID %d) is now Off Admin Duty! ( Leave the Admin to Roleplay )", GetPlayerNameEx(playerid), playerid);
        ABroadCast(COLOR_YELLOW, string, 1);
    }
    return 1;
}
Under OnPlayerSpawn:
pawn Код:
//Under OnPlayerSpawn...
    if(PlayerInfo[playerid][pAdminDuty]) Attach3DTextLabelToPlayer(AdminMode[playerid], playerid, 0.0, 0.0, 0.5);
Under OnPlayerDisconnect:
pawn Код:
//Under OnPlayerDisconnect...
    if(PlayerInfo[playerid][pAdminDuty])
    {
        Delete3DTextLabel(AdminMode[playerid]);
        PlayerInfo[playerid][pAdminDuty] = false;
    }
and change
pawn Код:
new AdminMode[MAX_PLAYERS];
to
pawn Код:
new Text3D:AdminMode[MAX_PLAYERS];