16.10.2012, 05:41
Heyy .com
I have a problem.
This is the textdraw:

OnGameModeInit:
AFK Command:
OnPlayerClickTextdraw:
OnPlayerKeyStateChange:
What's wrong? When i click on BACK this don't do anything

This is the textdraw:

OnGameModeInit:
Код:
... Other TD; BACK = TextDrawCreate(320.625, 233.916, "BACK"); TextDrawSetSelectable(BACK, 1); 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);
Код:
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); SPH(playerid, 999999); format(string, sizeof(string), "~r~%s ~w~= ~b~AFK", AFKNAME); GameTextForAll(string,4000,3); ShowTD(playerid, BACK); ShowTD(playerid, YOUAFK); ShowTD(playerid, STARAFK); ShowTD(playerid, CLICKBRB); } return 1; }
Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid) { if(clickedid == BACK) //I tried to put Text:BACK, but no any change :( { HideTD(playerid, BACK); HideTD(playerid, YOUAFK); HideTD(playerid, STARAFK); HideTD(playerid, CLICKBRB); 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); } return 1; }
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if(newkeys == KEY_SUBMISSION) { SelectTextDraw(playerid, 0xFF4040AA); if (IsPlayerInAnyVehicle(playerid)) { new Float:health; new vehicleid = GetPlayerVehicleID(playerid); GetVehicleHealth(vehicleid, health); if (health < 995) { RepairVehicle(GetPlayerVehicleID(playerid)); } } }
