SA-MP Forums Archive
problem with book system - 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: problem with book system (/showthread.php?tid=124057)



problem with book system - jasonnw666 - 28.01.2010

.


Re: problem with book system - Moglizorz. - 28.01.2010

Post the errors.



Re: problem with book system - jasonnw666 - 28.01.2010

Код:
#include <a_samp>

#define DIALOGIDPBOOK 1299


public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/pdbook", cmdtext, true, 10) == 0)
	{
		ShowPlayerDialog(playerid, DIALOGIDPBOOK, DIALOG_STYLE_LIST, "Book of LSPD", "select a page","Select", "Cancel");
		return 1;
	}
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == DIALOGIDPBOOK)
	{
		if(response)
		{
			if(listitem == 0) // "Book of LSPD",
			{
			ShowPlayerDialog(playerid, DIALOGIDPBOOK+1, DIALOG_STYLE_LIST, "Select a Page", "None\ \npage1:lessons\npage2:getting on duty \npage3:radio chat/teamchat\npage4:codes\npage5:weapons\npage6:rank\npage7:all others(very important)", "Select", "Cancel");
			}
		}
		return 1;
	}
	if(dialogid == DIALOGIDPBOOK+1) // //page 1
	{
		if(response)
		{
			if(listitem == 0)
			{
			ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Page 1","this book will tell you how to be a good cop,but it doesn't says everything to be a good cop \n thats why we would suggest to ask Peter Petrolli for extras lessons,these are boring but very usefull \n\n good luck cadet","Login","Cancel");
			}
			if(listitem == 1)
			{
			ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Page 2","(very usefull : /cophelp) to go on duty you must first go to the police station \n once you are in,go to the first door and typ '/door' and when u passed it then use '/doorc' to close it again \n then use '/olockers' to open the door of the lockers,once u are at a locker typ '/duty' to go on duty \n for more info about weapons from the locker check 'weapons' page","Login","Cancel");
			}
			if(listitem == 2)
			{
			ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Page 3","the radio chat,the most important chat of being a police\n to use the chat use/r(message)\n remember this chat is always IC(in character)\n so always act like the person you are in the game \n an other important chat is /m (megaphone) to tell people in cars (like in a chase) to stop \n for example : /m PULL OVER!, and the last chat :\n /me,it's the 'roleplaychat' if i say /me eats pizza then it will show 'Peter Petrolli eats pizza.'\n in a different color use that chat for lot's of things that you do","Login","Cancel");
			}
			if(listitem == 3)
			{
			ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Page 4","the codes are very important on the radio chat,u can check the codes with /codes \n without knowing the codes,u won't get far,believe me","Login","Cancel");
			}
			if(listitem == 4)
			{
			ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Page 5","A cop without weapons,never seen that before and that's good too \n without weapons we wouldn't be that strong, u already know that u get weapons by doing /duty \n u can also get weapons by typing /wkit but u need to be a certain rank for every WeaponKIT \n the higher your ran the better your weapons (read page 7 - rank for more info)","Login","Cancel");
			}
			if(listitem == 5)
			{
			ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Page 6","The rank,it's what tells others : i'm your boss and i am a very good cop and got promorted \n the rank is like a level in being a cop,the higher your level,the better your weapons and the more u can do as a cop \n\n ranks : \n 1 cadet \n 2 officer \n 3 luitenant \n 4 seargant \n 5 captain (highest possible) \n 6 chief (Peter Petrolli only) \n\n good luck with ranking up","Login","Cancel");
			}
			if(listitem == 6)
			{
			ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Page 8","this is important for higher ranked persons : higher levels are allowed more check /cophelp if u are ranked up and check the new WKIT","Login","Cancel");
			}
		}
		return 1;
	}
	return 1;
}
Код:
C:\Documents and Settings\xxx\Bureau\34nosur40ok44-48-49\streamRC4 okgf39zzftv170test14test3bis\filterscripts\lspdlivre.pwn(24) : error 027: invalid character constant
C:\Documents and Settings\xxx\Bureau\34nosur40ok44-48-49\streamRC4 okgf39zzftv170test14test3bis\filterscripts\lspdlivre.pwn(24) : error 027: invalid character constant
C:\Documents and Settings\xxx\Bureau\34nosur40ok44-48-49\streamRC4 okgf39zzftv170test14test3bis\filterscripts\lspdlivre.pwn(42) : error 075: input line too long (after substitutions)
C:\Documents and Settings\xxx\Bureau\34nosur40ok44-48-49\streamRC4 okgf39zzftv170test14test3bis\filterscripts\lspdlivre.pwn(43) : error 037: invalid string (possibly non-terminated string)
C:\Documents and Settings\xxx\Bureau\34nosur40ok44-48-49\streamRC4 okgf39zzftv170test14test3bis\filterscripts\lspdlivre.pwn(43) : error 017: undefined symbol "the"
C:\Documents and Settings\xxx\Bureau\34nosur40ok44-48-49\streamRC4 okgf39zzftv170test14test3bis\filterscripts\lspdlivre.pwn(43) : error 017: undefined symbol "radio"
C:\Documents and Settings\xxx\Bureau\34nosur40ok44-48-49\streamRC4 okgf39zzftv170test14test3bis\filterscripts\lspdlivre.pwn(43) : fatal error 107: too many error messages on one line

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


7 Errors.



Re: problem with book system - jasonnw666 - 28.01.2010

bump


Re: problem with book system - LuxurioN™ - 28.01.2010

Try this (Not Tested):

pawn Код:
#include <a_samp>

#define DIALOGIDPBOOK 1299


public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/pdbook", cmdtext, true, 10) == 0)
    {
        ShowPlayerDialog(playerid, DIALOGIDPBOOK, DIALOG_STYLE_LIST, "Book of LSPD", "select a page","Select", "Cancel");
        return 1;
    }
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOGIDPBOOK)
    {
        if(response)
        {
        if(listitem == 0)
        {
            ShowPlayerDialog(playerid, DIALOGIDPBOOK+1, DIALOG_STYLE_LIST, "Select a Page", "None\npage1:lessons\npage2:getting on duty \npage3:radio chat/teamchat\npage4:codes\npage5:weapons\npage6:rank\npage7:all others(very important)", "Select", "Cancel");
        }
        return 1;
        }
    }
    if(dialogid == DIALOGIDPBOOK+1) // //page 1
    {
        if(response)
        {
            if(listitem == 0)
            {
            ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Page 1","this book will tell you how to be a good cop,but it doesn't says everything to be a good cop \n thats why we would suggest to ask Peter Petrolli for extras lessons,these are boring but very usefull \n\n good luck cadet","Login","Cancel");
            }
            if(listitem == 1)
            {
            ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Page 2","(very usefull : /cophelp) to go on duty you must first go to the police station \n once you are in,go to the first door and typ '/door' and when u passed it then use '/doorc' to close it again \n then use '/olockers' to open the door of the lockers,once u are at a locker typ '/duty' to go on duty \n for more info about weapons from the locker check 'weapons' page","Login","Cancel");
            }
            if(listitem == 2)
            {
            ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT, "Page 3",
            "the radio chat,the most important chat of being a police\n to use the chat use: (message)\n remember this chat is always IC(in character)\n so always act like the person you are in the game \n an other important chat is (megaphone) to tell people in cars (like in a chase) to stop \n for example :PULL OVER!, and the last chat :\n /me,it's the 'roleplaychat' if i say /me eats pizza then it will show 'Peter Petrolli eats pizza.'\n in a different color use that chat for lot's of things that you do",
            "Login","Cancel");
            }
            if(listitem == 3)
            {
            ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Page 4","the codes are very important on the radio chat,u can check the codes with /codes \n without knowing the codes,u won't get far,believe me","Login","Cancel");
            }
            if(listitem == 4)
            {
            ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Page 5","A cop without weapons,never seen that before and that's good too \n without weapons we wouldn't be that strong, u already know that u get weapons by doing /duty \n u can also get weapons by typing /wkit but u need to be a certain rank for every WeaponKIT \n the higher your ran the better your weapons (read page 7 - rank for more info)","Login","Cancel");
            }
            if(listitem == 5)
            {
            ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Page 6","The rank,it's what tells others : i'm your boss and i am a very good cop and got promorted \n the rank is like a level in being a cop,the higher your level,the better your weapons and the more u can do as a cop \n\n ranks : \n 1 cadet \n 2 officer \n 3 luitenant \n 4 seargant \n 5 captain (highest possible) \n 6 chief (Peter Petrolli only) \n\n good luck with ranking up","Login","Cancel");
            }
            if(listitem == 6)
            {
            ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Page 8","this is important for higher ranked persons : higher levels are allowed more check /cophelp if u are ranked up and check the new WKIT","Login","Cancel");
            }
        }
        return 1;
    }
    return 0;
}



Re: problem with book system - jasonnw666 - 28.01.2010

thank you
now there is no error but i can't read a page when i select a page the window "dialog " disapear
Код:
#include <a_samp>

#define DIALOGIDPBOOK 9899


public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/pdbook", cmdtext, true, 10) == 0)
	{
		ShowPlayerDialog(playerid, DIALOGIDPBOOK, DIALOG_STYLE_LIST, "LSPD BOOK", "open the book","Select", "Cancel");
		return 1;
	}
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == DIALOGIDPBOOK)
	{
		if(response)
		{
			if(listitem == 0) // "Book of LSPD",
			{
			ShowPlayerDialog(playerid, DIALOGIDPBOOK+1, DIALOG_STYLE_LIST, "menu", "None\npage1:lessons\npage2:getting on duty \npage3:radio chat/teamchat\npage4:codes\npage5:weapons\npage6:rank\npage7:all others(very important)", "Select", "Cancel");
			}
		}
		return 1;
	}
	if(dialogid == DIALOGIDPBOOK+1) // //page 1
	{
		if(response)
		{
			if(listitem == 0)
			{
			ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"page 1","this book will tell you how to be a good cop,but it doesn't says everything to be a good cop \n thats why we would suggest to ask Peter Petrolli for extras lessons,these are boring but very usefull \n\n good luck cadet","author Fabian","Cancel");
			}
			if(listitem == 1)
			{
			ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Page 2","(very usefull : /cophelp) to go on duty you must first go to the police station \n once you are in,go to the first door and typ '/door' and when u passed it then use '/doorc' to close it again \n then use '/olockers' to open the door of the lockers,once u are at a locker typ '/duty' to go on duty \n for more info about weapons from the locker check 'weapons' page","author Fabian","Cancel");
			}
			if(listitem == 2)
			{
			ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Page 3","the radio chat,the most important chat of being a police\n to use the chat use/r(message)","author Fabian","Cancel");
			}
			if(listitem == 3)
			{
			ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Page 4","the codes are very important on the radio chat,u can check the codes with /codes \n without knowing the codes,u won't get far,believe me","author Fabian","Cancel");
			}
			if(listitem == 4)
			{
			ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Page 5","A cop without weapons,never seen that before and that's good too \n without weapons we wouldn't be that strong, u already know that u get weapons by doing /duty \n u can also get weapons by typing /wkit but u need to be a certain rank for every WeaponKIT \n the higher your ran the better your weapons (read page 7 - rank for more info)","author Fabian","Cancel");
			}
			if(listitem == 5)
			{
			ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Page 6","The rank,it's what tells others : i'm your boss and i am a very good cop and got promorted \n the rank is like a level in being a cop,the higher your level,the better your weapons and the more u can do as a cop \n\n ranks : \n 1 cadet \n 2 officer \n 3 luitenant \n 4 seargant \n 5 captain (highest possible) \n 6 chief (Peter Petrolli only) \n\n good luck with ranking up","author Fabian","Cancel");
			}
			if(listitem == 6)
			{
			ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Page 7","this is important for higher ranked persons : higher levels are allowed more check /cophelp if u are ranked up and check the new WKIT","author Fabian","Cancel");
			}
		}
		return 1;
	}
	return 0;
}




















[\code]



Re: problem with book system - LuxurioN™ - 28.01.2010

I believe to you must change dialogs IDs. Because all are identic...

And do not create double post...


Re: problem with book system - jasonnw666 - 28.01.2010

i changed the dialog ids but there is always the same problem..
and even i removed a part of the script
Код:
#include <a_samp>

#define DIALOGIDPBOOK 100


public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/pdbook", cmdtext, true, 10) == 0)
	{
		ShowPlayerDialog(playerid, DIALOGIDPBOOK, DIALOG_STYLE_LIST, "LSPD BOOK", "None\npage1:lessons\npage2:getting on duty \npage3:radio chat/teamchat\npage4:codes\npage5:weapons\npage6:rank\npage7:all others(very important)","Select", "Cancel");
		return 1;
	}
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == DIALOGIDPBOOK)
	{
		if(response)
		{
			if(listitem == 101)
			{
			ShowPlayerDialog(playerid,101,DIALOG_STYLE_INPUT,"page 1","this book will tell you how to be a good cop,but it doesn't says everything to be a good cop \n thats why we would suggest to ask Peter Petrolli for extras lessons,these are boring but very usefull \n\n good luck cadet","author Fabian","Cancel");
			}
			if(listitem == 102)
			{
			ShowPlayerDialog(playerid,102,DIALOG_STYLE_INPUT,"Page 2","(very usefull : /cophelp) to go on duty you must first go to the police station \n once you are in,go to the first door and typ '/door' and when u passed it then use '/doorc' to close it again \n then use '/olockers' to open the door of the lockers,once u are at a locker typ '/duty' to go on duty \n for more info about weapons from the locker check 'weapons' page","author Fabian","Cancel");
			}
			if(listitem == 103)
			{
			ShowPlayerDialog(playerid,103,DIALOG_STYLE_INPUT,"Page 3","the radio chat,the most important chat of being a police\n to use the chat use/r(message)","author Fabian","Cancel");
			}
			if(listitem == 104)
			{
			ShowPlayerDialog(playerid,104,DIALOG_STYLE_INPUT,"Page 4","the codes are very important on the radio chat,u can check the codes with /codes \n without knowing the codes,u won't get far,believe me","author Fabian","Cancel");
			}
			if(listitem == 105)
			{
			ShowPlayerDialog(playerid,105,DIALOG_STYLE_INPUT,"Page 5","A cop without weapons,never seen that before and that's good too \n without weapons we wouldn't be that strong, u already know that u get weapons by doing /duty \n u can also get weapons by typing /wkit but u need to be a certain rank for every WeaponKIT \n the higher your ran the better your weapons (read page 7 - rank for more info)","author Fabian","Cancel");
			}
			if(listitem == 106)
			{
			ShowPlayerDialog(playerid,106,DIALOG_STYLE_INPUT,"Page 6","The rank,it's what tells others : i'm your boss and i am a very good cop and got promorted \n the rank is like a level in being a cop,the higher your level,the better your weapons and the more u can do as a cop \n\n ranks : \n 1 cadet \n 2 officer \n 3 luitenant \n 4 seargant \n 5 captain (highest possible) \n 6 chief (Peter Petrolli only) \n\n good luck with ranking up","author Fabian","Cancel");
			}
			if(listitem == 107)
			{
			ShowPlayerDialog(playerid,107,DIALOG_STYLE_INPUT,"Page 7","this is important for higher ranked persons : higher levels are allowed more check /cophelp if u are ranked up and check the new WKIT","author Fabian","Cancel");
			}
		}
		return 1;
	}
	return 0;
}



Re: problem with book system - jasonnw666 - 29.01.2010

nobody can help me please?