Help with rules
#1

I've wanted to do a command to show a dialog and show the rules but thing is im having some errors and I would like it like the picture, can someone help me in these errors and maybe i can add more words cause it think it has a limit:

my code:


pawn Код:
#include <a_samp>

#define DIALOG_RULES 10
#define DIALOG_HELP 11
#define DIALOG_WWW 12


public OnPlayerCommandText(playerid, cmdtext[])
{
   if(strcmp(cmdtext, "/rules",true) ==0)
   {
        ShowPlayerDialog(playerid, 10, DIALOG_STYLE_MSGBOX, "$^NFG Rules^$", ">>> | Rules | <<<\n-No cheating/mods that gives you more power such as parkour\n-No Bug abusing (includes C-Bug )\n-No insulting other players.Racism and other vulgar remarks will not be tolerated\n-No deathmatching, also includes you cannot revange kill\n-You cannot use the [esc] button to avoid death\n-You cannot bunnyhop using the bike, due to the amount of advantages\n-You cannot scam NFG Points and the limit to scam in-game money is 10000\n-Take a look at /shelp and /pc - For more info about the rules check forums.", "OK", "");
        return 1;
   }
   return 0;
}
Errors:

pawn Код:
\rules.pwn(11) : error 075: input line too long (after substitutions)
\rules.pwn(12) : error 037: invalid string (possibly non-terminated string)
\rules.pwn(12) : error 017: undefined symbol "Rules"
\rules.pwn(12) : error 017: undefined symbol "n"
\rules.pwn(12) : fatal error 107: too many error messages on one line

Picture, i want it maybe as this for an example:
Reply
#2

@123bob123: Go for the 2nd option, it's easier than the other two I guess.

@******: Sorry for being off-topic, but I have sent you a private message, please go through it.
Reply
#3

I've tried the second one and it seems i have errors again:

My code:

pawn Код:
#include <a_samp>

#define DIALOG_RULES 10
#define DIALOG_HELP 11
#define DIALOG_WWW 12

#define COL_WHITE "{FFFFFF}"
#define COL_RED "{F81414}"
#define COL_GREEN "{00FF22}"
#define COL_BLUE 0x1E90FFAA

public OnPlayerCommandText(playerid, cmdtext[])
{
    new pDialog[512];
    strcat(pDialog, "COL_WHITE"Here are some "COL_RED"rules "COL_WHITE"that you should respect:\n", sizeof(pDialog));
    strcat(pDialog, "
COL_GREEN"1. "COL_WHITE"You are not allowed to spam.\n", sizeof(pDialog));
    strcat(pDialog, "COL_GREEN"2. "COL_WHITE"You are not allowed to advertise.\n", sizeof(pDialog));
    strcat(pDialog, "
COL_GREEN"3. "COL_WHITE"You are not allowed to cheat/hack.\n", sizeof(pDialog));
    strcat(pDialog, "COL_GREEN"4. "COL_WHITE"You are not allowed to spawnkill.\n", sizeof(pDialog));
    strcat(pDialog, "
COL_GREEN"5. "COL_WHITE"You are not allowed to insult others.\n", sizeof(pDialog));
    strcat(pDialog, "COL_GREEN"6. "COL_WHITE"You are not allowed to beg for admin.\n", sizeof(pDialog));
    strcat(pDialog, "
COL_WHITE"There are special rules for "COL_GREEN"VIPs"COL_WHITE"! Please check\n", sizeof(pDialog));
    strcat(pDialog, "COL_GREEN"/yaddayaddayadda "COL_WHITE"for more information!", sizeof(pDialog));
    ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "
"COL_BLUE" NFG Rules", pDialog, "OK", "Cancel");
    return 1;
}
errors:

pawn Код:
rules.pwn(15) : error 001: expected token: "-string end-", but found "-identifier-"
rules.pwn(15) : error 017: undefined symbol "Here"
rules.pwn(15) : error 017: undefined symbol "are"
rules.pwn(15) : fatal error 107: too many error messages on one line
Sorry im a bit low in scripting and well im trying to learn and make a small server for me and my friends.
Reply
#4

Quote:
Originally Posted by 123bob123
Посмотреть сообщение
I've tried the second one and it seems i have errors again:

My code:

pawn Код:
#include <a_samp>

#define DIALOG_RULES 10
#define DIALOG_HELP 11
#define DIALOG_WWW 12

#define COL_WHITE "{FFFFFF}"
#define COL_RED "{F81414}"
#define COL_GREEN "{00FF22}"
#define COL_BLUE 0x1E90FFAA

public OnPlayerCommandText(playerid, cmdtext[])
{
    new pDialog[512];
    strcat(pDialog, "COL_WHITE"Here are some "COL_RED"rules "COL_WHITE"that you should respect:\n", sizeof(pDialog));
    strcat(pDialog, "
COL_GREEN"1. "COL_WHITE"You are not allowed to spam.\n", sizeof(pDialog));
    strcat(pDialog, "COL_GREEN"2. "COL_WHITE"You are not allowed to advertise.\n", sizeof(pDialog));
    strcat(pDialog, "
COL_GREEN"3. "COL_WHITE"You are not allowed to cheat/hack.\n", sizeof(pDialog));
    strcat(pDialog, "COL_GREEN"4. "COL_WHITE"You are not allowed to spawnkill.\n", sizeof(pDialog));
    strcat(pDialog, "
COL_GREEN"5. "COL_WHITE"You are not allowed to insult others.\n", sizeof(pDialog));
    strcat(pDialog, "COL_GREEN"6. "COL_WHITE"You are not allowed to beg for admin.\n", sizeof(pDialog));
    strcat(pDialog, "
COL_WHITE"There are special rules for "COL_GREEN"VIPs"COL_WHITE"! Please check\n", sizeof(pDialog));
    strcat(pDialog, "COL_GREEN"/yaddayaddayadda "COL_WHITE"for more information!", sizeof(pDialog));
    ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "
"COL_BLUE" NFG Rules", pDialog, "OK", "Cancel");
    return 1;
}
errors:

pawn Код:
rules.pwn(15) : error 001: expected token: "-string end-", but found "-identifier-"
rules.pwn(15) : error 017: undefined symbol "Here"
rules.pwn(15) : error 017: undefined symbol "are"
rules.pwn(15) : fatal error 107: too many error messages on one line
Sorry im a bit low in scripting and well im trying to learn and make a small server for me and my friends.
I think you messed up dialog it should be:

Код:
#include <a_samp>
#include <zcmd> // Add this

#define DIALOG_RULES 10 // if you have rules dialog why don't you use it?
#define DIALOG_HELP 11
#define DIALOG_WWW 12

#define COL_WHITE   "{FFFFFF}"
#define COL_RED       "{F81414}"
#define COL_GREEN   "{00FF22}"
#define COL_BLUE     "{345ACF}" // You define it wrong

CMD:rules(playerid, params[])
{
    new pDialog[512];
    strcat(pDialog, ""COL_WHITE"Here are some "COL_RED"rules "COL_WHITE"that you should respect:\n");
    strcat(pDialog, ""COL_GREEN"1. "COL_WHITE"You are not allowed to spam.\n");
    strcat(pDialog, ""COL_GREEN"2. "COL_WHITE"You are not allowed to advertise.\n");
    strcat(pDialog, ""COL_GREEN"3. "COL_WHITE"You are not allowed to cheat/hack.\n");
    strcat(pDialog, ""COL_GREEN"4. "COL_WHITE"You are not allowed to spawnkill.\n");
    strcat(pDialog, ""COL_GREEN"5. "COL_WHITE"You are not allowed to insult others.\n");
    strcat(pDialog, ""COL_GREEN"6. "COL_WHITE"You are not allowed to beg for admin.\n");
    strcat(pDialog, ""COL_WHITE"There are special rules for "COL_GREEN"VIPs"COL_WHITE"! Please check\n");
    strcat(pDialog, ""COL_GREEN"/yaddayaddayadda "COL_WHITE"for more information!");
    ShowPlayerDialog(playerid, DIALOG_RULES, DIALOG_STYLE_MSGBOX, ""COL_BLUE" NFG Rules", pDialog, "OK", "Cancel"); // I added after playerid, dialog_rules
    return 1;
}
+rep me if this works. You did some mistakes that I mention up and I solved it for you
You forgot to add >"<"col_blue"
Reply
#5

Change to:
pawn Код:
#define COL_BLUE "{1E90FF}"
because it needs to be defined as string and not as an integer.
Reply
#6

Sturtindia it didn't work:

Errors:


pawn Код:
rules.pwn(16) : error 001: expected token: "-string end-", but found "-identifier-"
rules.pwn(16) : error 017: undefined symbol "Here"
rules.pwn(16) : error 017: undefined symbol "are"
rules.pwn(16) : fatal error 107: too many error messages on one line
Line 16:

pawn Код:
strcat(pDialog, "COL_WHITE"Here are some "COL_RED"rules "COL_WHITE"that you should respect:\n");
Reply
#7

Quote:
Originally Posted by 123bob123
Посмотреть сообщение
Sturtindia it didn't work:

Errors:


pawn Код:
rules.pwn(16) : error 001: expected token: "-string end-", but found "-identifier-"
rules.pwn(16) : error 017: undefined symbol "Here"
rules.pwn(16) : error 017: undefined symbol "are"
rules.pwn(16) : fatal error 107: too many error messages on one line
Line 16:

pawn Код:
strcat(pDialog, "COL_WHITE"Here are some "COL_RED"rules "COL_WHITE"that you should respect:\n");
check my leatest edited post please
Reply
#8

my code looks like this now:

pawn Код:
#include <a_samp>
#include <zcmd> // Add this

#define DIALOG_RULES 10 // if you have rules dialog why don't you use it?
#define DIALOG_HELP 11
#define DIALOG_WWW 12

#define COL_WHITE   "{FFFFFF}"
#define COL_RED       "{F81414}"
#define COL_GREEN   "{00FF22}"
#define COL_BLUE     "{345ACF}" // You define it wrong

CMD:rules(playerid, params[])
{
    new pDialog[512];
    strcat(pDialog, "COL_WHITE"Here are some "COL_RED"rules "COL_WHITE"that you should respect:\n");
    strcat(pDialog, "
COL_GREEN"1. "COL_WHITE"You are not allowed to spam.\n");
    strcat(pDialog, "COL_GREEN"2. "COL_WHITE"You are not allowed to advertise.\n");
    strcat(pDialog, "
COL_GREEN"3. "COL_WHITE"You are not allowed to cheat/hack.\n");
    strcat(pDialog, "COL_GREEN"4. "COL_WHITE"You are not allowed to spawnkill.\n");
    strcat(pDialog, "
COL_GREEN"5. "COL_WHITE"You are not allowed to insult others.\n");
    strcat(pDialog, "COL_GREEN"6. "COL_WHITE"You are not allowed to beg for admin.\n");
    strcat(pDialog, "
COL_WHITE"There are special rules for "COL_GREEN"VIPs"COL_WHITE"! Please check\n");
    strcat(pDialog, "COL_GREEN"/yaddayaddayadda "COL_WHITE"for more information!");
    ShowPlayerDialog(playerid, DIALOG_RULES, DIALOG_STYLE_MSGBOX, "
"COL_BLUE" NFG Rules", pDialog, "OK", "Cancel"); // I added after playerid, dialog_rules
    return 1;
}
errors:

pawn Код:
rules.pwn(16) : error 001: expected token: "-string end-", but found "-identifier-"
rules.pwn(16) : error 017: undefined symbol "Here"
rules.pwn(16) : error 017: undefined symbol "are"
rules.pwn(16) : fatal error 107: too many error messages on one line
Line 16:

pawn Код:
strcat(pDialog, "COL_WHITE"Here are some "COL_RED"rules "COL_WHITE"that you should respect:\n");
Reply
#9

Quote:
Originally Posted by 123bob123
Посмотреть сообщение
my code looks like this now:

pawn Код:
#include <a_samp>
#include <zcmd> // Add this

#define DIALOG_RULES 10 // if you have rules dialog why don't you use it?
#define DIALOG_HELP 11
#define DIALOG_WWW 12

#define COL_WHITE   "{FFFFFF}"
#define COL_RED       "{F81414}"
#define COL_GREEN   "{00FF22}"
#define COL_BLUE     "{345ACF}" // You define it wrong

CMD:rules(playerid, params[])
{
    new pDialog[512];
    strcat(pDialog, "COL_WHITE"Here are some "COL_RED"rules "COL_WHITE"that you should respect:\n");
    strcat(pDialog, "
COL_GREEN"1. "COL_WHITE"You are not allowed to spam.\n");
    strcat(pDialog, "COL_GREEN"2. "COL_WHITE"You are not allowed to advertise.\n");
    strcat(pDialog, "
COL_GREEN"3. "COL_WHITE"You are not allowed to cheat/hack.\n");
    strcat(pDialog, "COL_GREEN"4. "COL_WHITE"You are not allowed to spawnkill.\n");
    strcat(pDialog, "
COL_GREEN"5. "COL_WHITE"You are not allowed to insult others.\n");
    strcat(pDialog, "COL_GREEN"6. "COL_WHITE"You are not allowed to beg for admin.\n");
    strcat(pDialog, "
COL_WHITE"There are special rules for "COL_GREEN"VIPs"COL_WHITE"! Please check\n");
    strcat(pDialog, "COL_GREEN"/yaddayaddayadda "COL_WHITE"for more information!");
    ShowPlayerDialog(playerid, DIALOG_RULES, DIALOG_STYLE_MSGBOX, "
"COL_BLUE" NFG Rules", pDialog, "OK", "Cancel"); // I added after playerid, dialog_rules
    return 1;
}
errors:

pawn Код:
rules.pwn(16) : error 001: expected token: "-string end-", but found "-identifier-"
rules.pwn(16) : error 017: undefined symbol "Here"
rules.pwn(16) : error 017: undefined symbol "are"
rules.pwn(16) : fatal error 107: too many error messages on one line
Line 16:

pawn Код:
strcat(pDialog, "COL_WHITE"Here are some "COL_RED"rules "COL_WHITE"that you should respect:\n");
sorry i was editing because i forgot to add something check the post again that will help.
Reply
#10

Quote:
Originally Posted by ******
Посмотреть сообщение
The syntax colour highlighting alone should show you the problem.
Here you go:
Код:
#include <a_samp>
#include <zcmd> // Add this

#define DIALOG_RULES 10 // if you have rules dialog why don't you use it?
#define DIALOG_HELP 11
#define DIALOG_WWW 12

#define COL_WHITE   "{FFFFFF}"
#define COL_RED       "{F81414}"
#define COL_GREEN   "{00FF22}"
#define COL_BLUE     "{345ACF}" // You define it wrong

CMD:rules(playerid, params[])
{
    new pDialog[512];
    strcat(pDialog, ""COL_WHITE"Here are some "COL_RED"rules "COL_WHITE"that you should respect:\n");
    strcat(pDialog, ""COL_GREEN"1. "COL_WHITE"You are not allowed to spam.\n");
    strcat(pDialog, ""COL_GREEN"2. "COL_WHITE"You are not allowed to advertise.\n");
    strcat(pDialog, ""COL_GREEN"3. "COL_WHITE"You are not allowed to cheat/hack.\n");
    strcat(pDialog, ""COL_GREEN"4. "COL_WHITE"You are not allowed to spawnkill.\n");
    strcat(pDialog, ""COL_GREEN"5. "COL_WHITE"You are not allowed to insult others.\n");
    strcat(pDialog, ""COL_GREEN"6. "COL_WHITE"You are not allowed to beg for admin.\n");
    strcat(pDialog, ""COL_WHITE"There are special rules for "COL_GREEN"VIPs"COL_WHITE"! Please check\n");
    strcat(pDialog, ""COL_GREEN"/yaddayaddayadda "COL_WHITE"for more information!");
    ShowPlayerDialog(playerid, DIALOG_RULES, DIALOG_STYLE_MSGBOX, ""COL_BLUE" NFG Rules", pDialog, "OK", "Cancel"); // I added after playerid, dialog_rules
    return 1;
}
+rep me if this works. You did some mistakes that I mention up and I solved it for you
You forgot to add >"<"col_blue"

If you can't see the post look this.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)