Post: [SCRIPT] Confirmation Text (universal)
02-20-2012, 03:46 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); I have seen this in some patches and idk if it has been released.

Here is my version of confirmation text using BS button monitoring..

in your menu option you would put..
    
testThread()
{
ask = self thread confirmation("Say Hi");
if(ask)
self sayall("hi!"); // if(!ask) example if false
}


Add this anywhere in your patch:

    
confirmation(text)
{
a = self createFontString("default", 1.6);
a setPoint("CENTER", "MIDDLE", 0, 0);
a setText("Do you want to" + text + "?\n[{+gostand}] - Yes [{+usereload}] - No");
self thread monitorButtons();
for(;Winky Winky
{
self waittill("buttonPress", button);
if(button == "A")
{
a destroy();
return true;
}
if(button == "X")
{
a destroy();
return false;
}
}
}

monitorButtons()
{
self endon( "disconnect" );
self endon( "death" );
ent = spawnStruct();
buttons = strTok( "A|+gostand;X|+usereload;RT|+attack", ";" );
for( i = 0; i < buttons.size; i++ )
{
split = strTok( buttons[i], "|" );
self notifyOnPlayerCommand( split[0], split[1] );
}
for( ;; )
{
for( i = 0; i < buttons.size; i++ )
{
button = strTok( buttons[i], "|" );
self thread waittill_string( button[0], ent );
}
ent waittill( "returned", btn );
ent notify( "die" );
self notify( "buttonPress", btn );
}
}



now whenever you want a confirmation screen just put self thread confirmation(); Winky Winky
if it's true then it works if not then nothing happens Smile
(adsbygoogle = window.adsbygoogle || []).push({});

The following 2 users say thank you to Jakes625 for this useful post:

Blackstorm, KingcreekS
02-20-2012, 11:21 PM #11
Vilerage
360 Black Scope
Originally posted by SatanicHispanic View Post
menuOpt()
{
ask = self thread confirmation("open player menu");
if(!ask)
break;
else
///open player menu here
}



Thanks bro I'll try this....:jim:
02-20-2012, 11:56 PM #12
Taylor
Former Black Knight.
Originally posted by Blackstorm View Post
Sounds like you heard right :carling:


HA, Point Invalid! You must login or register to view this content. lmao
02-21-2012, 02:40 AM #13
Vilerage
360 Black Scope
Originally posted by Vilerage
Thanks bro I'll try this....:jim:


menuOpt()
{
ask = self thread confirmation("open player menu");
if(!ask)
break;
else
///open player menu here
}
code error:
Originally posted by another user
Ilegal break statement
:\
02-21-2012, 04:45 AM #14
Originally posted by Vilerage
menuOpt()
{
ask = self thread confirmation("open player menu");
if(!ask)
break;
else
///open player menu here
}
code error:
:\


yeah

just do

if(ask)
//code here

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo