Delete3DTextLabel help (+rep)
#2

Quote:
Originally Posted by Matical
Посмотреть сообщение
Hello, I am trying to make it so when a player becomes wounded, it says (( THIS PLAYER IS BRUTALLY WOUNDED )) so i created and attached that, and i want the player to then /acceptdeath and when they happens it updates that text label so it says (( THIS PLAYER IS DEAD )), i havent used the function Update3DTextLabelText so i just used Delete3DTextLabel and Create3DTextLabel.

Код:
C:\Users\Nick\Documents\SAMP S\INGENIOUS ROLEPLAY\gamemodes\igrp.pwn(13657) : warning 213: tag mismatch
C:\Users\Nick\Documents\SAMP S\INGENIOUS ROLEPLAY\gamemodes\igrp.pwn(13658) : warning 213: tag mismatch
C:\Users\Nick\Documents\SAMP S\INGENIOUS ROLEPLAY\gamemodes\igrp.pwn(17016) : warning 217: loose indentation
C:\Users\Nick\Documents\SAMP S\INGENIOUS ROLEPLAY\gamemodes\igrp.pwn(24927) : error 017: undefined symbol "labelid"
C:\Users\Nick\Documents\SAMP S\INGENIOUS ROLEPLAY\gamemodes\igrp.pwn(31346) : warning 217: loose indentation
C:\Users\Nick\Documents\SAMP S\INGENIOUS ROLEPLAY\gamemodes\igrp.pwn(31362) : warning 217: loose indentation
C:\Users\Nick\Documents\SAMP S\INGENIOUS ROLEPLAY\gamemodes\igrp.pwn(33886) : error 017: undefined symbol "labelid"
Код:
CMD:acceptdeath(playerid, params[])
{
	if(GetIntVar(playerid, "JustDied") == 1 || PlayerInfo[playerid][pDied] == 1)
	{
 		new Text3D:label = Create3DTextLabel("(( THIS PLAYER IS DEAD ))", 0xFFFF0000, 30.0, 40.0, 50.0, 40.0, 0);
    	Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
    	DeletePlayer3DTextLabel(playerid, labelid);
    	SCM(playerid, COLOR_LIGHTRED, "HINT: You can /respawnme to respawn.");
		StopPlayerAnims(playerid);
		SetIntVar(playerid, "JustAcceptedDeath", 1);
		RemoveVar(playerid, "JustDied");
		RemoveVar(playerid, "LoggedInDead");
		PlayerInfo[playerid][pDied] = 0;
		FreezePlayer(playerid);
	}
	else
	{
		SCM(playerid, -1, "You are not wounded.");
	}
	return 1;
}
Код:
CMD:respawnme(playerid, params[])
{
	if(GetIntVar(playerid, "JustAcceptedDeath") == 1)
	{
    	DeletePlayer3DTextLabel(playerid, label);
	    SetIntVar(playerid, "JustRespawnedMe", 1);
		HospitalWait{playerid} = 60;
		PutPlayer(playerid,1191.6139,-1323.5557,10.3984);
		SetPlayerCameraPos(playerid, 1222.4498, -1345.3663, 17.4686);
		SetPlayerCameraLookAt(playerid, 1221.5580, -1344.9164, 17.4135);
		SCM(playerid, COLOR_LIGHTRED, "[Hospital] Your medical bill is $1,000.");
		SCM(playerid, COLOR_LIGHTRED, "Please wait 1 minute before you walk out from the hospital.");
		GiveCash(playerid, -1000);
	}
	else
	{
	    SCM(playerid, -1, "You are not dead.");
	}
	return 1;
}
Код:
CMD:revive(playerid, params[])
{
	new id;
	if(!CheckAdmin(playerid, ADMIN_LEVEL_1)) return NotAuthMSG(playerid);
	if(sscanf(params,"d",id)) return SyntaxMSG(playerid, "/revive [playerid] (Only if he's wounded)");
	if(!PlayerIsOn(id)) return NotConnectedMSG(playerid);
	if(GetIntVar(id, "JustDied") == 1 || PlayerInfo[id][pDied] == 1 || GetIntVar(id, "LoggedInDead") == 1)
	{
		SetPlayerHealth(id, 100.0);
		PlayerInfo[id][pDied] = 0;
		RemoveVar(id, "JustDied");
		RemoveVar(id, "LoggedInDead");
		RemoveVar(id, "JustAcceptedDeath");
		DeletePlayer3DTextLabel(playerid, labelid);
		StopPlayerAnims(id);
		UnFreezePlayer(id);
		SCM(playerid, -1, "Player was healed.");
		SavePlayerPos(id);
		StopPlayerSpec(id);
		PutPlayer(id, PlayerInfo[id][pPosX],PlayerInfo[id][pPosY],PlayerInfo[id][pPosZ]);
	}
	else
	{
		SCM(playerid, -1, "This player isn't wounded");
	}
	return 1;
}
Код:
public CheckWounded(playerid)
{
	if(GetIntVar(playerid, "JustDied") == 1)
	{
 		new PlayerText3D:labelid = Create3DTextLabel("(( THIS PLAYER IS BRUTALLY WOUNDED ))", COLOR_PINK, 30.0, 40.0, 50.0, 40.0, 0);
    	Attach3DTextLabelToPlayer(labelid, playerid, 0.0, 0.0, 0.7);
    	SetCameraBehindPlayer(playerid);
		PutPlayer(playerid,PlayerInfo[playerid][pPosX],PlayerInfo[playerid][pPosY],PlayerInfo[playerid][pPosZ]);
		SetInterior(playerid, PlayerInfo[playerid][pInt]);
		SetWorld(playerid, PlayerInfo[playerid][pWorld]);
		SetPlayerCameraPos(playerid,PlayerInfo[playerid][pPosX],PlayerInfo[playerid][pPosY],PlayerInfo[playerid][pPosZ]);
		SetPlayerHealth(playerid, 15.0);
		GameTextForPlayer(playerid, "~b~Brutally Wounded", 5000, 3);
		GiveCash(playerid, -500);
		SCM(playerid, COLOR_PINK, "EMT: Your Medical Bills are $500");
		SCM(playerid, COLOR_LIGHTRED, "You are Brutally Wounded. If a medic or anyone else doesn't save you, you will die.");
		SCM(playerid, COLOR_LIGHTRED, "To accept death type /acceptdeath");
		FreezePlayer(playerid);
		OnAnim{playerid} = true;
		ApplyAnimation(playerid,"PARACHUTE","FALL_skyDive_DIE",3.5,0,0,0,1,0);
	}
}
Why create new text Labe, when the short message is SetPlayerChatBubble()?
PHP код:
#define MAX_CHATBUBBLE_LENGTH 144
SetPlayerChatBubble(playerid"(( THIS PLAYER IS BRUTALLY WOUNDED ))" , -160.010000); 
Note: Which displays the text on the player's head.
Reply


Messages In This Thread
Delete3DTextLabel help (+rep) - by Matical - 29.08.2015, 22:41
Re: Delete3DTextLabel help (+rep) - by Logofero - 30.08.2015, 00:28
Re: Delete3DTextLabel help (+rep) - by Matical - 30.08.2015, 01:36
Re: Delete3DTextLabel help (+rep) - by Logofero - 30.08.2015, 03:49
Re: Delete3DTextLabel help (+rep) - by Matical - 31.08.2015, 17:47
Re: Delete3DTextLabel help (+rep) - by Logofero - 31.08.2015, 17:53
Re: Delete3DTextLabel help (+rep) - by Logofero - 31.08.2015, 18:17

Forum Jump:


Users browsing this thread: 2 Guest(s)