Guest User

Untitled

a guest
Mar 24th, 2015
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. //Top of script
  2. new PlayerText:responseOption[MAX_PLAYERS];
  3.  
  4. //onplayerconnect
  5. responseOption[playerid] = CreatePlayerTextDraw(playerid,424.000000, 383.000000, "Take the weed Ignore");
  6. PlayerTextDrawAlignment(playerid,responseOption[playerid], 2);
  7. PlayerTextDrawBackgroundColor(playerid,responseOption[playerid], 255);
  8. PlayerTextDrawFont(playerid,responseOption[playerid], 1);
  9. PlayerTextDrawLetterSize(playerid,responseOption[playerid], 0.289999, 1.500000);
  10. PlayerTextDrawColor(playerid,responseOption[playerid], -1);
  11. PlayerTextDrawSetOutline(playerid,responseOption[playerid], 0);
  12. PlayerTextDrawSetProportional(playerid,responseOption[playerid], 1);
  13. PlayerTextDrawSetShadow(playerid,responseOption[playerid], 0);
  14. PlayerTextDrawUseBox(playerid,responseOption[playerid], 1);
  15. PlayerTextDrawBoxColor(playerid,responseOption[playerid], 255);
  16. PlayerTextDrawTextSize(playerid,responseOption[playerid], 0.000000, 150.000000);
  17.  
  18. PlayerTextDrawHide(playerid, responseOption[playerid]);
  19.  
  20.  
  21. //Function which im using for testing - I just call it from a Command IG
  22.  
  23. public ResponseMsg(playerid, msg[]){
  24. //Change text for info textdraw
  25. PlayerTextDrawSetString(playerid, responseText[playerid], msg);
  26.  
  27. PlayerTextDrawSetSelectable(playerid, responseOption[playerid], 1);
  28.  
  29. //display them all.
  30. PlayerTextDrawShow(playerid, responseTop[playerid]); // These three are just for display
  31. PlayerTextDrawShow(playerid, responseTitle[playerid]);
  32. PlayerTextDrawShow(playerid, responseText[playerid]);
  33. PlayerTextDrawShow(playerid, responseOption[playerid]);
  34.  
  35. SelectTextDraw(playerid, 0xA3B4C5FF);
  36.  
  37. //set timer to close
  38. if(responseMsgTimerActive[playerid] == 0){
  39. responseMsgTimerActive[playerid] = 1;
  40. responseMsgTimerID[playerid] = SetTimerEx("ResponseMsgHide", 5000, true, "i", playerid);
  41. }
  42. return 1;
  43. }
  44.  
  45. //the callback?
  46.  
  47. public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
  48. {
  49. if(playertextid == responseOption[playerid]) // If the player clicked on the teleportLS textdraw, teleport him there!
  50. {
  51. SendClientMessage(playerid, COLOR_GREEN, "yay");
  52. }else{
  53. SendClientMessage(playerid, COLOR_GREEN, "nay");
  54. }
  55. // Hide the textdraws after the player has teleport himself.
  56.  
  57. PlayerTextDrawHide(playerid, responseOption[playerid]);
  58.  
  59. CancelSelectTextDraw(playerid); // Everything worked out perfectly, now stop the player to be able to select shizzle.
  60. return 1;
  61. }
Advertisement
Add Comment
Please, Sign In to add comment