Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Top of script
- new PlayerText:responseOption[MAX_PLAYERS];
- //onplayerconnect
- responseOption[playerid] = CreatePlayerTextDraw(playerid,424.000000, 383.000000, "Take the weed Ignore");
- PlayerTextDrawAlignment(playerid,responseOption[playerid], 2);
- PlayerTextDrawBackgroundColor(playerid,responseOption[playerid], 255);
- PlayerTextDrawFont(playerid,responseOption[playerid], 1);
- PlayerTextDrawLetterSize(playerid,responseOption[playerid], 0.289999, 1.500000);
- PlayerTextDrawColor(playerid,responseOption[playerid], -1);
- PlayerTextDrawSetOutline(playerid,responseOption[playerid], 0);
- PlayerTextDrawSetProportional(playerid,responseOption[playerid], 1);
- PlayerTextDrawSetShadow(playerid,responseOption[playerid], 0);
- PlayerTextDrawUseBox(playerid,responseOption[playerid], 1);
- PlayerTextDrawBoxColor(playerid,responseOption[playerid], 255);
- PlayerTextDrawTextSize(playerid,responseOption[playerid], 0.000000, 150.000000);
- PlayerTextDrawHide(playerid, responseOption[playerid]);
- //Function which im using for testing - I just call it from a Command IG
- public ResponseMsg(playerid, msg[]){
- //Change text for info textdraw
- PlayerTextDrawSetString(playerid, responseText[playerid], msg);
- PlayerTextDrawSetSelectable(playerid, responseOption[playerid], 1);
- //display them all.
- PlayerTextDrawShow(playerid, responseTop[playerid]); // These three are just for display
- PlayerTextDrawShow(playerid, responseTitle[playerid]);
- PlayerTextDrawShow(playerid, responseText[playerid]);
- PlayerTextDrawShow(playerid, responseOption[playerid]);
- SelectTextDraw(playerid, 0xA3B4C5FF);
- //set timer to close
- if(responseMsgTimerActive[playerid] == 0){
- responseMsgTimerActive[playerid] = 1;
- responseMsgTimerID[playerid] = SetTimerEx("ResponseMsgHide", 5000, true, "i", playerid);
- }
- return 1;
- }
- //the callback?
- public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
- {
- if(playertextid == responseOption[playerid]) // If the player clicked on the teleportLS textdraw, teleport him there!
- {
- SendClientMessage(playerid, COLOR_GREEN, "yay");
- }else{
- SendClientMessage(playerid, COLOR_GREEN, "nay");
- }
- // Hide the textdraws after the player has teleport himself.
- PlayerTextDrawHide(playerid, responseOption[playerid]);
- CancelSelectTextDraw(playerid); // Everything worked out perfectly, now stop the player to be able to select shizzle.
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment