PDA

View Full Version : Text Draw !


dorperez
10/12/2011, 05:15 PM
This textdraw is stuck on the top of my gm untill I get into a car and change station..How can I make it disappear ?

http://uper.co.il/upload/3e2f3330b740ba.png (http://uper.co.il)

http://uper.co.il/codes.php?id=3e2f3330b740ba.png

Tnx Guys !!

MadeMan
10/12/2011, 06:27 PM
Top of your gm??

Find the part in your script that creates it.

dorperez
11/12/2011, 07:38 AM
I found the script of it :


new StationTitle[16][1][64] = {
{"InLive-FM (Recommanded)"}, {"HitParty-FM"}, {"Idobi-FM"},
{"METAL ONLY"}, {"Radio Paloma"}, {"MUSIK.Extream"},
{"Techno4ever Radio"},{"DEFJAY.COM"}, {"TechnoBase.FM"},
{"Music One"}, {"Radio Jackie"},{"Suburds of Goa"},
{"Groove Salad"}, {"AAN Country"},{"KickRadio"},{"Radio Off"}
};

wildcookie007
11/12/2011, 08:07 AM
If I'm correct the textdraw only shows when you are in car, but when you leave the car the textdraw stays right? Try using TextDrawHideForPlayer onplayerexitvehicle or onstatechange from state_driver to state_onfoot

dorperez
11/12/2011, 12:44 PM
The textdraw should be when you enter to car but it shows when you are connect to the server..

THE_KNOWN
11/12/2011, 12:52 PM
OnPlayerSpawn : TextDrawHideForPlayer(playerid,textdrawname);

OnPlayerStateChange:

if(newstate == PLAYER_STATE_DRIVER)
{
TextDrawShowForPlayer(playerid,textdrawname);
}

dorperez
11/12/2011, 01:04 PM
C:\GTA - San Andreas\Server\gamemodes\Rp11Back.pwn(5018) : error 035: argument type mismatch (argument 2)
C:\GTA - San Andreas\Server\gamemodes\Rp11Back.pwn(6491) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.

5018:

TextDrawHideForPlayer(playerid,StationText);

6491:

if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
{
TextDrawShowForPlayer(playerid,StationText);
}

THE_KNOWN
11/12/2011, 01:14 PM
StationText is not the Textdraw name.

search for TextDrawSetString() that has StationText in it and use the textdraw name in it

suhrab_mujeeb
11/12/2011, 01:15 PM
Is the variable something like
new Text:StationText;

OR

new StationText;?

THE_KNOWN
11/12/2011, 01:17 PM
new StationTitle[16][1][64] = {
{"InLive-FM (Recommanded)"}, {"HitParty-FM"}, {"Idobi-FM"},
{"METAL ONLY"}, {"Radio Paloma"}, {"MUSIK.Extream"},
{"Techno4ever Radio"},{"DEFJAY.COM"}, {"TechnoBase.FM"},
{"Music One"}, {"Radio Jackie"},{"Suburds of Goa"},
{"Groove Salad"}, {"AAN Country"},{"KickRadio"},{"Radio Off"}
};

was mentioned earlier

suhrab_mujeeb
11/12/2011, 01:23 PM
This isn't the textdraw. Textdraws are something like


BRBTD = TextDrawCreate(211.000000, 194.000000, "AAA");
TextDrawBackgroundColor(BRBTD, 255);
TextDrawFont(BRBTD, 2);
TextDrawLetterSize(BRBTD, 2.599999, 9.000000);
TextDrawColor(BRBTD, -16776961);
TextDrawSetOutline(BRBTD, 1);
TextDrawSetProportional(BRBTD, 0);
and the declaration is something like
[pawn]new Text:ATextDraw[pawn]

dorperez
11/12/2011, 01:32 PM
This isn't the textdraw. Textdraws are something like


BRBTD = TextDrawCreate(211.000000, 194.000000, "AAA");
TextDrawBackgroundColor(BRBTD, 255);
TextDrawFont(BRBTD, 2);
TextDrawLetterSize(BRBTD, 2.599999, 9.000000);
TextDrawColor(BRBTD, -16776961);
TextDrawSetOutline(BRBTD, 1);
TextDrawSetProportional(BRBTD, 0);
and the declaration is something like
new Text:ATextDraw[pawn]

Yes it is bro ..

[pawn]
new StationTitle[16][1][64] = {
{"InLive-FM (Recommanded)"}, {"HitParty-FM"}, {"Idobi-FM"},
{"METAL ONLY"}, {"Radio Paloma"}, {"MUSIK.Extream"},
{"Techno4ever Radio"},{"DEFJAY.COM"}, {"TechnoBase.FM"},
{"Music One"}, {"Radio Jackie"},{"Suburds of Goa"},
{"Groove Salad"}, {"AAN Country"},{"KickRadio"},{"Radio Off"}
};

was mentioned earlier

The same errors man .. :)

THE_KNOWN
11/12/2011, 01:34 PM
This isn't the textdraw. Textdraws are something like


BRBTD = TextDrawCreate(211.000000, 194.000000, "AAA");
TextDrawBackgroundColor(BRBTD, 255);
TextDrawFont(BRBTD, 2);
TextDrawLetterSize(BRBTD, 2.599999, 9.000000);
TextDrawColor(BRBTD, -16776961);
TextDrawSetOutline(BRBTD, 1);
TextDrawSetProportional(BRBTD, 0);
and the declaration is something like
[pawn]new Text:ATextDraw[pawn]

i was just showing you he mentioned it earlier and i know its not a textdraw

MadeMan
11/12/2011, 01:41 PM
Show all the places in your script where you have 'StationTitle'

dorperez
11/12/2011, 01:45 PM
forward HideStationTitle(playerid);

new StationTitle[16][1][64] = {
{"InLive-FM (Recommanded)"}, {"HitParty-FM"}, {"Idobi-FM"},
{"METAL ONLY"}, {"Radio Paloma"}, {"MUSIK.Extream"},
{"Techno4ever Radio"},{"DEFJAY.COM"}, {"TechnoBase.FM"},
{"Music One"}, {"Radio Jackie"},{"Suburds of Goa"},
{"Groove Salad"}, {"AAN Country"},{"KickRadio"},{"Radio Off"}
};


for(new t = 0; t < 16; t++)
{
StationText[t] = TextDrawCreate(StationTextCoords[t][0],StationTextCoords[t][1],StationTitle[t][0]);
TextDrawAlignment(StationText[t],0);
TextDrawBackgroundColor(StationText[t],0x000000ff);
TextDrawFont(StationText[t],2);
TextDrawLetterSize(StationText[t],0.4,1.6);
TextDrawColor(StationText[t],0x906010ff);
TextDrawSetOutline(StationText[t],1);
TextDrawSetProportional(StationText[t],2);
TextDrawSetShadow(StationText[t],1);
}

public PlayVehicleRadioForPlayer(playerid,online)
{
if(online == 0)
{
StopAudioStreamForPlayer(playerid);
TextDrawShowForPlayer(playerid,StationText[15]);
WaitForBuf[playerid] = true;
SetTimerEx("NonChangeRadio",5000,false,"i",playerid);
SetTimerEx("HideStationTitle",3500,false,"i",playerid);
return 1;
}
StopAudioStreamForPlayer(playerid);
PlayAudioStreamForPlayer(playerid,StationUrl[online - 1][0]);
TextDrawShowForPlayer(playerid,StationText[online - 1]);
WaitForBuf[playerid] = true;
SetTimerEx("NonChangeRadio",5000,false,"i",playerid);
SetTimerEx("HideStationTitle",3500,false,"i",playerid);
return 1;
}

public HideStationTitle(playerid)
{
for(new i = 0; i < 16; i++) TextDrawHideForPlayer(playerid,StationText[i]);
return 1;
}



Tnx !

THE_KNOWN
11/12/2011, 01:48 PM
OnPlayerSpawn : HideStationTitle(playerid);

OnPlayerStateChange:

if(newstate == PLAYER_STATE_DRIVER)
{
PlayVehicleRadioForPlayer(playerid,1);
}

dorperez
11/12/2011, 02:57 PM
Tnx bro !

THE_KNOWN
11/12/2011, 02:59 PM
no probs :)