17.10.2012, 05:23
Heyy
Can you help me with a problem?
I have this TD:
And this is code:
But when i click on BACK, nothing DO

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; }
