19.09.2009, 11:01
Quote:
Originally Posted by ZeeX
pawn Code:
pawn Code:
|
Edit:
List updated also.
Originally Posted by ZeeX
pawn Code:
pawn Code:
|
Originally Posted by Dark_Kostas
Can you add redirect links to the scripts? After that it would be nice if it was sticked
|
Originally Posted by Joe Staff
The IDs on my script are customizable as my script doesn't rely on the DialogID, it relies on the inputs. In my next release I'll figure a way to prevent it from causing issues with other scripts.
|
Originally Posted by Kurence
The best thing is to define that dialog IDs all in one script
|
Originally Posted by [LRP
Sayaron ]
I have changed id to: 5009 |
Originally Posted by Seif_ [adream-rp.com
]
You should all just use ZeeX's function. |
Originally Posted by Seif_ [adream-rp.com
]
You should all just use ZeeX's function. |
//in connect
gLogDialog = Create...
printf( ...gDialog ); //this will print 0
printf( ...gDialog ); //this will print 9
Originally Posted by [LRP
Sayaron ]
I preffer the old. Dont wanna waste any time learning another method when the old works fine |
Originally Posted by Joe Staff
Quote:
I think the new method will work just fine, it's not a huge change, just instead of putting in permanent numbers, it's a variable, not much sacrifice. The largest number is 0x7FFFFFFF, and if you ever reach that many dialogs created then you've got some crazy sh*t going on. |
printf( "%d", DIALOG_ID ); //this is a define #define DIALOG_ID 9999
#define DIALOG_TEST 0
#define DIALOG_LOGIN 1
new PlayerDialog[MAX_PLAYERS];
public OnPlayerCommandText(playerid,cmdtext[])
{
if(!strcmp(cmdtext[1],"OpenTest",true))
{
PlayerDialog[playerid]=DIALOG_TEST;
ShowPlayerDialog(playerid,0,DIALOG_TYPE_MSGBOX,"Test","This is a test","Ok","Cancel");
return 1;
}
if(!strcmp(cmdtext[1],"Login",true))
{
PlayerDialog[playerid]=DIALOG_LOGIN;
ShowPlayerDialog(playerid,0,DIALOG_TYPE_INPUT,"Login","Type in your login name","Ok","Cancel");
return 1;
}
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(PlayerDialog[playerid])
{
case DIALOG_TEST:
{
//Code
}
case DIALOG_LOGIN:
{
//Code
}
}
}
Originally Posted by Seif_ [adream-rp.com
]
In that case, we'd have to use CallRemoteFunction and use a function to get the available dialogid |
Originally Posted by Seif_ [adream-rp.com
]
Quote:
|
new adminvec, admindialog; public OnGameModeInit(){ adminvec = CreateVehicle(); admindialog = CreateDialog(.type=0,.caption="admin command",.info=""hi all",.button1="ok",.button2="cancel"); return true; } public OnPlayerEnterVehicle(playerid,vehicleid){ if(vehicleid==adminvec){ //bla... } return true; } public OnPlayerSpawn(playerid){ ShowPlayerDialog(playerid,admindialog); return true; } public OnPlayerResponseDialog(bla){ if(dialogid == admindialog){ //bla... } return true; }