Help Me [All Code Here] -
xplor09edy - 17.10.2012
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
Re: Help Me [All Code Here] -
trapstar2020 - 17.10.2012
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
Re: Help Me [All Code Here] -
xplor09edy - 17.10.2012
Dont Work
Re: Help Me [All Code Here] -
trapstar2020 - 17.10.2012
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
Re: Help Me [All Code Here] -
xplor09edy - 17.10.2012
@trapstar2020 Thanks
I wait for respons
Re: Help Me [All Code Here] -
trapstar2020 - 17.10.2012

it worked?
Re: Help Me [All Code Here] -
xplor09edy - 17.10.2012
no dont work
Re: Help Me [All Code Here] -
TzAkS. - 17.10.2012
Код:
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;
}
Re: Help Me [All Code Here] -
trapstar2020 - 17.10.2012
PHP код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_ACTION)//foot controls look 4 it , u need to select 1
{
SelectTextDraw(playerid, 0xFF4040AA);
}
return 1;
}
https://sampwiki.blast.hk/wiki/OnPlayerClickTextDraw < watch the example
Re: Help Me [All Code Here] -
xplor09edy - 17.10.2012
Nothing, dont work