SA-MP Forums Archive
6 Errors, Not Sure Why? - 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: 6 Errors, Not Sure Why? (/showthread.php?tid=271278)



[Solved]6 Errors, Not Sure Why? - Dr - 23.07.2011

The Code:
pawn Код:
CMD:stats(playerid, params[])
{
    new string[1000];
    if(IsPlayerConnected(playerid))
    {
        if(gPlayerLogged[playerid] == 1)
        {
            format(string, sizeof(string), " - Admin Level:%i - Money:%i - Bank:%i - AccentID:%i - JobID:%i - \n - FactionID:%i - Faction Rank:%i - License:%i - Cocaine Grams:%i - \n - Marijuana Grams:%i - Donater:%i - Donater Rank: %i - Watch:%i - \n - Phone:%i - Phone Number:%i - Cigars:%i - Lighter:%i - Mask:%i - \n",PlayerInfo[playerid][pAdminLevel],PlayerInfo[playerid][pMoney],PlayerInfo[playerid][pBank],PlayerInfo[playerid][pAccent],PlayerInfo[playerid][pJob],PlayerInfo[playerid][pFaction],PlayerInfo[playerid][pRank],PlayerInfo[playerid][pLicense],PlayerInfo[playerid][pCocaine],PlayerInfo[playerid][pMarijuana],PlayerInfo[playerid][pDonater],PlayerInfo[playerid][pDonaterPoints],PlayerInfo[playerid][pWatch],PlayerInfo[playerid][pPhone],PlayerInfo[playerid][pPhoneNumber],PlayerInfo[playerid][pCigars],PlayerInfo[playerid][pLighter],PlayerInfo[playerid][pMask]);
            ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX, "Player Stats", string, "Close", "");
        }
    }
    return 1;
}
The Error:
pawn Код:
RP.pwn(192) : error 075: input line too long (after substitutions)
RP.pwn(193) : error 017: undefined symbol "playeri"
RP.pwn(194) : warning 217: loose indentation
RP.pwn(194) : error 017: undefined symbol "d"
RP.pwn(194) : error 029: invalid expression, assumed zero
RP.pwn(194) : error 029: invalid expression, assumed zero
RP.pwn(194) : fatal error 107: too many error messages on one line
Line 192:
pawn Код:
if(gPlayerLogged[playerid] == 1)
        { < This is line 192
Line 193:
pawn Код:
format(string, sizeof(string), " - Admin Level:%i - Money:%i - Bank:%i - AccentID:%i - JobID:%i - \n - FactionID:%i - Faction Rank:%i - License:%i - Cocaine Grams:%i - \n - Marijuana Grams:%i - Donater:%i - Donater Rank: %i - Watch:%i - \n - Phone:%i - Phone Number:%i - Cigars:%i - Lighter:%i - Mask:%i - \n",PlayerInfo[playerid][pAdminLevel],PlayerInfo[playerid][pMoney],PlayerInfo[playerid][pBank],PlayerInfo[playerid][pAccent],PlayerInfo[playerid][pJob],PlayerInfo[playerid][pFaction],PlayerInfo[playerid][pRank],PlayerInfo[playerid][pLicense],PlayerInfo[playerid][pCocaine],PlayerInfo[playerid][pMarijuana],PlayerInfo[playerid][pDonater],PlayerInfo[playerid][pDonaterPoints],PlayerInfo[playerid][pWatch],PlayerInfo[playerid][pPhone],PlayerInfo[playerid][pPhoneNumber],PlayerInfo[playerid][pCigars],PlayerInfo[playerid][pLighter],PlayerInfo[playerid][pMask]);
Line 194:
pawn Код:
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX, "Player Stats", string, "Close", "");



Re: 6 Errors, Not Sure Why? - Kush - 23.07.2011

Firstly, before you do anything.

pawn Код:
new string[1000];
That has left me stunned...

SAMP can't generate more that 128 characters input and output. So having a string size of 1000 is uncalled for.

Secondly, you've messed up somewhere (in which I can't seem to find ) with 'playeri' and 'd'. I assume you were attempting to call 'playerid'.


Re: 6 Errors, Not Sure Why? - MoroDan - 23.07.2011

Quote:
Originally Posted by Kush
Посмотреть сообщение
Firstly, before you do anything.

pawn Код:
new string[1000];
That has left me stunned...

SAMP can't generate more that 128 characters input and output. So having a string size of 1000 is uncalled for.

Secondly, you've messed up somewhere (in which I can't seem to find ) with 'playeri' and 'd'. I assume you were attempting to call 'playerid'.
Oh really Kush ? You are wrong in both affirmations. First, SA:MP can generate more than 128 in DIALOG, actually is 1024 or more, I'm not sure.
Secondly, this line is too long
Код:
format(string, sizeof(string), " - Admin Level:%i - Money:%i - Bank:%i - AccentID:%i - JobID:%i - \n - FactionID:%i - Faction Rank:%i - License:%i - Cocaine Grams:%i - \n - Marijuana Grams:%i - Donater:%i - Donater Rank: %i - Watch:%i - \n - Phone:%i - Phone Number:%i - Cigars:%i - Lighter:%i - Mask:%i - \n",PlayerInfo[playerid][pAdminLevel],PlayerInfo[playerid][pMoney],PlayerInfo[playerid][pBank],PlayerInfo[playerid][pAccent],PlayerInfo[playerid][pJob],PlayerInfo[playerid][pFaction],PlayerInfo[playerid][pRank],PlayerInfo[playerid][pLicense],PlayerInfo[playerid][pCocaine],PlayerInfo[playerid][pMarijuana],PlayerInfo[playerid][pDonater],PlayerInfo[playerid][pDonaterPoints],PlayerInfo[playerid][pWatch],PlayerInfo[playerid][pPhone],PlayerInfo[playerid][pPhoneNumber],PlayerInfo[playerid][pCigars],PlayerInfo[playerid][pLighter],PlayerInfo[playerid][pMask]);
.

And this, can simply becomes:
PHP код:
format(stringsizeof(string), " - Admin Level:%i - Money:%i - Bank:%i - AccentID:%i - JobID:%i - \n \
- FactionID:%i - Faction Rank:%i - License:%i - Cocaine Grams:%i - \n - Marijuana Grams:%i - Donater:%i - Donater Rank: %i - Watch:%i - \n \
- Phone:%i - Phone Number:%i - Cigars:%i - Lighter:%i - Mask:%i - \n"
,
PlayerInfo[playerid][pAdminLevel], PlayerInfo[playerid][pMoney], PlayerInfo[playerid][pBank],
PlayerInfo[playerid][pAccent], PlayerInfo[playerid][pJob], PlayerInfo[playerid][pFaction],
PlayerInfo[playerid][pRank], PlayerInfo[playerid][pLicense], PlayerInfo[playerid][pCocaine],
PlayerInfo[playerid][pMarijuana], PlayerInfo[playerid][pDonater], PlayerInfo[playerid][pDonaterPoints],
PlayerInfo[playerid][pWatch], PlayerInfo[playerid][pPhone], PlayerInfo[playerid][pPhoneNumber],
PlayerInfo[playerid][pCigars], PlayerInfo[playerid][pLighter], PlayerInfo[playerid][pMask]); 



Re: 6 Errors, Not Sure Why? - Kush - 23.07.2011

Quote:
Originally Posted by MoroDan
Посмотреть сообщение
Oh really Kush ? You are wrong in both affirmations. First, SA:MP can generate more than 128 in DIALOG, actually is 1024 or more, I'm not sure.
[/php]
Affirmations eh?

Lets see, he's using a 1000 size string, there is no problem with that, having a 1000 size string is perfectly fine.

Secondly, how many characters can SA-MP generate? Sure as a dialog, I'm assuming he's not using dialogs (apparently in his code).

Maybe you should read a little more bud


Re: 6 Errors, Not Sure Why? - MoroDan - 23.07.2011

Quote:
Originally Posted by Kush
Посмотреть сообщение
Affirmations eh?

Lets see, he's using a 1000 size string, there is no problem with that, having a 1000 size string cell is perfectly fine.

Secondly, how many characters can SA-MP generate? Sure as a dialog, I'm assuming he's not using dialogs (apparently in his code).

Maybe you should read a little more bud
He's not using Dialogs !? What the fu** are you talking there !? But what is this:
Код:
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX, "Player Stats", string, "Close", "");



Re: 6 Errors, Not Sure Why? - Kush - 23.07.2011

Quote:
Originally Posted by MoroDan
Посмотреть сообщение
He's not using Dialogs !? What the fu** are you talking there !? But what is this:
Код:
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX, "Player Stats", string, "Close", "");
Ahh, I admit my defeat. Didn't even see the Dialog posted O_o. Apparently, you won this round. Thought he was using it as a return message.

Maybe I should read more.

Goodgame.


Re: 6 Errors, Not Sure Why? - MoroDan - 23.07.2011

Quote:
Originally Posted by ******
Посмотреть сообщение
Actually, you can have up to 144 characters of output now (as I discovered today).
You right ; because of Embedded colors.


Re: 6 Errors, Not Sure Why? - Dr - 24.07.2011

Thank you very much MoroDan, I actually had no idea the length of the line could cause the problem, now I know.


Thanks again,
Dr.