Én találtam egy ilyet a samp wikin:
[pawn]
if(!strcmp(cmdtext, \"/relax\", true))
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_MSGBOX, \"Are you sure?\", \"Are you sure you have time to relax?\", \"yes\", \"no\");
return 1;
}
This will show the dialog with ID 2 (we already used dialogid 1) to the player. The style here is DIALOG_STYLE_MSGBOX.
Now we need to set-up the response again...
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[ ])//Itt a [ ]ilyet egybe csak így mutatja rendesen
{
if(response)// They pressed the first button
{
switch(dialogid)// Checking what dialog were processing
{
case 1:// Our first dialog
{
switch(listitem)// Checking which item was chosen
{
case 0: // The first listitem
{
if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, 0xFFFFFF, \"You dont have enough cash.\");
GivePlayerMoney(playerid, -1);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
}
case 1: // The second listitem
{
if(GetPlayerMoney(playerid) < 2) return SendClientMessage(playerid, 0xFFFFFF, \"You dont have enough cash.\");
GivePlayerMoney(playerid, -2);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
}
case 2: // The third listitem
{
if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, 0xFFFFFF, \"You dont have enough cash.\");
GivePlayerMoney(playerid, -3);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
}
}
}
//From here we added things
case 2:// The new dialog
{
ApplyAnimation(playerid,\"BEACH\",\"Lay_Bac_Loop\",4.1,1,1,1,1,10);//this will let you relax for 10 seconds
}
// Till here
}
}
return 1;
}[/pawn]
Itt csak azt nem értem miért van a Response alatt 3?
Dupla hozzászólás automatikusan összefûzve. ( 2011. december 04. - 15:46:56 )
Meg oldtam a problémámat! az eggyik script (szintén dialog os) kilõötte a dialogot amit a cfg be utánna írtam ,elé kelelt írni és mükõdik köszönöm midnenkinek!