SA-MP Forums Archive
Problem with Textdraws - 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: Problem with Textdraws (/showthread.php?tid=581343)



Problem with Textdraws - SpikY_ - 12.07.2015

Hi,
I don't know how but i created a textdraw and when the server changemode the textdraw gets disappeared..

Код:
    Textdraw2 = TextDrawCreate(500.799896, 431.573394, "Marathon Race");
    TextDrawLetterSize(Textdraw2, 0.449999, 1.600000);
    TextDrawAlignment(Textdraw2, 1);
    TextDrawColor(Textdraw2, -16776961);
    TextDrawSetShadow(Textdraw2, 0);
    TextDrawSetOutline(Textdraw2, 1);
    TextDrawBackgroundColor(Textdraw2, 51);
    TextDrawFont(Textdraw2, 1);
    TextDrawSetProportional(Textdraw2, 1);

    public OnPlayerSpawn(playerid)
    {
        TextDrawShowForPlayer(playerid, Textdraw2);
            return 1;
    }
Have a look on the images attached below.

and you can see the textdraw " Current map " is in a filterscript and the textdraw " Marathon Race " is in the gamemode.


Re : Problem with Textdraws - KillerDVX - 12.07.2015

You've scripted a changing mode for your server ?

As an "NewMap" script ?

If yes, could you please show us your code ?




Re: Problem with Textdraws - SpikY_ - 12.07.2015

no i will not, cause i think its not related to my codes.

anyone else...?


Re: Problem with Textdraws - lanix - 12.07.2015

show code


Re: Problem with Textdraws - SpikY_ - 12.07.2015

omg which codes??!?!


Re: Problem with Textdraws - SpikY_ - 12.07.2015

Anyone?? please

sorry for the bump


Re: Problem with Textdraws - Banana_Ghost - 12.07.2015

create the text draw in any mode you want it in, and destroy it when the mode exits.

For example:

Your TD that points to the mode name is fine as it's in a FS.
PHP код:
public OnGameModeInit(){
//Create textdraw using the mode name
}
public 
OnPlayerSpawn(playerid){
//Show the textdraw for the player.
}
public 
OnGameModeExit(){
//Destroy the textdraw

Repeat the process for the second mode.

You could also create the textdraw in the filterscript, and just change it from the gamemode by using CallRemoteFunction to call a public function you create to change the textdraw's string.


Re: Problem with Textdraws - SpikY_ - 12.07.2015

you know i haven't destroy the textdraws onFilterscriptinit. so basically this cause the problem?


Re: Problem with Textdraws - SpikY_ - 12.07.2015

still the textdraw got disappeared...