All pastes #561483 Raw Edit

switch

public text v1 · immutable
·published 2007-06-12 13:59 UTC
rendered paste body
#include <a_samp>
new Text:txtVar;
new Text:txtCount;
new gCount;
forward textDraw2(playerid);
main(){}

textDraw(playerid){
	//TextDrawDestroy(txtVar);
	txtVar = TextDrawCreate(500.0, 400.0, "hi");
	TextDrawShowForPlayer(playerid, txtVar);
	print("Shown hi");
}

public textDraw2(playerid){
	new string[12];
	format(string,sizeof(string),"%d", gCount);
	TextDrawDestroy(txtCount);
	txtCount = TextDrawCreate(500.0, 300.0, string);
	TextDrawShowForPlayer(playerid, txtCount);
	gCount++;
	print("Shown count");
}

public OnGameModeInit()
{
	SetGameModeText("Blank Script");
	AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/hi", cmdtext, true, 10) == 0)
	{
    	textDraw(playerid);
		return 1;
	}
	if (strcmp("/count", cmdtext, true, 10) == 0)
	{
    	SetTimerEx("textDraw2",200,1,"d",playerid);
		return 1;
	}
	return 0;
}

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}

public OnGameModeExit()
{
	//TextDrawDestroy(txtCount);
	//TextDrawDestroy(txtVar);
	return 1;
}