Dialog problem
#1

Hi.
I have a problem with the dialog, when i tape Cancel my server closes. Here is my dialog:

Code:
public OnPlayerCommandText(playerid, cmdtext[])
//----------------------------------[LICENSE]-----------------------------------------------
  if(strcmp(cmd, "/buylicense", true) == 0)
 	{
 	  if(IsPlayerConnected(playerid) && PlayerToPoint(2.0, playerid, 361.8299,173.6302,1008.3828))
    {
 		    TogglePlayerControllable(playerid, 0);
	  	  	ShowPlayerDialog(playerid, LICMENU, DIALOG_STYLE_LIST, "Odaberi Licencu","Voznja $2000\nLetenje $5000\nPlovidba $800\nOruzje $8000", "Kupi", "Cancel");
      	return 1;
   	}
	}
//---------------------------<[ OnDialogResponse ]>--------------------------------------------------------

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
if(dialogid == LICMENU)
	{
 		if(response)
		{
			if(listitem == 0) // Car Liceses
			{
         if (PlayerInfo[playerid][pCarLic] == 0 && GetPlayerMoney(playerid) > 49)
				 {
	        GivePlayerMoney(playerid,-2000);
	        PlayerInfo[playerid][pCarLic] = 1;
	        	SendClientMessage(playerid, COLOR_GREEN, " Kupio si vozacku dozvolu!");
					SendClientMessage(playerid, COLOR_GRAD5, " Mozes provijeriti licence ako upises /licenses !");
					TogglePlayerControllable(playerid, 1);
					return 1;
				 }
				 else
				 {
	        SendClientMessage(playerid, COLOR_LIGHTRED, "Vec imas licencu za voznju, ili nemas dovoljno novaca!");
	        TogglePlayerControllable(playerid, 1);
	       }
			}
			if(listitem == 1) // Flying Licenses
			{
	       if (GetPlayerMoney(playerid) > 4999)
				 {
	        GivePlayerMoney(playerid,-5000);
					PlayerInfo[playerid][pFlyLic] = 1;
					SendClientMessage(playerid, COLOR_GREEN, " Kupio si dozvolu za Letenje!");
	  			SendClientMessage(playerid, COLOR_GRAD5, "Mozes provijeriti licence ako upises /licenses !");
	  			TogglePlayerControllable(playerid, 1);
					return 1;
				 }
				 else
				 {
	        SendClientMessage(playerid, COLOR_LIGHTRED, "Vec imas licencu za voznju, ili nemas dovoljno novaca!");
	        TogglePlayerControllable(playerid, 1);
	       }
			}
			if(listitem == 2) // Sail Licenses
			{
	       if (GetPlayerMoney(playerid) > 799)
				 {
	        GivePlayerMoney(playerid,-800);
					PlayerInfo[playerid][pBoatLic] = 1;
					SendClientMessage(playerid, COLOR_GREEN, " Kupio si dozvolu za brod!");
	  			SendClientMessage(playerid, COLOR_GRAD5, "Mozes provijeriti licence ako upises /licenses !");
	  			TogglePlayerControllable(playerid, 1);
					return 1;
				 }
				 else
				 {
	        SendClientMessage(playerid, COLOR_LIGHTRED, "Vec imas licencu za voznju, ili nemas dovoljno novaca!");
	        TogglePlayerControllable(playerid, 1);
	       }
			}
			if(listitem == 3) // Gun licenses
			{
		    if (GetPlayerMoney(playerid) > 799)
				{
		    GivePlayerMoney(playerid,-8000);
				PlayerInfo[playerid][pGunLic] = 1;
				SendClientMessage(playerid, COLOR_GREEN, " Kupio si dozvolu za oruzje!");
		  	SendClientMessage(playerid, COLOR_GRAD5, "Mozes provijeriti licence ako upises /licenses !");
		  	TogglePlayerControllable(playerid, 1);
				return 1;
				}
				else
				{
		    	SendClientMessage(playerid, COLOR_LIGHTRED, "Vec imas licencu za voznju, ili nemas dovoljno novaca!");
		    	TogglePlayerControllable(playerid, 1);
				}
      }
		}
	}
	return 1;
}
Please help.
Reply
#2

Please Help
Reply
#3

pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp(cmd, "/buylicense", true) == 0)
    {
      if(IsPlayerConnected(playerid) && PlayerToPoint(2.0, playerid, 361.8299,173.6302,1008.3828))
    {
            TogglePlayerControllable(playerid, 0);
            ShowPlayerDialog(playerid, LICMENU, DIALOG_STYLE_LIST, "Odaberi Licencu","Voznja $2000\nLetenje $5000\nPlovidba $800\nOruzje $8000", "Kupi", "Cancel");
        return 1;
    }
    }
    return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  if(dialogid == LICMENU)
    {
        if(response)
        {
            if(listitem == 0) // Car Liceses
            {
         if (PlayerInfo[playerid][pCarLic] == 0 && GetPlayerMoney(playerid) > 49)
                 {
            GivePlayerMoney(playerid,-2000);
            PlayerInfo[playerid][pCarLic] = 1;
                SendClientMessage(playerid, COLOR_GREEN, " Kupio si vozacku dozvolu!");
                    SendClientMessage(playerid, COLOR_GRAD5, " Mozes provijeriti licence ako upises /licenses !");
                    TogglePlayerControllable(playerid, 1);
                    return 1;
                 }
                 else
                 {
            SendClientMessage(playerid, COLOR_LIGHTRED, "Vec imas licencu za voznju, ili nemas dovoljno novaca!");
            TogglePlayerControllable(playerid, 1);
           }
            }
            if(listitem == 1) // Flying Licenses
            {
           if (GetPlayerMoney(playerid) > 4999)
                 {
            GivePlayerMoney(playerid,-5000);
                    PlayerInfo[playerid][pFlyLic] = 1;
                    SendClientMessage(playerid, COLOR_GREEN, " Kupio si dozvolu za Letenje!");
                SendClientMessage(playerid, COLOR_GRAD5, "Mozes provijeriti licence ako upises /licenses !");
                TogglePlayerControllable(playerid, 1);
                    return 1;
                 }
                 else
                 {
            SendClientMessage(playerid, COLOR_LIGHTRED, "Vec imas licencu za voznju, ili nemas dovoljno novaca!");
            TogglePlayerControllable(playerid, 1);
           }
            }
            if(listitem == 2) // Sail Licenses
            {
           if (GetPlayerMoney(playerid) > 799)
                 {
            GivePlayerMoney(playerid,-800);
                    PlayerInfo[playerid][pBoatLic] = 1;
                    SendClientMessage(playerid, COLOR_GREEN, " Kupio si dozvolu za brod!");
                SendClientMessage(playerid, COLOR_GRAD5, "Mozes provijeriti licence ako upises /licenses !");
                TogglePlayerControllable(playerid, 1);
                    return 1;
                 }
                 else
                 {
            SendClientMessage(playerid, COLOR_LIGHTRED, "Vec imas licencu za voznju, ili nemas dovoljno novaca!");
            TogglePlayerControllable(playerid, 1);
           }
            }
            if(listitem == 3) // Gun licenses
            {
            if (GetPlayerMoney(playerid) > 799)
                {
            GivePlayerMoney(playerid,-8000);
                PlayerInfo[playerid][pGunLic] = 1;
                SendClientMessage(playerid, COLOR_GREEN, " Kupio si dozvolu za oruzje!");
            SendClientMessage(playerid, COLOR_GRAD5, "Mozes provijeriti licence ako upises /licenses !");
            TogglePlayerControllable(playerid, 1);
                return 1;
                }
                else
                {
                SendClientMessage(playerid, COLOR_LIGHTRED, "Vec imas licencu za voznju, ili nemas dovoljno novaca!");
                TogglePlayerControllable(playerid, 1);
                }
      }
        }
        return 1;
}
It should work now.. (not tested.)
Reply
#4

Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp(cmd, "/buylicense", true) == 0)
 	{
 	  if(IsPlayerConnected(playerid) && PlayerToPoint(2.0, playerid, 361.8299,173.6302,1008.3828))
    {
 		    TogglePlayerControllable(playerid, 0);
	  	  	ShowPlayerDialog(playerid, LICMENU, DIALOG_STYLE_LIST, "Odaberi Licencu","Voznja $2000\nLetenje $5000\nPlovidba $800\nOruzje $8000", "Kupi", "Cancel");
      	return 1;
   	}
	}
	return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  if(dialogid == LICMENU)
	{
 		if(response)
		{
			if(listitem == 0) // Car Liceses
			{
         if (PlayerInfo[playerid][pCarLic] == 0 && GetPlayerMoney(playerid) > 49)
				 {
	        GivePlayerMoney(playerid,-2000);
	        PlayerInfo[playerid][pCarLic] = 1;
	        	SendClientMessage(playerid, COLOR_GREEN, " Kupio si vozacku dozvolu!");
					SendClientMessage(playerid, COLOR_GRAD5, " Mozes provijeriti licence ako upises /licenses !");
					TogglePlayerControllable(playerid, 1);
					return 1;
				 }
				 else
				 {
	        SendClientMessage(playerid, COLOR_LIGHTRED, "Vec imas licencu za voznju, ili nemas dovoljno novaca!");
	        TogglePlayerControllable(playerid, 1);
	       }
			}
			if(listitem == 1) // Flying Licenses
			{
	       if (GetPlayerMoney(playerid) > 4999)
				 {
	        GivePlayerMoney(playerid,-5000);
					PlayerInfo[playerid][pFlyLic] = 1;
					SendClientMessage(playerid, COLOR_GREEN, " Kupio si dozvolu za Letenje!");
	  			SendClientMessage(playerid, COLOR_GRAD5, "Mozes provijeriti licence ako upises /licenses !");
	  			TogglePlayerControllable(playerid, 1);
					return 1;
				 }
				 else
				 {
	        SendClientMessage(playerid, COLOR_LIGHTRED, "Vec imas licencu za voznju, ili nemas dovoljno novaca!");
	        TogglePlayerControllable(playerid, 1);
	       }
			}
			if(listitem == 2) // Sail Licenses
			{
	       if (GetPlayerMoney(playerid) > 799)
				 {
	        GivePlayerMoney(playerid,-800);
					PlayerInfo[playerid][pBoatLic] = 1;
					SendClientMessage(playerid, COLOR_GREEN, " Kupio si dozvolu za brod!");
	  			SendClientMessage(playerid, COLOR_GRAD5, "Mozes provijeriti licence ako upises /licenses !");
	  			TogglePlayerControllable(playerid, 1);
					return 1;
				 }
				 else
				 {
	        SendClientMessage(playerid, COLOR_LIGHTRED, "Vec imas licencu za voznju, ili nemas dovoljno novaca!");
	        TogglePlayerControllable(playerid, 1);
	       }
			}
			if(listitem == 3) // Gun licenses
			{
		    if (GetPlayerMoney(playerid) > 799)
				{
		    GivePlayerMoney(playerid,-8000);
				PlayerInfo[playerid][pGunLic] = 1;
				SendClientMessage(playerid, COLOR_GREEN, " Kupio si dozvolu za oruzje!");
		  	SendClientMessage(playerid, COLOR_GRAD5, "Mozes provijeriti licence ako upises /licenses !");
		  	TogglePlayerControllable(playerid, 1);
				return 1;
				}

      }
				else
				{
		    	SendClientMessage(playerid, COLOR_LIGHTRED, "Vec imas licencu za voznju, ili nemas dovoljno novaca!");
		    	TogglePlayerControllable(playerid, 1);
				}
		}
		return 1;
}
Fedee made a small mistake. :b
Reply
#5

Uhgg, I was close :E
Reply
#6

Not working :S
Reply
#7

Please help i need this
Reply
#8

Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp(cmd, "/buylicense", true) == 0)
 	{
 	  if(IsPlayerConnected(playerid) && PlayerToPoint(2.0, playerid, 361.8299,173.6302,1008.3828))
    {
 		    TogglePlayerControllable(playerid, 0);
	  	  	ShowPlayerDialog(playerid, LICMENU, DIALOG_STYLE_LIST, "Odaberi Licencu","Voznja $2000\nLetenje $5000\nPlovidba $800\nOruzje $8000", "Kupi", "Cancel");
      	return 1;
   	}
	return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  if(dialogid == LICMENU)
	{
 		if(response)
		{
			if(listitem == 0) // Car Liceses
			{
         if (PlayerInfo[playerid][pCarLic] == 0 && GetPlayerMoney(playerid) > 49)
				 {
	        GivePlayerMoney(playerid,-2000);
	        PlayerInfo[playerid][pCarLic] = 1;
	        	SendClientMessage(playerid, COLOR_GREEN, " Kupio si vozacku dozvolu!");
					SendClientMessage(playerid, COLOR_GRAD5, " Mozes provijeriti licence ako upises /licenses !");
					TogglePlayerControllable(playerid, 1);
					return 1;
				 }
				 else
				 {
	        SendClientMessage(playerid, COLOR_LIGHTRED, "Vec imas licencu za voznju, ili nemas dovoljno novaca!");
	        TogglePlayerControllable(playerid, 1);
	       }
			}
			if(listitem == 1) // Flying Licenses
			{
	       if (GetPlayerMoney(playerid) > 4999)
				 {
	        GivePlayerMoney(playerid,-5000);
					PlayerInfo[playerid][pFlyLic] = 1;
					SendClientMessage(playerid, COLOR_GREEN, " Kupio si dozvolu za Letenje!");
	  			SendClientMessage(playerid, COLOR_GRAD5, "Mozes provijeriti licence ako upises /licenses !");
	  			TogglePlayerControllable(playerid, 1);
					return 1;
				 }
				 else
				 {
	        SendClientMessage(playerid, COLOR_LIGHTRED, "Vec imas licencu za voznju, ili nemas dovoljno novaca!");
	        TogglePlayerControllable(playerid, 1);
	       }
			}
			if(listitem == 2) // Sail Licenses
			{
	       if (GetPlayerMoney(playerid) > 799)
				 {
	        GivePlayerMoney(playerid,-800);
					PlayerInfo[playerid][pBoatLic] = 1;
					SendClientMessage(playerid, COLOR_GREEN, " Kupio si dozvolu za brod!");
	  			SendClientMessage(playerid, COLOR_GRAD5, "Mozes provijeriti licence ako upises /licenses !");
	  			TogglePlayerControllable(playerid, 1);
					return 1;
				 }
				 else
				 {
	        SendClientMessage(playerid, COLOR_LIGHTRED, "Vec imas licencu za voznju, ili nemas dovoljno novaca!");
	        TogglePlayerControllable(playerid, 1);
	       }
			}
			if(listitem == 3) // Gun licenses
			{
		    if (GetPlayerMoney(playerid) > 799)
				{
		    GivePlayerMoney(playerid,-8000);
				PlayerInfo[playerid][pGunLic] = 1;
				SendClientMessage(playerid, COLOR_GREEN, " Kupio si dozvolu za oruzje!");
		  	SendClientMessage(playerid, COLOR_GRAD5, "Mozes provijeriti licence ako upises /licenses !");
		  	TogglePlayerControllable(playerid, 1);
				return 1;
				}

      }
				else
				{
		    	SendClientMessage(playerid, COLOR_LIGHTRED, "Vec imas licencu za voznju, ili nemas dovoljno novaca!");
		    	TogglePlayerControllable(playerid, 1);
				}
		}
		return 1;
}
Reply
#9

When i do this i get 26 errors:

Code:
C:\Documents and Settings\MATOŠ\Desktop\SAMP SERVER\gamemodes\gf.pwn(1534) : error 004: function "SetPlayerToTeamColor" is not implemented
C:\Documents and Settings\MATOŠ\Desktop\SAMP SERVER\gamemodes\gf.pwn(1559) : error 004: function "SetPlayerToTeamColor" is not implemented
C:\Documents and Settings\MATOŠ\Desktop\SAMP SERVER\gamemodes\gf.pwn(1579) : error 004: function "SetPlayerCriminal" is not implemented
C:\Documents and Settings\MATOŠ\Desktop\SAMP SERVER\gamemodes\gf.pwn(1584) : error 004: function "SetPlayerCriminal" is not implemented
C:\Documents and Settings\MATOŠ\Desktop\SAMP SERVER\gamemodes\gf.pwn(1648) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\MATOŠ\Desktop\SAMP SERVER\gamemodes\gf.pwn(1652) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\MATOŠ\Desktop\SAMP SERVER\gamemodes\gf.pwn(1664) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\MATOŠ\Desktop\SAMP SERVER\gamemodes\gf.pwn(1668) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\MATOŠ\Desktop\SAMP SERVER\gamemodes\gf.pwn(1672) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\MATOŠ\Desktop\SAMP SERVER\gamemodes\gf.pwn(1676) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\MATOŠ\Desktop\SAMP SERVER\gamemodes\gf.pwn(1680) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\MATOŠ\Desktop\SAMP SERVER\gamemodes\gf.pwn(1684) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\MATOŠ\Desktop\SAMP SERVER\gamemodes\gf.pwn(1688) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\MATOŠ\Desktop\SAMP SERVER\gamemodes\gf.pwn(1700) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\MATOŠ\Desktop\SAMP SERVER\gamemodes\gf.pwn(1704) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\MATOŠ\Desktop\SAMP SERVER\gamemodes\gf.pwn(1708) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\MATOŠ\Desktop\SAMP SERVER\gamemodes\gf.pwn(1712) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\MATOŠ\Desktop\SAMP SERVER\gamemodes\gf.pwn(1716) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\MATOŠ\Desktop\SAMP SERVER\gamemodes\gf.pwn(1728) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\MATOŠ\Desktop\SAMP SERVER\gamemodes\gf.pwn(1732) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\MATOŠ\Desktop\SAMP SERVER\gamemodes\gf.pwn(1736) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\MATOŠ\Desktop\SAMP SERVER\gamemodes\gf.pwn(1748) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\MATOŠ\Desktop\SAMP SERVER\gamemodes\gf.pwn(1752) : error 004: function "PlayerToPoint" is not implemented
C:\Documents and Settings\MATOŠ\Desktop\SAMP SERVER\gamemodes\gf.pwn(2012) : error 004: function "SendIRCMessage" is not implemented
C:\Documents and Settings\MATOŠ\Desktop\SAMP SERVER\gamemodes\gf.pwn(2034) : error 004: function "SendIRCMessage" is not implemented
C:\Documents and Settings\MATOŠ\Desktop\SAMP SERVER\gamemodes\gf.pwn(2046) : error 004: function "SaveCK" is not implemented

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.
Reply
#10

Playertopoint is a custom function, you havnt defined. use IsPlayerInArea insted.
Reply
#11

i have defined it, i dont know what the problem is

btw. When i put IsPlayerInArea i get these errors:

function "PlayerToPoint" is not implemented

Any ideas
Reply
#12

Quote:
Originally Posted by Matej682
i have defined it, i dont know what the problem is

btw. When i put IsPlayerInArea i get these errors:

function "PlayerToPoint" is not implemented

Any ideas
Why dont you do yourself a favour and read up on some tutorials.. You seem to be Copying + Pasting.
Reply
#13

i cant find any tutorials :S
Reply
#14

Pa register dialog ti je nesto najlakse napraviti i daj vise mi fkt dojadilo pomagat ljudima svi koriste j..... RP skripte

edit translate: register dialog is something most easy to make you just need to know some basic, and i hate when players use RP scripts (modes)
Reply
#15

Quote:
Originally Posted by DarkPower
Pa register dialog ti je nesto najlakse napraviti i daj vise mi fkt dojadilo pomagat ljudima svi koriste j..... RP skripte
Um... This is the English section...
Reply
#16

i translate just for you, happy?
Reply
#17

Quote:
Originally Posted by DarkPower
Pa register dialog ti je nesto najlakse napraviti i daj vise mi fkt dojadilo pomagat ljudima svi koriste j..... RP skripte

edit translate: register dialog is something most easy to make you just need to know some basic, and i hate when players use RP scripts (modes)
What are you talking about, my problem is that when i press exit or close (second button) the server closes.
Reply
#18

Quote:
Originally Posted by Matej682
i have defined it, i dont know what the problem is

btw. When i put IsPlayerInArea i get these errors:

function "PlayerToPoint" is not implemented

Any ideas
Read a bit.. and then come again.
Reply
#19

Ok, to get all those erros, u typed more "{}" that is required.

Exemple: if(example == 1)
{
SendClientMessage(playerid, COLOR_RED, "You have one more brace, remove it.");
}
}

Review your code, when you find the brace that is not in use, remove it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)