SA-MP Forums Archive
textdraw - 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: textdraw (/showthread.php?tid=355571)



textdraw - $mooth - 30.06.2012

Hey im trying to fix a textdraw into the game, but it wont work.

Код:
	new Text:Textdraw1;
	Textdraw1 = TextDrawCreate(488, 120, "just a text here");
	TextDrawFont(Textdraw1 , 1);
	TextDrawLetterSize(Textdraw1 , 1, 7);
	TextDrawColor(Textdraw1 , 0xFFFFFFFF);
	TextDrawSetOutline(Textdraw1 , 1);
	TextDrawSetProportional(Textdraw1 , 1);
	TextDrawSetShadow(Textdraw1 , 1);
I used BSN Textdraw Editor, but somehow it just wont work.
im trying to get it under the moneybar or above the clock.

Please help!


Re: textdraw - [KHK]Khalid - 30.06.2012

How doesn't it work? What's the problem?


Re: textdraw - .FuneraL. - 30.06.2012

Quote:
Originally Posted by $mooth
Посмотреть сообщение
Hey im trying to fix a textdraw into the game, but it wont work.

Код:
	new Text:Textdraw1;
	Textdraw1 = TextDrawCreate(488, 120, "just a text here");
	TextDrawFont(Textdraw1 , 1);
	TextDrawLetterSize(Textdraw1 , 1, 7);
	TextDrawColor(Textdraw1 , 0xFFFFFFFF);
	TextDrawSetOutline(Textdraw1 , 1);
	TextDrawSetProportional(Textdraw1 , 1);
	TextDrawSetShadow(Textdraw1 , 1);
I used BSN Textdraw Editor, but somehow it just wont work.
im trying to get it under the moneybar or above the clock.

Please help!
Not have TextDrawShowForPlayer... Try...


Re: textdraw - MadeMan - 30.06.2012

You have to show the textdraw too.

pawn Код:
TextDrawShowForPlayer(playerid, Textdraw1);



Re: textdraw - $mooth - 30.06.2012

I've tried to put in TextDrawShowForPlayer(playerid, Textdraw1);
but where do i put it? Cuz' when i do it wont work, getting: undefined symbol "playerid"


Re: textdraw - MadeMan - 30.06.2012

Put it to OnPlayerSpawn.


Re: textdraw - $mooth - 30.06.2012

This is my code there:
Код:
public OnPlayerSpawn(playerid)
{
	if (IsPlayerNPC(playerid))
		return 1;

	if (APlayerData[playerid][LoggedIn] == false)
	{
		SendClientMessage(playerid, 0xFFFFFFFF, TXT_FailedLoginProperly);
	    Kick(playerid); 
	}

	new missiontext[200];

    SetPlayerVirtualWorld(playerid, 0);
	SetPlayerInterior(playerid, 0);
	APlayerData[playerid][CurrentHouse] = 0;

	TogglePlayerClock(playerid, 0);
	

	ResetPlayerWeapons(playerid);

	switch (APlayerData[playerid][PlayerClass])
	{
		case ClassTruckDriver: 
		{
			format(missiontext, sizeof(missiontext), Trucker_NoJobText); 
			SetPlayerColor(playerid, ColorClassTruckDriver);
		}
		case ClassBusDriver: 
		{
			format(missiontext, sizeof(missiontext), BusDriver_NoJobText); 
			SetPlayerColor(playerid, ColorClassBusDriver); 
		}
		case ClassPilot: 
		{
			format(missiontext, sizeof(missiontext), Pilot_NoJobText); 
			SetPlayerColor(playerid, ColorClassPilot);
		}
		case ClassPolice:
		{
			format(missiontext, sizeof(missiontext), Police_NoJobText); 
			SetPlayerColor(playerid, ColorClassPolice);
			
			KillTimer(APlayerData[playerid][PlayerCheckTimer]);
			APlayerData[playerid][PlayerCheckTimer] = SetTimerEx("Police_CheckWantedPlayers", 1000, true, "i", playerid);
			
			if (PoliceGetsWeapons == true)
			{
			   
				for (new i; i < 12; i++)
				    GivePlayerWeapon(playerid, APoliceWeapons[i], PoliceWeaponsAmmo);
			}
		}
		case ClassMafia: 
		{
			format(missiontext, sizeof(missiontext), Mafia_NoJobText); 
			SetPlayerColor(playerid, ColorClassMafia); 
			
			KillTimer(APlayerData[playerid][PlayerCheckTimer]);
			APlayerData[playerid][PlayerCheckTimer] = SetTimerEx("Mafia_CheckMafiaLoads", 1000, true, "i", playerid);
		}
		case ClassCourier: 
		{
			format(missiontext, sizeof(missiontext), Courier_NoJobText); 
			SetPlayerColor(playerid, ColorClassCourier); 
		}
		case ClassAssistance: 
		{
			format(missiontext, sizeof(missiontext), Assistance_NoJobText);
			SetPlayerColor(playerid, ColorClassAssistance); 
			
			KillTimer(APlayerData[playerid][PlayerCheckTimer]);
			APlayerData[playerid][PlayerCheckTimer] = SetTimerEx("Assistance_CheckPlayers", 1000, true, "i", playerid);
		}
		case ClassRoadWorker: 
		{
			format(missiontext, sizeof(missiontext), RoadWorker_NoJobText); 
			SetPlayerColor(playerid, ColorClassRoadWorker);
		}
	}


	TextDrawSetString(APlayerData[playerid][MissionText], missiontext);
	
	TextDrawShowForPlayer(playerid, APlayerData[playerid][MissionText]);


	if (APlayerData[playerid][PlayerJailed] != 0)
	    Police_JailPlayer(playerid, APlayerData[playerid][PlayerJailed]);

	return 1;
}
But cant seem to find where to put it, im sorry for asking so much, but im a newbie and better to learn and take it it anyways, thank you for the help


Re: textdraw - MadeMan - 30.06.2012

This should be fine.

pawn Код:
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
APlayerData[playerid][CurrentHouse] = 0;
TextDrawShowForPlayer(playerid, Textdraw1);



Re: textdraw - $mooth - 30.06.2012

Sorry for being a pain in the a** ^^
but when i complie i get this code:

*********************.pwn(1206) : error 017: undefined symbol "Textdraw1"


Re: textdraw - MadeMan - 30.06.2012

If you have it like this

pawn Код:
public OnGameModeInit()
{
    new Text:Textdraw1;
    Textdraw1 = TextDrawCreate(488, 120, "just a text here");
    TextDrawFont(Textdraw1 , 1);
    TextDrawLetterSize(Textdraw1 , 1, 7);
    TextDrawColor(Textdraw1 , 0xFFFFFFFF);
    TextDrawSetOutline(Textdraw1 , 1);
    TextDrawSetProportional(Textdraw1 , 1);
    TextDrawSetShadow(Textdraw1 , 1);
}
then it should be like this

pawn Код:
new Text:Textdraw1;

public OnGameModeInit()
{
    Textdraw1 = TextDrawCreate(488, 120, "just a text here");
    TextDrawFont(Textdraw1 , 1);
    TextDrawLetterSize(Textdraw1 , 1, 7);
    TextDrawColor(Textdraw1 , 0xFFFFFFFF);
    TextDrawSetOutline(Textdraw1 , 1);
    TextDrawSetProportional(Textdraw1 , 1);
    TextDrawSetShadow(Textdraw1 , 1);
}