Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #pragma tabsize 0
- // =================================================================================
- #define msgbox DIALOG_STYLE_MSGBOX
- #define input DIALOG_STYLE_INPUT
- #define list DIALOG_STYLE_LIST
- #define pass DIALOG_STYLE_PASSWORD
- #if !defined isnull
- #define isnull(%1) \
- ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
- #endif
- #define addDialogHandler(%0) \
- forward callDialog_%0(playerid, response, listitem, inputtext[]); \
- public callDialog_%0(playerid, response, listitem, inputtext[])
- #define Dialog:%0(%1,%2,%3,%4) \
- forward callDialog_%0(%1,%2,%3,%4); \
- public callDialog_%0(%1,%2,%3,%4)
- static CALL_DIALOG [ 24 ] ;
- OnDialogResponseProcessor ( playerid , dialogid , response , listitem , inputtext [] );
- public OnDialogResponseProcessor ( playerid , dialogid , response , listitem , inputtext [] )
- {
- if ( dialogid ) format ( CALL_DIALOG , 24 , "callDialog_%d" , dialogid ) ;
- return ( ( funcidx ( CALL_DIALOG ) != -1 ) ? ( CallLocalFunction ( CALL_DIALOG , "ddds" , playerid , response , listitem , isnull( inputtext ) ? ( "\1" ) : ( inputtext ) ) ) : ( 0 ) ) ;
- }
- // =================================================================================
- #define START_BENCH(%0); {new __a=%0,__b=0,__c,__d=GetTickCount(),__e=1;do{}\
- while(__d==GetTickCount());__c=GetTickCount();__d=__c;while(__c-__d<__a||\
- __e){if(__e){if(__c-__d>=__a){__e=0;__c=GetTickCount();do{}while(__c==\
- GetTickCount());__c=GetTickCount();__d=__c;__b=0;}}{
- #define FINISH_BENCH(%0); }__b++;__c=GetTickCount();}printf(" Bench for "\
- %0": executes, by average, %.2f times/ms.",floatdiv(__b,__a));}
- enum
- {
- DIALOG_NULL,
- DIALOG_NORMAL = 12,
- DIALOG_PROCESSOR = 22,
- DIALOG_SWITCH = 32,
- DIALOG_PROCESSOR1 = 20,
- DIALOG_PROCESSOR2 = 21
- };
- main()
- {
- print("\n----------------------------------");
- print(" Blank Gamemode by your name here");
- print("----------------------------------\n");
- }
- public OnGameModeInit()
- {
- SetGameModeText("Blank Script");
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- START_BENCH( 1000 );
- {
- CallLocalFunction("OnDialogResponseProcessor","dddds",0,DIALOG_PROCESSOR,1,0,"\1");
- }
- FINISH_BENCH("Dialog Processor");
- START_BENCH( 1000 );
- {
- CallLocalFunction("OnDialogResponse","dddds",0,DIALOG_NORMAL,1,0,"\1");
- }
- FINISH_BENCH("Dialog Normal");
- START_BENCH( 1000 );
- {
- CallLocalFunction("OnDialogResponseSwitch","dddds",0,DIALOG_SWITCH,1,0,"\1");
- }
- FINISH_BENCH("Dialog Switch");
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnDialogResponse ( playerid , dialogid , response , listitem , inputtext [] )
- {
- if(dialogid == 10)
- return 1;
- else if(dialogid == 11)
- return 1;
- else if(dialogid == DIALOG_NORMAL)
- return 1;
- return 1;
- }
- OnDialogResponseSwitch ( playerid , dialogid , response , listitem , inputtext [] );
- public OnDialogResponseSwitch ( playerid , dialogid , response , listitem , inputtext [] )
- {
- switch(dialogid)
- {
- case 30:
- return 1;
- case 31:
- return 1;
- case DIALOG_SWITCH:
- return 1;
- }
- return 1;
- }
- Dialog:DIALOG_PROCESSOR( playerid, response, listitem, inputtext[])
- {
- return 1;
- }
- Dialog:DIALOG_PROCESSOR1(playerid, response, listitem, inputtext[])
- {
- return 1;
- }
- Dialog:DIALOG_PROCESSOR2( playerid, response, listitem, inputtext[])
- {
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment