[+1MILLION REP IF HELP] Destroy TextDraw!!
#1

Код:
        if(GetPlayerWantedLevel(killerid) >= 5)
        {
        wantedlabel = Create3DTextLabel("--Most Wanted--", GREEN, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(wantedlabel, killerid, 0.0, 0.0,-0.5);
		}
Cant be destroyed with:
Код:
        if(GetPlayerWantedLevel(playerid) >= 5)
        {
        DeletePlayer3DTextLabel(playerid, PlayerText3D:wantedlabel);
		}
Help please!

FULL CODE:
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	//racesystem
	if(Joined[playerid] == true)
    {
		JoinCount--;
		Joined[playerid] = false;
		DestroyVehicle(CreatedRaceVeh[playerid]);
		DisablePlayerRaceCheckpoint(playerid);
		CPProgess[playerid] = 0;
		KillTimer(InfoTimer[playerid]);
		SetPlayerVirtualWorld(playerid, 0);
		SetVehicleToRespawn(GetPlayerVehicleID(playerid));
		SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),0);
	}
	if(BuildRace == playerid+1) BuildRace = 0;

	//Killingspree
    new str[ 256 ], KillerName[MAX_PLAYER_NAME];
    GetPlayerName(killerid, KillerName, sizeof(KillerName));
    //End KS
    GodMode[playerid] = 0;
    SendDeathMessage(killerid, playerid, reason);
    if(killerid != INVALID_PLAYER_ID)
    {
        SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
        SetPlayerWantedLevel(killerid, (GetPlayerWantedLevel(killerid) + 1));
        
        /*if(GetPlayerWantedLevel(killerid)>=5)
        {
        GetPlayerPos( playerid, X, Y, Z );
        CreatePlayer3DTextLabel(playerid,"Most Wanted",0x008080FF,X,Y,Z,40.0);
	    }*/
        if(GetPlayerWantedLevel(killerid) >= 5)
        {
        wantedlabel = Create3DTextLabel("--Most Wanted--", GREEN, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(wantedlabel, killerid, 0.0, 0.0,-0.5);
		}
        DeletePlayer3DTextLabel(playerid, PlayerText3D:wantedlabel);
        GameTextForPlayer(killerid,"~w~+1 Score~R~~N~+1 kill~N~ ~g~+1000$", 3000, 1);
        GivePlayerMoney(killerid, 1000);
        Streaks[killerid]++;
        TotalKills[killerid]++;
    if(Streaks[killerid] == 3) {
            format(str, sizeof(str), "%s {00FFEE}is on Triple Kill  {FFAF00}(3 kills +3 Score!)", KillerName); //here, you're formatting the defined string and add the content (text)
            SendClientMessageToAll(0xADFF2FAA, str);
            SetPlayerScore(killerid, GetPlayerScore(killerid) + 2);
    }
    if(Streaks[killerid] == 5) {
            format(str, sizeof(str), "%s {F81414}is on Killing Spree {FFAF00}(5 Kills +5 Score!!)", KillerName); //got no creativity lmao lol//here, you're formatting the defined string and add the content (text)
            SendClientMessageToAll(0xADFF2FAA, str);
            SetPlayerScore(killerid, GetPlayerScore(killerid) + 4);
    }
    if(Streaks[killerid] == 10) {
            format(str, sizeof(str), "%s {B8FF02}is on UNSTOPPABLE {FFAF00}(10 Kills +10 Score!!!)", KillerName); //got no creativity lmao lol//here, you're formatting the defined string and add the content (text)
            SendClientMessageToAll(0xADFF2FAA, str);

    }
    }
    SetPlayerWantedLevel(playerid, 0);
    GivePlayerMoney(playerid, -1000);
    //GameTextForPlayer(playerid,"~R~W~B~A~G~S~W~T~P~E~G~D~N~~N~~N~~N~~N~~R~Rest ~W~In ~g~PEACE", 3000, 5);
    format(string, sizeof(string),"~G~You got Killed By~N~~w~ %s", KillerName);
    GameTextForPlayer(playerid, string, 3000, 3);
    return 1;
}
Reply
#2

U can't 1 million rep.

Reply
#3

What kind of problem do you have ?

About Textdraws or 3DTexts ?


Use simply Destroy3DTextLabel for your problem.

@Anou : troll malgrй toi mdrr
Reply
#4

EDITED
Reply
#5

Do like that

PHP код:

new Text3D:wantedlabel[MAX_PLAYERS];
// In some code
wantedlabel[playerid] = Create3DTextLabel(params);
Attach3DTextLabelToPlayer(params);
// In other code
Destroy3DTextLabel(wantedlabel[playerid]); 
Also, if you use Incognito's streamer, create the labels with CreateDynamic3DTextLabel.


Others : Please don't focus only on "+1 MILLION REP". It's his way to tell us that he needs help, and very quickly.
Reply
#6

C:\Users\MaHdy\Desktop\SPA Orginal Build 2\pawno\include\sscanf.inc(1) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\MaHdy\Desktop\SPA Orginal Build 2\gamemodes\SPA.pwn(5763) : error 035: argument type mismatch (argument 1)
C:\Users\MaHdy\Desktop\SPA Orginal Build 2\gamemodes\SPA.pwn(5766) : error 017: undefined symbol "Destroy3DTextLabel"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#7

It would be Delete3DTextLabel, sorry.

I'm used to objects, and because the objects are destroyed, I do the mistake to think 3DText are too.
Reply
#8

Yeah now i got 1 error:
C:\Users\MaHdy\Desktop\SPA Orginal Build 2\gamemodes\SPA.pwn(5763) : error 035: argument type mismatch (argument 1)


LINE: Attach3DTextLabelToPlayer(wantedlabel, killerid, 0.0, 0.0,-0.5);
Reply
#9

wut you need.
3d text.
ok?Here:
Click Me
if i help
you Rep me
Reply
#10

Sorry, I wasn't enough clear.

When you use wantedlabel, replace with wantedlabel[playerid].

Here, it will be


PHP код:

Attach3DTextLabelToPlayer
(wantedlabel[killerid], killerid,0.00.0,-0.5);

// instead of

Attach3DTextLabelToPlayer(wantedlabelkillerid0.00.0, -0.5); 
If you have more questions about, ask'em and I'll be glad to answer them.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)