Help Me [All Code Here]
#1

Heyy Can you help me with a problem?
I have this TD:
And this is code:
Код:
new Text:BACK;
public OnGameModeInit( )
{
	//Other TD UP
	BACK = TextDrawCreate(320.625, 233.916, "BACK");
	TextDrawLetterSize(BACK, 0.449, 1.600);
	TextDrawTextSize(BACK, 2.500, -57.166);
	TextDrawAlignment(BACK, 2);
	TextDrawColor(BACK, -1);
	TextDrawUseBox(BACK, 1);
	TextDrawBoxColor(BACK, 102);
	TextDrawSetOutline(BACK, 1);
	TextDrawBackgroundColor(BACK, 51);
	TextDrawFont(BACK, 1);
	TextDrawSetProportional(BACK, 1);
	TextDrawSetSelectable(BACK, 1);
	//And this is last textdraw.
	return 1;
}

CMD:afk(playerid, params[])
{
    new string[500], AFKNAME[MAX_PLAYER_NAME];
    GetPlayerName(playerid,AFKNAME,MAX_PLAYER_NAME);
    if(AFK[playerid] == 1)
	{
	    GameTextForPlayer(playerid, "~r~You are ~w~already ~b~afk~w~.", 2000, 3);
	}
	if(AFK[playerid] == 0)
	{
	    AFK[playerid] = 1;
	    TogglePlayerControllable(playerid, 0);
		SetPlayerHealth(playerid, 999999);
     	format(string, sizeof(string), "~r~%s ~w~= ~b~AFK", AFKNAME);
      	GameTextForAll(string,4000,3);
      	TextDrawShowForPlayer(playerid, BACK);
      	TextDrawShowForPlayer(playerid, YOUAFK);
      	TextDrawShowForPlayer(playerid, STARAFK);
      	TextDrawShowForPlayer(playerid, CLICKBRB);
        SelectTextDraw(playerid, 0xFF4040AA);
	}
	return 1;
}
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(clickedid == Text:BACK)
    {
        new string[500], AFKNAME[MAX_PLAYER_NAME];
    	GetPlayerName(playerid,AFKNAME,MAX_PLAYER_NAME);
    	format(string, sizeof(string), "~r~%s ~w~= ~b~NO AFK", AFKNAME);
    	GameTextForAll(string,4000,3);
    	TogglePlayerControllable(playerid, 1);
    	SPH(playerid, 100);
	    TextDrawHideForPlayer(playerid, BACK);
		TextDrawHideForPlayer(playerid, YOUAFK);
		TextDrawHideForPlayer(playerid, STARAFK);
 		TextDrawHideForPlayer(playerid, CLICKBRB);
 		CancelSelectTextDraw( playerid );
    }
    return 1;
}
But when i click on BACK, nothing DO
Reply
#2

public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid == BACK)//dont put TEXT:BACK, u put whats after the :
{
///ur stuff
}
return 1;
}

https://sampwiki.blast.hk/wiki/OnPlayerClickTextDraw
REP me if i help u please
Reply
#3

Dont Work
Reply
#4

AFK[playerid] = 1; ummmm u have this in AFK command but i dont see it on click back to turn it back into AFK[playerid] = 0; hmmmmmm
Reply
#5

@trapstar2020 Thanks

I wait for respons
Reply
#6

it worked?
Reply
#7

no dont work
Reply
#8

Код:
public OnGameModeInit( )
{
	//Other TD UP
	BACK = TextDrawCreate(320.625, 233.916, "BACK");
	TextDrawLetterSize(BACK, 0.500000, 1.000000);
	TextDrawTextSize(BACK, 2.500, 10.000000);
	TextDrawAlignment(BACK, 2);
	TextDrawColor(BACK, -1);
	TextDrawUseBox(BACK, 1);
	TextDrawBoxColor(BACK, 102);
	TextDrawSetOutline(BACK, 1);
	TextDrawBackgroundColor(BACK, 51);
	TextDrawFont(BACK, 1);
	TextDrawSetProportional(BACK, 1);
	TextDrawSetSelectable(BACK, 1);
	//And this is last textdraw.
	return 1;
}

CMD:afk(playerid, params[])
{
    new string[500], AFKNAME[MAX_PLAYER_NAME];
    GetPlayerName(playerid,AFKNAME,MAX_PLAYER_NAME);
    if(AFK[playerid] == 1)
	{
	    GameTextForPlayer(playerid, "~r~You are ~w~already ~b~afk~w~.", 2000, 3);
	}
	if(AFK[playerid] == 0)
	{
	    AFK[playerid] = 1;
	    TogglePlayerControllable(playerid, 0);
		SetPlayerHealth(playerid, 999999);
     	format(string, sizeof(string), "~r~%s ~w~= ~b~AFK", AFKNAME);
      	GameTextForAll(string,4000,3);
      	TextDrawShowForPlayer(playerid, BACK);
      	TextDrawShowForPlayer(playerid, YOUAFK);
      	TextDrawShowForPlayer(playerid, STARAFK);
      	TextDrawShowForPlayer(playerid, CLICKBRB);
        SelectTextDraw(playerid, 0xFF4040AA);
	}
	return 1;
}
Reply
#9

PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
newkeys == KEY_ACTION)//foot controls look 4 it , u need to select 1
    
{
        
SelectTextDraw(playerid0xFF4040AA);
    }
    return 
1;

https://sampwiki.blast.hk/wiki/OnPlayerClickTextDraw < watch the example
Reply
#10

Nothing, dont work
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)