15.12.2014, 05:09
Hello i was trying to make a clickable textdraw yesterday and i made cmds and stuff but when i click the textdraws nothing happens I don't know what did i do wrong here are the codes:
cmds:
OnPlayerClickTextDraw:
OnFilterScriptInit:
cmds:
Код:
if (strcmp("/health", cmdtext, true, 10) == 0) { TextDrawShowForPlayer(playerid, Test); SelectTextDraw(playerid, 0xA3B4C5FF); return 1; } if (strcmp("/hidetext", cmdtext, true, 10) == 0) { TextDrawHideForPlayer(playerid, Test); TextDrawShowForPlayer(playerid, Cancel); SendClientMessage(playerid, -1, "{FFFF00}*** {FFCC00}You have succesfully hidden the {FF0000}Textdraws{FFFF00} ***"); return 1; }
Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid) { if(clickedid == Test) { SetPlayerHealth(playerid, 100); SendClientMessage(playerid, -1, "You have filled your hp"); } else if(clickedid == Cancel) { TextDrawHideForPlayer(playerid, Test); TextDrawHideForPlayer(playerid, Cancel); SendClientMessage(playerid, -1, "{FFFF00}*** {FFCC00}You have cancelled {FF0000}Textdraws{FFFF00}!***"); CancelSelectTextDraw(playerid); } return 1; }]
Код:
Test = Text:TextDrawCreate(320.0,240.0,"Health~n~"); TextDrawAlignment(Test, 2); TextDrawLetterSize(Test, 0.900000, 1.922222); TextDrawColor(Test, -1); TextDrawSetOutline(Test, 0); TextDrawSetProportional(Test, 1); Cancel = TextDrawCreate(320.000000, 180.000000, "Cancel~n~"); TextDrawAlignment(Cancel, 2); TextDrawLetterSize(Cancel, 0.900000, 1.922222); TextDrawColor(Cancel, -1); TextDrawSetOutline(Cancel, 0); TextDrawSetProportional(Cancel, 1);