SA-MP Forums Archive
help needed, contine and quit - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: help needed, contine and quit (/showthread.php?tid=130787)



help needed, contine and quit - security - 28.02.2010

I made a messagebox when you join ou can press contine and quit etc. but if i press quit i wont be quited, and i dont read a message how can i solve this problem:
my code
Код:
//-----------------------------------------------------------------------------*

public OnPlayerConnect(playerid)
{
	ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Welcome to our server", "If you need help ask an admin or typ /help. \n ADMINS Are: Security and Snorlex \n \n \n To join press continu, to quit press quit and you will be kicked.", "contine", "quit");
	return 1;
}
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 1)
	{
		if(response)
		{
			SendClientMessage(playerid,0x008000FF, "Enjoy your stay!");
		}
		else
		{
		  SendClientMessage(playerid, 0xFF0000FF, "You selected 'Quit', therefore you got kicked. Goodbye!");
		  Kick(playerid);
		}
		return 1;
	}
	return 0;
}



Re: help needed, contine and quit - aircombat - 28.02.2010

try this as dialogresponse
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 1 && response)
	{
		switch(listitem)
	    {
		case 0:
	    {
			SendClientMessage(playerid,0x008000FF, "Enjoy your stay!");
		}
		case 1:
	    {
		  SendClientMessage(playerid, 0xFF0000FF, "You selected 'Quit', therefore you got kicked. Goodbye!");
		  Kick(playerid);
		}
		return 1;
	}
	return 1;
}
________
Ffm redhead


Re: help needed, contine and quit - security - 28.02.2010

Quote:
Originally Posted by [AC
Etch ]
try this as dialogresponse
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 1 && response)
	{
		switch(listitem)
	    {
		case 0:
	    {
			SendClientMessage(playerid,0x008000FF, "Enjoy your stay!");
		}
		case 1:
	    {
		 SendClientMessage(playerid, 0xFF0000FF, "You selected 'Quit', therefore you got kicked. Goodbye!");
		 Kick(playerid);
		}
		return 1;
	}
	return 0;
}
Gives me error:
Код:
...\wsm.pwn(52) : error 002: only a single statement (or expression) can follow each "case"
...\wsm.pwn(52) : warning 215: expression has no effect
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: help needed, contine and quit - aircombat - 28.02.2010

sorry about that try this :

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 1)
	{
		if(response == 0)
		{
			SendClientMessage(playerid,0x008000FF, "Enjoy your stay!");
		}
		if(response == 1)
		{
		  SendClientMessage(playerid, 0xFF0000FF, "You selected 'Quit', therefore you got kicked. Goodbye!");
		  Kick(playerid);
		}
		return 1;
	}
	return 0;
}
that should work
________
FREE KMART GIFT CARDS


Re: help needed, contine and quit - security - 28.02.2010

Quote:
Originally Posted by [AC
Etch ]
sorry about that try this :

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 1)
	{
		if(response == 0)
		{
			SendClientMessage(playerid,0x008000FF, "Enjoy your stay!");
		}
		if(response == 1)
		{
		  SendClientMessage(playerid, 0xFF0000FF, "You selected 'Quit', therefore you got kicked. Goodbye!");
		  Kick(playerid);
		}
		return 1;
	}
	return 0;
}
that should work
no sorry needed
But this one gives no error etc. but i still dont get the message, even if i press continu. I wont be kicked at quit and i dont see the message.


Re: help needed, contine and quit - Born2die - 28.02.2010

You could also spawn a corrupt object that makes you crash instead of kicking.


Re: help needed, contine and quit - security - 28.02.2010

Quote:
Originally Posted by Born2die
You could also spawn a corrupt object that makes you crash instead of kicking.
no,

But how do i let it work?