what'swrong with this?
#1

Hey guys. I'm using a /help dialog.

if (strcmp("/help", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid,13,DIALOG_STYLE_MSGBOX," Help","Wanna continue to the help system?","Yes","No");
return 1;
}

Код:
if(dialogid == 13) {

	if(response == 1) {
	SendClientMessage(playerid, 0x33AA33AA, "/kill");
	
 	}

 	if(response == 0) {
 	SendClientMessage(playerid, 0x33AA33AA, "You canceled. Was it a mistake? /help");
 	return 1;
	 }

 	}
NO errors or something.
But when I do /help the dialog shows up. but when I click on yes nothing happens. THe dialog dissapears but no sendclientmessage to seee

Please help
Reply
#2

try this :
Код:
if(dialogid == 13)
{
if(response == 0)
{
SendClientMessage(playerid, 0x33AA33AA, "You canceled. Was it a mistake? /help");
return 1;
}
if(response == 1)
{
SendClientMessage(playerid, 0x33AA33AA, "/kill");
}
return 1;
}
Reply
#3

Quote:
Originally Posted by [ĦŁ₣
ЉǾǖŦĦЗŁΛẄ ]
I never understand why people put braces at the end of statement lines:

if(something){
somethingelse
} else {
anothersomething
}

to me that looks messy i prefer to do this

if(something)
{
somethingelse
}
else
{
anothersomething
}


ah well up to whoever is scriptin :P

for the dialogs try doing the 0 [false] first then just an else instead if another check, after all it can only be 1 or 0 so

if(response == 0) this();
else that();


Hope that helps
It's to spare script lines, it does look messy but I always do it like this:
pawn Код:
public SomeCallback {
if(ifstatement)
{
//action;
}
return 1;
}
So only a bracket at the end if it's a callback.
Reply
#4

still doesn't work guys
These are all of the scripts things I have.
Maybe someone sees something bads?
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
//=======================================PD INVITE DIALOG==============================//
#pragma tabsize 0








 	if(dialogid == 300) {

	if(response == 1) {
	GameTextForPlayer(playerid,"~B~Welcome to the LSP",5000,5);
 	SetPlayerRank(playerid, 2);
 	SetPlayerColor(playerid,0x2641FEAA);
 	}

 	if(response == 0) {
 	SendClientMessage(playerid, 0x33AA33AA, "You canceled. Was it a mistake? Ask again.");
 	return 1;
	 }
 	}



 	if(dialogid == 301) {

	if(response == 1) {
	GameTextForPlayer(playerid,"~B~Welcome to the Grove Street Families",5000,5);
	SetPlayerRank(playerid, 3);
 	SetPlayerColor(playerid,0x10F441AA);
 	}

 	if(response == 0) {
 	SendClientMessage(playerid, 0x33AA33AA, "You canceled. Was it a mistake? Ask again.");
 	return 1;
	 }
	 
	 
	 
	 if(dialogid == 13)
{
if(response == 0)
SendClientMessage(playerid, 0x33AA33AA, "You canceled. Was it a mistake? Ask again.");
else
SendClientMessage(playerid, 0x33AA33AA, "ewgweg");


return 1;
}

  


 	

 







	if(dialogid == 304) {

	if(response == 1) {
	
	PlayerInfo[playerid][Drugs]++;
 	}

 	if(response == 0) {
 	 }
	PlayerInfo[playerid][Drugs]++;
	return 1;
 	}


 	if(dialogid == 281) {

	if(response == 1) {
	GameTextForPlayer(playerid,"~B~You are a suspect now",5000,5);
	SetPlayerColor(playerid,0xFF8000FF); }

 	if(response == 0) {
 	SendClientMessage(playerid, 0x33AA33AA, "Ah, just evade.");
	SetPlayerColor(playerid,0xFF8000FF);
	return 1; }
 	}


 	if(dialogid == 303) {

	if(response == 1) {
	GameTextForPlayer(playerid,"~B~You have left your gang",5000,5);
	SetPlayerRank(playerid, 0);
	SetPlayerColor(playerid,0xFFFFFFAA);
	}
	 }

 	if(response == 0) {
 	SendClientMessage(playerid, 0x33AA33AA, "/leavefaction again if you made a mistake");
  return 1;
 	}

  }


 return 1;
}
Reply
#5

anyone knows whats wrong with it?
Reply
#6

I'm now having this

Код:
}

	if(strcmp(cmd,"/help", true) == 0)
{

	ShowPlayerDialog(playerid,428,DIALOG_STYLE_MSGBOX,"help","Wanna continue to the help system?","Yes","No");


  return 1;
}
Код:
  if(dialogid == 428)
  
{
    if(response == 0)
    {
    SendClientMessage(playerid, 0x33AA33AA, "Yes");
    }


    else
    {
    SendClientMessage(playerid, 0x33AA33AA, "No");
    }
}
No effect when I click on yes or no
The clientmessage doesnt shows god damiet xD
Reply
#7

Due to your fucked up indentation you missed a closing bracket.

pawn Код:
if(dialogid == 300)
{
  if(response)
  {
    GameTextForPlayer(playerid,"~B~Welcome to the LSP",5000,5);
    SetPlayerRank(playerid, 2);
    SetPlayerColor(playerid,0x2641FEAA);
  }
  else
  {
    SendClientMessage(playerid, 0x33AA33AA, "You canceled. Was it a mistake? Ask again.");
  }
  return 1;
}
else if(dialogid == 301)
{
  if(response)
  {
    GameTextForPlayer(playerid,"~B~Welcome to the Grove Street Families",5000,5);
    SetPlayerRank(playerid, 3);
    SetPlayerColor(playerid,0x10F441AA);
  }
  else
  {
    SendClientMessage(playerid, 0x33AA33AA, "You canceled. Was it a mistake? Ask again.");
  }
  return 1;
} // You forgot this bracket here
else if(dialogid == 13)
{
  if(response)
  {
    SendClientMessage(playerid, 0x33AA33AA, "You canceled. Was it a mistake? Ask again.");
  }
  else
  {
    SendClientMessage(playerid, 0x33AA33AA, "ewgweg");
  }
  return 1;
}
Reply
#8

Quote:
Originally Posted by bartje01
I'm now having this

Код:
}

	if(strcmp(cmd,"/help", true) == 0)
{

	ShowPlayerDialog(playerid,428,DIALOG_STYLE_MSGBOX,"help","Wanna continue to the help system?","Yes","No");


  return 1;
}
Код:
  if(dialogid == 428)
  
{
    if(response == 0)
    {
    SendClientMessage(playerid, 0x33AA33AA, "Yes");
    }


    else
    {
    SendClientMessage(playerid, 0x33AA33AA, "No");
    }
}
No effect when I click on yes or no
The clientmessage doesnt shows god damiet xD
pawn Код:
if(dialogid == 428)  
{
    if(response)
    {
       SendClientMessage(playerid, 0x33AA33AA, "Yes");
    }
    else
    {
       SendClientMessage(playerid, 0x33AA33AA, "No");
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)