TextDraws Problem
#1

Hi everybody,

I'm doing textdraws, for information for each team.

When the player connects he is on the Triad team.
The information is displayed correctly, but the problem is when I go to another team normally the textdraw should disappear, but it does not disappear.

Here is the script

PHP код:
new PlayerText:Textdraw2[MAX_PLAYERS][14];
public 
OnPlayerRequestClass(playeridclassid)
{
    switch(
classid)
    {
        case 
0..2//1 2 et 3
        
{
            
Team[playerid] = TEAM_TRIAD;
            
SetPlayerPos(playerid,2028.0615,1007.9283,10.8203);
            
SetPlayerCameraPos(playerid,2044.2784,1007.7114,10.6719);
            
SetPlayerCameraLookAt(playerid,2028.0615,1007.9283,10.8203);
            
SetPlayerFacingAngle(playerid,270);
            
SetPlayerColor(playerid,0xFFFF00FF);
            
GameTextForPlayer(playerid,"~w~Team ~y~Triads",2000,4);
            
TextDrawTriad(playerid);
        }
        case 
3..5:
        {
            
Team[playerid] = TEAM_SINDACCO;
            
SetPlayerPos(playerid,2188.7944,1677.0432,11.1162);
            
SetPlayerCameraPos(playerid,2173.4385,1676.8881,10.8203);
            
SetPlayerCameraLookAt(playerid,2188.7944,1677.0432,11.1162);
            
SetPlayerFacingAngle(playerid,100);
            
SetPlayerColor(playerid,0x808040FF);
            
GameTextForPlayer(playerid,"~w~Team ~g~Sindacco",2000,4);
            
DeleteTextdraw(playerid);
        }
        case 
6..8:
        {
            
Team[playerid] = TEAM_POLICE;
            
SetPlayerPos(playerid,2289.7913,2422.8516,10.8203);
            
SetPlayerCameraPos(playerid,2289.6187,2412.5552,10.8443);
            
SetPlayerCameraLookAt(playerid,2289.7913,2422.8516,10.8203);
            
SetPlayerFacingAngle(playerid,100);
            
SetPlayerColor(playerid,0x0000FFFF);
            
GameTextForPlayer(playerid,"~w~Team ~b~Cops",2000,4);
        }
    }
    return 
1;
}
stock TextDrawTriad(playerid)
{
    
Textdraw2[playerid][4] = CreatePlayerTextDraw(playerid472.333221288.137084"usebox");
    
PlayerTextDrawLetterSize(playeridTextdraw2[playerid][4], 0.00000011.712965);
    
PlayerTextDrawTextSize(playeridTextdraw2[playerid][4], 181.3333740.000000);
    
PlayerTextDrawAlignment(playeridTextdraw2[playerid][4], 1);
    
PlayerTextDrawColor(playeridTextdraw2[playerid][4], 0);
    
PlayerTextDrawUseBox(playeridTextdraw2[playerid][4], true);
    
PlayerTextDrawBoxColor(playeridTextdraw2[playerid][4], 102);
    
PlayerTextDrawSetShadow(playeridTextdraw2[playerid][4], 0);
    
PlayerTextDrawSetOutline(playeridTextdraw2[playerid][4], 0);
    
PlayerTextDrawFont(playeridTextdraw2[playerid][4], 0);
    
PlayerTextDrawShow(playerid,Textdraw2[playerid][4]);
    
Textdraw2[playerid][5] = CreatePlayerTextDraw(playerid183.666488288.296142"~p~Team: ~y~Triads");
    
PlayerTextDrawLetterSize(playeridTextdraw2[playerid][5], 0.4499991.600000);
    
PlayerTextDrawAlignment(playeridTextdraw2[playerid][5], 1);
    
PlayerTextDrawColor(playeridTextdraw2[playerid][5], -1);
    
PlayerTextDrawSetShadow(playeridTextdraw2[playerid][5], 0);
    
PlayerTextDrawSetOutline(playeridTextdraw2[playerid][5], 1);
    
PlayerTextDrawBackgroundColor(playeridTextdraw2[playerid][5], 51);
    
PlayerTextDrawFont(playeridTextdraw2[playerid][5], 1);
    
PlayerTextDrawSetProportional(playeridTextdraw2[playerid][5], 1);
    
PlayerTextDrawShow(playerid,Textdraw2[playerid][5]);
    
Textdraw2[playerid][6] = CreatePlayerTextDraw(playerid184.000045309.866699"~p~Location: ~y~Four dragons casino");
    
PlayerTextDrawLetterSize(playeridTextdraw2[playerid][6], 0.3149991.608296);
    
PlayerTextDrawAlignment(playeridTextdraw2[playerid][6], 1);
    
PlayerTextDrawColor(playeridTextdraw2[playerid][6], -1);
    
PlayerTextDrawSetShadow(playeridTextdraw2[playerid][6], 0);
    
PlayerTextDrawSetOutline(playeridTextdraw2[playerid][6], 1);
    
PlayerTextDrawBackgroundColor(playeridTextdraw2[playerid][6], 51);
    
PlayerTextDrawFont(playeridTextdraw2[playerid][6], 1);
    
PlayerTextDrawSetProportional(playeridTextdraw2[playerid][6], 1);
    
PlayerTextDrawShow(playerid,Textdraw2[playerid][6]);
    
Textdraw2[playerid][7] = CreatePlayerTextDraw(playerid183.333343333.925964"~p~Missions: (And /jobhelp)");
    
PlayerTextDrawLetterSize(playeridTextdraw2[playerid][7], 0.3149991.608296);
    
PlayerTextDrawAlignment(playeridTextdraw2[playerid][7], 1);
    
PlayerTextDrawColor(playeridTextdraw2[playerid][7], -1);
    
PlayerTextDrawSetShadow(playeridTextdraw2[playerid][7], 0);
    
PlayerTextDrawSetOutline(playeridTextdraw2[playerid][7], 1);
    
PlayerTextDrawBackgroundColor(playeridTextdraw2[playerid][7], 51);
    
PlayerTextDrawFont(playeridTextdraw2[playerid][7], 1);
    
PlayerTextDrawSetProportional(playeridTextdraw2[playerid][7], 1);
    
PlayerTextDrawShow(playerid,Textdraw2[playerid][7]);
    
Textdraw2[playerid][8] = CreatePlayerTextDraw(playerid182.333297298.251831"~r~-------------------------------------------");
    
PlayerTextDrawLetterSize(playeridTextdraw2[playerid][8], 0.4499991.600000);
    
PlayerTextDrawAlignment(playeridTextdraw2[playerid][8], 1);
    
PlayerTextDrawColor(playeridTextdraw2[playerid][8], -1);
    
PlayerTextDrawSetShadow(playeridTextdraw2[playerid][8], 0);
    
PlayerTextDrawSetOutline(playeridTextdraw2[playerid][8], 1);
    
PlayerTextDrawBackgroundColor(playeridTextdraw2[playerid][8], 51);
    
PlayerTextDrawFont(playeridTextdraw2[playerid][8], 1);
    
PlayerTextDrawSetProportional(playeridTextdraw2[playerid][8], 1);
    
PlayerTextDrawShow(playerid,Textdraw2[playerid][8]);
    
Textdraw2[playerid][9] = CreatePlayerTextDraw(playerid182.000061323.140808"~r~-------------------------------------------");
    
PlayerTextDrawLetterSize(playeridTextdraw2[playerid][9], 0.4499991.600000);
    
PlayerTextDrawAlignment(playeridTextdraw2[playerid][9], 1);
    
PlayerTextDrawColor(playeridTextdraw2[playerid][9], -1);
    
PlayerTextDrawSetShadow(playeridTextdraw2[playerid][9], 0);
    
PlayerTextDrawSetOutline(playeridTextdraw2[playerid][9], 1);
    
PlayerTextDrawBackgroundColor(playeridTextdraw2[playerid][9], 51);
    
PlayerTextDrawFont(playeridTextdraw2[playerid][9], 1);
    
PlayerTextDrawSetProportional(playeridTextdraw2[playerid][9], 1);
    
PlayerTextDrawShow(playerid,Textdraw2[playerid][9]);
    
Textdraw2[playerid][10] = CreatePlayerTextDraw(playerid181.999969349.688812"~y~-Kill the others players.");
    
PlayerTextDrawLetterSize(playeridTextdraw2[playerid][10], 0.3623331.521185);
    
PlayerTextDrawAlignment(playeridTextdraw2[playerid][10], 1);
    
PlayerTextDrawColor(playeridTextdraw2[playerid][10], -1);
    
PlayerTextDrawSetShadow(playeridTextdraw2[playerid][10], 0);
    
PlayerTextDrawSetOutline(playeridTextdraw2[playerid][10], 1);
    
PlayerTextDrawBackgroundColor(playeridTextdraw2[playerid][10], 51);
    
PlayerTextDrawFont(playeridTextdraw2[playerid][10], 1);
    
PlayerTextDrawSetProportional(playeridTextdraw2[playerid][10], 1);
    
PlayerTextDrawShow(playerid,Textdraw2[playerid][10]);
    
Textdraw2[playerid][11] = CreatePlayerTextDraw(playerid182.999954363.377746"~y~-Capture the truck of the Sindacco team to the caligula casino.");
    
PlayerTextDrawLetterSize(playeridTextdraw2[playerid][11], 0.2583331.558518);
    
PlayerTextDrawAlignment(playeridTextdraw2[playerid][11], 1);
    
PlayerTextDrawColor(playeridTextdraw2[playerid][11], -1);
    
PlayerTextDrawSetShadow(playeridTextdraw2[playerid][11], 0);
    
PlayerTextDrawSetOutline(playeridTextdraw2[playerid][11], 1);
    
PlayerTextDrawBackgroundColor(playeridTextdraw2[playerid][11], 51);
    
PlayerTextDrawFont(playeridTextdraw2[playerid][11], 1);
    
PlayerTextDrawSetProportional(playeridTextdraw2[playerid][11], 1);
    
PlayerTextDrawShow(playerid,Textdraw2[playerid][11]);
    
Textdraw2[playerid][12] = CreatePlayerTextDraw(playerid182.666671375.407318"~y~-Save the players of his team to the police headquarters.");
    
PlayerTextDrawLetterSize(playeridTextdraw2[playerid][12], 0.2823331.620740);
    
PlayerTextDrawAlignment(playeridTextdraw2[playerid][12], 1);
    
PlayerTextDrawColor(playeridTextdraw2[playerid][12], -1);
    
PlayerTextDrawSetShadow(playeridTextdraw2[playerid][12], 0);
    
PlayerTextDrawSetOutline(playeridTextdraw2[playerid][12], 1);
    
PlayerTextDrawBackgroundColor(playeridTextdraw2[playerid][12], 51);
    
PlayerTextDrawFont(playeridTextdraw2[playerid][12], 1);
    
PlayerTextDrawSetProportional(playeridTextdraw2[playerid][12], 1);
    
PlayerTextDrawShow(playerid,Textdraw2[playerid][12]);
    return 
1;
}
stock DeleteTextdraw(playerid)
{
    
PlayerTextDrawDestroy(playerid,Textdraw2[playerid][4]);
    
PlayerTextDrawDestroy(playerid,Textdraw2[playerid][5]);
    
PlayerTextDrawDestroy(playerid,Textdraw2[playerid][6]);
    
PlayerTextDrawDestroy(playerid,Textdraw2[playerid][7]);
    
PlayerTextDrawDestroy(playerid,Textdraw2[playerid][8]);
    
PlayerTextDrawDestroy(playerid,Textdraw2[playerid][9]);
    
PlayerTextDrawDestroy(playerid,Textdraw2[playerid][10]);
    
PlayerTextDrawDestroy(playerid,Textdraw2[playerid][11]);
    
PlayerTextDrawDestroy(playerid,Textdraw2[playerid][12]);
    return 
1;

Here is a screen:
http://hpics.li/a2b0085
http://hpics.li/3927524

In the second screen you can see that the textdraw are not break.
I've been trying to fix it for two hours.
I would like continue to script my server. ^^
Thanks
Reply
#2

Have you confirmed the function is actually getting called? Also add break; at the end of each case.
Reply
#3

Quote:
Originally Posted by TakeiT
Посмотреть сообщение
Also add break; at the end of each case.
No need for that..
Reply
#4

Yes, I confirm that the stock function DeleteTextdraw (playerid) is called because I did a test:
print ( ".");
The line is inserted into the console.
Do not you see any error in the code?

I tried to make a break; but I can't because it returns errors.
Reply
#5

Up..

I have try with 1 textdraw, he don't are deleted:

PHP код:
new PlayerText:ClassTextDraw[MAX_PLAYERS];
PlayerTextDrawLetterSize(playeridClassTextDraw[playerid], 0.00000011.390331);
PlayerTextDrawTextSize(playeridClassTextDraw[playerid], 160.0000000.000000);
PlayerTextDrawAlignment(playeridClassTextDraw[playerid], 1);
PlayerTextDrawColor(playeridClassTextDraw[playerid], 0);
PlayerTextDrawUseBox(playeridClassTextDraw[playerid], true);
PlayerTextDrawBoxColor(playeridClassTextDraw[playerid], 102);
PlayerTextDrawSetShadow(playeridClassTextDraw[playerid], 0);
PlayerTextDrawSetOutline(playeridClassTextDraw[playerid], 0);
PlayerTextDrawFont(playeridClassTextDraw[playerid], 0);
PlayerTextDrawShow(playerid,ClassTextDraw[playerid]);
PlayerTextDrawDestroy(playerid,ClassTextDraw[playerid]); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)