29.12.2014, 10:22
Hi Guys
I Have Problem in My 3Dtext Label WHen i /offduty the 3DTextLabel Don't Remove
Hope Help me
I Have Problem in My 3Dtext Label WHen i /offduty the 3DTextLabel Don't Remove
pawn Код:
new Text3D:MyLabel;
pawn Код:
YCMD:duty(playerid, params[], help)
{
#pragma unused help
#pragma unused params
if(P_Data[playerid][pAdmin] == 2) return SCM(playerid, COLOR_RED, "Info: You Must be lvl 2");
new
string[128];
if(P_Data[playerid][pDuty] == 3) {
SetPlayerHealth(playerid,100);
SetPlayerColor(playerid, -1);
format(string,sizeof(string)," {FF0000} %s is not longer onduty!",GetName(playerid));
new Float:x,Float:y,Float:z;
MyLabel = Create3DTextLabel("Admin On Duty!", 0x22B998AA,x,y,z, 40.0, 0, 0);
Delete3DTextLabel(MyLabel);
RemovePlayerAttachedObject(playerid, object);
SCMToAll(-1,string); P_Data[playerid][pDuty] = 2;} // this line is your problem just change the "P_Data[playerid][pDuty]=2" << to your off duty number
else {
new Float:x,Float:y,Float:z;
MyLabel = Create3DTextLabel("Admin On Duty!", 0x22B998AA,x,y,z, 40.0, 0, 0);
GetPlayerPos(playerid,x,y,z);
SendClientMessage(playerid, -1,"You are now on duty!");
Attach3DTextLabelToPlayer(MyLabel,playerid,0.0, 0.0, 0.1);
SetPlayerAttachedObject(playerid, 0, 18646, 2, 0.207000, 0.004000, 0.007000, 64.800010, 86.200035, 0.000000, 1.000000, 1.000000, 1.000000);
format(string,sizeof(string)," {FF0000} %s is now on Duty!",GetName(playerid));
SetPlayerHealth(playerid,99999);
SetPlayerColor(playerid,0x000000FF);
SCMToAll(-1,string); P_Data[playerid][pDuty] = 3;}
return 1;
}