Jump to content

[0.3]Cum sa creezi un dialog.


Guest farse

Recommended Posts

Cum sa creezi un dialog.

0.3

ShowPlayerDialog(PLAYERID,DIALOGID,DIALOG_STYLE,Mesaj,Buton_1,Buton_2);

PLAYERID-Cui sa ii arate

DIALOGID-Numarul dialogului

DIALOG_STYLE-stilul dialogului:

0 - DIALOG_STYLE_MSGBOX -numai mesaj

1 - DIALOG_STYLE_INPUT -in care poti scrie ceva

2 - DIALOG_STYLE_LIST -lista.


Daca vrei sa adaugi o noua linie scrii \n (ex:"Reguli:\n -Nu injura...)

Daca vrei sa creezi un spatiu mai mare \t (ex:"-nu injura\t-nu discrimina")


OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])

playerid-cine a raspuns

dialogid-numarul dialogului

response-ce buton a apasat

listitem-daca e DIALOG_STYLE_LIST ce a ales

inputtext-daca e DIALOG_STYLE_INPUT ce a scris in casuta


Acum sa construim un dialog:

1.

#define Dialog_Test 1
Dialog_Test - e o scurtatura 1-Numarul dialogului 2.
ShowPlayerDialog(playerid,Dialog_Test,DIALOG_STYLE_LIST,"Selecteaza","Ajutor\nTeleporturi\nReguli\nComenzi","Selecteaza","Inchide");
Asta adaugi intro comanda,sau unde vrei tu 3. La OnDialogResponse:
if(dialogid==Dialog_Test)
{
if(response)//daca apasa primul buton
{
if(listitem==0)//Ajutor
{
SendClientMessage(playerid,COLOR_RED,"Ajutor...spanzura-te");
}
if(listitem==1)//Teleporturi
{
SendClientMessage(playerid,COLOR_RED,"Teleporteaza-te in mormant");
}
//si tot asa
}else //daca a dat click pe celalt buton
{
SendClientMessage(playerid,COLOR_RED,"Bine ca nu ai ales");
}
return 1;
}


Daca vreti sa faceti un dialog cu un singur buton,in ultimul parametru puneti ""

Ex: ShowPlayerDialog(playerid,Dialog_Test,DIALOG_STYLE_BOX,"Exemplu","Dialogul contine doar un button.","Buton","");

Link to comment
Share on other sites

  • 3 months later...

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid==1)
	{
		if(response)
		{
		    SendClientMessage(playerid, COLOR_RED, "You have clicked 'Accept' so you accept the rules!");
		}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "You have clicked 'Decline' so you don't accept the rules!");
		    Kick(playerid);
		}
		return 1;
}

Apas pe accept, imi arata cu rosu you have clicked accept bla bla si apas decline dar nu face nimic.Any ideas?

Solved.

Link to comment
Share on other sites

  • 1 month later...
  • 11 months later...

Ruben" post="55184" timestamp="1297954290"]

Merge tot dar...ami de erruruorile astea!!

error 017: undefined symbol "dialogid"
error 017: undefined symbol "response"
error 017: undefined symbol "listitem"
error 017: undefined symbol "listitem"
Scuzati daca inviu topicuri dar na...nu stiu ce sa-i fac! :)))
Callback-ul trebuie sa fie de genul asta: public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) Exemplu:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    //restu de linii
    return 1;
}

logo.png

ATENTIE!!! Nu imi trimiteti mesaje private care au legatura cu scriptingul. NU mai scriptez.

Link to comment
Share on other sites

  • 2 weeks later...

sper sa stiti cum se rezolva:

linile sunt exact ca alea a lui Farse dar

C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(251) : warning 225: unreachable code
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(692) : error 017: undefined symbol "MakePlayerNumber"
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(718) : error 004: function "CountDown" is not implemented
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(869) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(869) : error 004: function "OnPlayerSpawn" is not implemented
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(883) : warning 225: unreachable code
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(883) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(883) : error 004: function "OnPlayerDeath" is not implemented
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(890) : warning 225: unreachable code
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(890) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(890) : error 004: function "OnPlayerRequestClass" is not implemented
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(903) : warning 225: unreachable code
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(903) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(903) : error 004: function "OnGameModeInit" is not implemented
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(1229) : warning 225: unreachable code
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(1229) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(1229) : error 004: function "OnGameModeExit" is not implemented
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(1259) : warning 225: unreachable code
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(1259) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(1259) : error 004: function "OnPlayerUpdate" is not implemented
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(1318) : warning 225: unreachable code
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(1318) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(1318) : error 004: function "OnPlayerEnterVehicle" is not implemented
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(1325) : warning 225: unreachable code
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(1325) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(1325) : error 004: function "FLIPAUTO" is not implemented
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(1339) : warning 225: unreachable code
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(1339) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(1339) : error 004: function "OnPlayerExitVehicle" is not implemented
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(1345) : warning 225: unreachable code
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(1345) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(1345) : error 004: function "OnPlayerStateChange" is not implemented
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(1347) : error 017: undefined symbol "oldstate"
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(1349) : error 017: undefined symbol "newstate"
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(1357) : error 017: undefined symbol "oldstate"
C:\Documents and Settings\Owner\Desktop\DsD V1\gamemodes\DsD.pwn(1359) : error 017: undefined symbol "newstate"

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


26 Errors.

Romania Zone Accelerate

SAU

Romania True Roleplay

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.