[Pomoc] dialog na registraciji..pomocccccccccccccccc


Započeo Otisao s Foruma!, Februar 29, 2012, 22:21:25 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: FG
Detaljan opis problema: kako da napravim ovo u dialogu mislim style list.?
Dio skripte:
public SetPlayerSpawn(playerid)
{
	if(IsPlayerConnected(playerid))
	{
	    SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]);
	    if(PlayerInfo[playerid][pTut] == 0)
	    {
			gOoc[playerid] = 1; gNews[playerid] = 1; gFam[playerid] = 1;
			SetPlayerInterior(playerid, 3);
			PlayerInfo[playerid][pInt] = 3;
			SetPlayerPos(playerid, 330.6825,163.6688,1014.1875);
			SetPlayerFacingAngle(playerid, 280);
			TogglePlayerControllable(playerid, 0);
			RegistrationStep[playerid] = 1;
			ClearChatbox(playerid, 10);
			SendClientMessage(playerid, COLOR_GREEN, "----------------------------------------------------------------");
			SendClientMessage(playerid, COLOR_GREY, "Dobrodosli! Sada cemo vas odvesti u Imigracioni Odsek.");
			SendClientMessage(playerid, COLOR_WHITE, "1. Da li ste musko ili zensko?.");
			SendClientMessage(playerid, COLOR_GREEN, "----------------------------------------------------------------");
			ClearChatbox(playerid, 2);
			return 1;
	    }
Poslednja Izmena: Februar 29, 2012, 23:07:41 POSLE PODNE od ¢fg™'87
[[/center]
DgL <3
Otisao s Foruma zz


Hm,idi ctrl+f i kucaj "musko" i kad' ti izbaci to stavis pod ondialogresponse a samo umesto sendclientmessage-a stavi showplayerdialog...Nista lakse !

SendClientMessage(playerid, COLOR_GREEN, "----------------------------------------------------------------");
         SendClientMessage(playerid, COLOR_GREY, "Dobrodosli! Sada cemo vas odvesti u Imigracioni Odsek.");
         SendClientMessage(playerid, COLOR_WHITE, "1. Da li ste musko ili zensko?.");

ovdje sam ubacio dialog ali kada idem musko nece da prebaci dalje kada ukucam u cetu oce

REFRESH!!!

Poslednja Izmena: Mart 01, 2012, 00:01:17 PRE PODNE od ¢fg™'87
[[/center]
DgL <3
Otisao s Foruma zz


Blaeks

*

Madmen

Ti si tu samo stavio dialog idi namesti pod OnDialogResposne da moze potvriditi da je musko

http://wiki.sa-mp.com/wiki/ShowPlayerDialog
To stavis kod tog dijela gdje ti izbacuje tekst i onda pod OnDialogResponse stavis ako je izabrao musko ili zensko da mu spremi i da nastavi registraciju ..

lol jos samo kad bi to znao uradit.  :-\

znam dialog ali nez sta treba u te resposne xd da bi radilo.

26 erora ccc
Poslednja Izmena: Mart 01, 2012, 00:32:10 PRE PODNE od ¢fg™'87
[[/center]
DgL <3
Otisao s Foruma zz


Umesto ovog:

SendClientMessage(playerid, COLOR_GREEN, "----------------------------------------------------------------");
SendClientMessage(playerid, COLOR_GREY, "Dobrodosli! Sada cemo vas odvesti u Imigracioni Odsek.");
SendClientMessage(playerid, COLOR_WHITE, "1. Da li ste musko ili zensko?.");
SendClientMessage(playerid, COLOR_GREEN, "----------------------------------------------------------------");


Stavis:

ShowPlayerDialog(playerid, DIALOG_SPOL, DIALOG_STYLE_LIST, "Izaberi:", "Musko\nZensko", "U redu", "");


na pocetak scripte dodaj:

#define DIALOG_SPOL 1111 // ovo 1111 promeni u ID dialoga koji ti odgovara :)


pod OnDialogResponse:

if(dialogid == DIALOG_SPOL)
{
	if(response)
	{
		if(listitem == 0)
		{
			PlayerInfo[playerid][pSex] = 1; // Promeni pSex i 1 u ono kako postavlja kad je musko, mislim da je ovako ali ako nije...
			// Ovde dopisi sta dalje radi sa registracijom, da li otvara novi dialog i slicno...
			return 1;
		}
		if(listitem == 1)
		{
			PlayerInfo[playerid][pSex] = 2; // Promeni pSex i 2 u ono kako postavlja kad je zensko, mislim da je ovako ali ako nije...
			// Ovde dopisi sta dalje radi sa registracijom, da li otvara novi dialog i slicno...
			return 1;
		}
	}
	else
	{
		Kick(playerid);
		return 1;
	}
}


Eto to bi trebalo da radi.. dalje skontaj sam :)

jel ovo za to 1

if(RegistrationStep[playerid] > 0)
	{
	    if(RegistrationStep[playerid] == 1)
	    {
	        new idx;
	    	tmp = strtok(text, idx);
		    if((strcmp("musko", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("musko")))
			{
			    PlayerInfo[playerid][pSex] = 1;
			    ClearChatbox(playerid, 8);
			    SendClientMessage(playerid, COLOR_GREEN, "-----------------------------------------------------------------------");
			    SendClientMessage(playerid, COLOR_GREY, "Ok, znaci musko ste.");
			    SendClientMessage(playerid, COLOR_WHITE, "2. Koji je vas datum rodjenja? (Koristite dd/mm/yyyy)");
			    SendClientMessage(playerid, COLOR_GREEN, "-----------------------------------------------------------------------");
			    ClearChatbox(playerid, 2);
			    new maleskin;
			    maleskin = random(sizeof(CivMalePeds));
			    SetPlayerSkin(playerid, maleskin);
			    PlayerInfo[playerid][pChar] = maleskin;
			    RegistrationStep[playerid] = 2;
			    return 0;
			}
[[/center]
DgL <3
Otisao s Foruma zz


Citat: ¢fgâ,,¢'87 poslato Mart 01, 2012, 00:44:14 PRE PODNE
jel ovo za to 1

if(RegistrationStep[playerid] > 0)
	{
	    if(RegistrationStep[playerid] == 1)
	    {
	        new idx;
	    	tmp = strtok(text, idx);
		    if((strcmp("musko", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("musko")))
			{
			    PlayerInfo[playerid][pSex] = 1;
			    ClearChatbox(playerid, 8);
			    SendClientMessage(playerid, COLOR_GREEN, "-----------------------------------------------------------------------");
			    SendClientMessage(playerid, COLOR_GREY, "Ok, znaci musko ste.");
			    SendClientMessage(playerid, COLOR_WHITE, "2. Koji je vas datum rodjenja? (Koristite dd/mm/yyyy)");
			    SendClientMessage(playerid, COLOR_GREEN, "-----------------------------------------------------------------------");
			    ClearChatbox(playerid, 2);
			    new maleskin;
			    maleskin = random(sizeof(CivMalePeds));
			    SetPlayerSkin(playerid, maleskin);
			    PlayerInfo[playerid][pChar] = maleskin;
			    RegistrationStep[playerid] = 2;
			    return 0;
			}


mislim da jeste, ali ako vec radis musko/zensko u dialogu uradi i godine

napravi dialog sa inputom i nek korisnik unese godine :)

ja ubacim sve i krene compile i dontsand  ???
[[/center]
DgL <3
Otisao s Foruma zz


Citat: ¢fgâ,,¢'87 poslato Mart 01, 2012, 00:58:30 PRE PODNE
ja ubacim sve i krene compile i dontsand  ???

if(RegistrationStep[playerid] > 0)
	{
	    if(RegistrationStep[playerid] == 1)
	    {
	        new idx;
	    	tmp = strtok(text, idx);
		    if((strcmp("musko", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("musko")))
			{
			    PlayerInfo[playerid][pSex] = 1;
			    ClearChatbox(playerid, 8);
			    SendClientMessage(playerid, COLOR_GREEN, "-----------------------------------------------------------------------");
			    SendClientMessage(playerid, COLOR_GREY, "Ok, znaci musko ste.");
			    SendClientMessage(playerid, COLOR_WHITE, "2. Koji je vas datum rodjenja? (Koristite dd/mm/yyyy)");
			    SendClientMessage(playerid, COLOR_GREEN, "-----------------------------------------------------------------------");
			    ClearChatbox(playerid, 2);
			    new maleskin;
			    maleskin = random(sizeof(CivMalePeds));
			    SetPlayerSkin(playerid, maleskin);
			    PlayerInfo[playerid][pChar] = maleskin;
			    RegistrationStep[playerid] = 2;
			    return 0;
			}


jesi ubacio to tako? ako jesi ne valja fale ti 2 } zameni to gore sa ovim:

if(RegistrationStep[playerid] > 0)
	{
	    if(RegistrationStep[playerid] == 1)
	    {
	        new idx;
	    	tmp = strtok(text, idx);
		    if((strcmp("musko", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("musko")))
			{
			    PlayerInfo[playerid][pSex] = 1;
			    ClearChatbox(playerid, 8);
			    SendClientMessage(playerid, COLOR_GREEN, "-----------------------------------------------------------------------");
			    SendClientMessage(playerid, COLOR_GREY, "Ok, znaci musko ste.");
			    SendClientMessage(playerid, COLOR_WHITE, "2. Koji je vas datum rodjenja? (Koristite dd/mm/yyyy)");
			    SendClientMessage(playerid, COLOR_GREEN, "-----------------------------------------------------------------------");
			    ClearChatbox(playerid, 2);
			    new maleskin;
			    maleskin = random(sizeof(CivMalePeds));
			    SetPlayerSkin(playerid, maleskin);
			    PlayerInfo[playerid][pChar] = maleskin;
			    RegistrationStep[playerid] = 2;
			    return 0;
			}
		}
		return 1;
	}


EDIT: ali to ti nece tako raditi :/

evo zameni to sa ovim:

ShowPlayerDialog(playerid, DIALOG_GODINE, DIALOG_STYLE_INPUT, "Unesi", "Koliko imate godina:", "U redu", "");


definisi dialog:

#define DIALOG_GODINE 1112 //zameni broj ako hoces..


ondialogresponse

if(dialogid == DIALOG_GODINE)
{
	if(response)
	{
		new godine = strval(inputtext);
		if(godine < 7 || godine > 30)
		{
			ShowPlayerDialog(playerid, DIALOG_GODINE, DIALOG_STYLE_INPUT, "Unesi", "Broj godina moze biti izmedju 7 i 30\nUnesi koliko imas godina:", "U redu", "");
			return 1;
		}
		PlayerInfo[playerid][pAge] = godine;
		//sta se dalje dogadja u registraciji dodaj ovde..
	}
	else
	{
		Kick(playerid);
		return ;
	}
}
Poslednja Izmena: Mart 01, 2012, 01:08:31 PRE PODNE od dock

a jel ja moram to izbrisat gore gdje stoji pa dole kopirat pod ondialogresponse

hvala tebi brate al ja to ne kontam sad nista zbunilo me totalno  :'(
Poslednja Izmena: Mart 01, 2012, 01:09:29 PRE PODNE od ¢fg™'87
[[/center]
DgL <3
Otisao s Foruma zz


to dodaj u nastavku registracije kod responsa za DIALOG_SPOL:

ShowPlayerDialog(playerid, DIALOG_GODINE, DIALOG_STYLE_INPUT, "Unesi", "Koliko imate godina:", "U redu", "");


---------------------------------

Pa onda:::

definisi dialog:

#define DIALOG_GODINE 1112 //zameni broj ako hoces..


ondialogresponse

if(dialogid == DIALOG_GODINE)
{
	if(response)
	{
		new godine = strval(inputtext);
		if(godine < 7 || godine > 30)
		{
			ShowPlayerDialog(playerid, DIALOG_GODINE, DIALOG_STYLE_INPUT, "Unesi", "Broj godina moze biti izmedju 7 i 30\nUnesi koliko imas godina:", "U redu", "");
			return 1;
		}
		PlayerInfo[playerid][pAge] = godine;
		//sta se dalje dogadja u registraciji dodaj ovde..
	}
	else
	{
		Kick(playerid);
		return ;
	}
}


btw koji ti je izvorni mod?

 Sta god ja uradim ono dontsand nez prebacit sta treba jbg.ako imas team wiwer da vidis
[[/center]
DgL <3
Otisao s Foruma zz


Idem sad u krevet jako sam umoran... aj posalji mi ti PM sutra ujutro ako si tu, ili popodne posle 7 cu biti kuci pa cu ti pomoci oko toga.. :)