Jump to content

[0.3]Cum sa creezi un dialog.


Recommended Posts

Posted

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","");

Posted

eu nu stiam cum se creeaza ;D si am invatat putin :D

EDIT: Am facut un dialog cu reguli, daca apesi pe "I agree" zice "Have Fun!" si daca apesi pe "I disagree" iti zice "You didn't agree with the rules" ;D

Posted

Foarte bun tutorialul!! ;D

Acum stiu si eu. :D

  • 3 months later...
Posted

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.

Posted

Bv Frumos !! Acm mam trezit si eu sa fac post  :D :D

<a href='http://www.yhcbux.com/?ref=sice'><img src='http://www.yhcbux.com/images/banner1.gif'></a>

  • 1 month later...
Posted

Frumos toturial aveam evoie de el pt chestia cu logik in casuta ;)

Nu beau, nu fumez, ma scol la 6 in fiecare zi, ma culc la 10, nu-mi insel nevasta... wtf ?

  • 11 months later...
Posted

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! :)))

  • Administrator
Posted

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.

  • 2 weeks later...
Posted

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

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.