SA-MP Forums Archive
Pawno Error - 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: Pawno Error (/showthread.php?tid=180530)



Pawno Error - Scenario - 01.10.2010

Hello... I am working on some player weapon saving, but I went to compile and I get a PAWNO error on a blank line...? The code in unfinished, but I didn't want to spend even more time on something that won't work correctly.

This is the error:

Код:
C:\Users\Nick Piccoli\Documents\Relentless Gaming\Relentless Trucking\gamemodes\R-Trucking.pwn(1702) : error 075: input line too long (after substitutions)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
This is the code:

pawn Код:
stock SavePlayerWeapons(playerid)
{
    if(PlayerStatistics[playerid][pAuth] == 1)
    {
        GetPlayerWeaponData(playerid, 0, PlayerStatistics[playerid][pWeapon0], PlayerStatistics[playerid][pAmmo0]);
        GetPlayerWeaponData(playerid, 1, PlayerStatistics[playerid][pWeapon1], PlayerStatistics[playerid][pAmmo1]);
        GetPlayerWeaponData(playerid, 2, PlayerStatistics[playerid][pWeapon2], PlayerStatistics[playerid][pAmmo2]);
        GetPlayerWeaponData(playerid, 3, PlayerStatistics[playerid][pWeapon3], PlayerStatistics[playerid][pAmmo3]);
        GetPlayerWeaponData(playerid, 4, PlayerStatistics[playerid][pWeapon4], PlayerStatistics[playerid][pAmmo4]);
        GetPlayerWeaponData(playerid, 5, PlayerStatistics[playerid][pWeapon5], PlayerStatistics[playerid][pAmmo5]);
        GetPlayerWeaponData(playerid, 6, PlayerStatistics[playerid][pWeapon6], PlayerStatistics[playerid][pAmmo6]);
        GetPlayerWeaponData(playerid, 7, PlayerStatistics[playerid][pWeapon7], PlayerStatistics[playerid][pAmmo7]);
        GetPlayerWeaponData(playerid, 8, PlayerStatistics[playerid][pWeapon8], PlayerStatistics[playerid][pAmmo8]);
        GetPlayerWeaponData(playerid, 9, PlayerStatistics[playerid][pWeapon9], PlayerStatistics[playerid][pAmmo9]);
        GetPlayerWeaponData(playerid, 10, PlayerStatistics[playerid][pWeapon10], PlayerStatistics[playerid][pAmmo10]);
        GetPlayerWeaponData(playerid, 11, PlayerStatistics[playerid][pWeapon11], PlayerStatistics[playerid][pAmmo11]);
        GetPlayerWeaponData(playerid, 12, PlayerStatistics[playerid][pWeapon12], PlayerStatistics[playerid][pAmmo12]);
        // Line 1702
        format(Query, sizeof(Query), "UPDATE `Accounts` SET `Weapon0` = '%d', `Weapon1` = '%d', `Weapon2` = '%d', `Weapon3` = '%d', `Weapon4` = '%d', `Weapon5` = '%d', `Weapon6` = '%d' WHERE `UserID` = '%d'", PlayerStatistics[playerid][pWeapon0], PlayerStatistics[playerid][pWeapon1], PlayerStatistics[playerid][pWeapon2], PlayerStatistics[playerid][pWeapon3], PlayerStatistics[playerid][pWeapon4], PlayerStatistics[playerid][pWeapon5], PlayerStatistics[playerid][pWeapon6], PlayerStatistics[playerid][pDatabaseID]);
        mysql_query(Query);
        format(Query, sizeof(Query), "UPDATE `Accounts` SET `Weapon7` = '%d', `Weapon8` = '%d', `Weapon9` = '%d'm, `Weapon10` = '%d', `Weapon11` = '%d', `Weapon12` = '%d' WHERE `UserID` = '%d'", PlayerStatistics[playerid][pWeapon7], PlayerStatistics[playerid][pWeapon8], PlayerStatistics[playerid][pWeapon9], PlayerStatistics[playerid][pWeapon10], PlayerStatistics[playerid][pWeapon11], PlayerStatistics[playerid][pWeapon12], PlayerStatistics[playerid][pDatabaseID]);
        mysql_query(Query);
       
       
    }
    return 1;
}



Re: Pawno Error - willsuckformoney - 01.10.2010

Your format line may be to long.

EDIT: It may just be that your string is to short.


Re: Pawno Error - Scenario - 01.10.2010

Quote:
Originally Posted by willsuckformoney
Посмотреть сообщение
Your format line may be to long.
I began thinking the same thing. I will already be doing 4 different queries, but maybe 2 more won't hurt!


Re: Pawno Error - Calgon - 01.10.2010

Your format contains too much data on 1 line, create a line break somewhere along the lines of where you variables are, like so:

pawn Код:
format(Query, sizeof(Query), "UPDATE `Accounts` SET `Weapon0` = '%d', `Weapon1` = '%d', `Weapon2` = '%d', `Weapon3` = '%d', `Weapon4` = '%d', `Weapon5` = '%d', `Weapon6` = '%d' WHERE `UserID` = '%d'", PlayerStatistics[playerid][pWeapon0], PlayerStatistics[playerid][pWeapon1], PlayerStatistics[playerid][pWeapon2], PlayerStatistics[playerid][pWeapon3],
PlayerStatistics[playerid][pWeapon4], PlayerStatistics[playerid][pWeapon5], PlayerStatistics[playerid][pWeapon6], PlayerStatistics[playerid][pDatabaseID]);



Re: Pawno Error - Scenario - 01.10.2010

Quote:
Originally Posted by Calgon
Посмотреть сообщение
Your format contains too much data on 1 line, create a line break somewhere along the lines of where you variables are, like so:

pawn Код:
format(Query, sizeof(Query), "UPDATE `Accounts` SET `Weapon0` = '%d', `Weapon1` = '%d', `Weapon2` = '%d', `Weapon3` = '%d', `Weapon4` = '%d', `Weapon5` = '%d', `Weapon6` = '%d' WHERE `UserID` = '%d'", PlayerStatistics[playerid][pWeapon0], PlayerStatistics[playerid][pWeapon1], PlayerStatistics[playerid][pWeapon2], PlayerStatistics[playerid][pWeapon3],
PlayerStatistics[playerid][pWeapon4], PlayerStatistics[playerid][pWeapon5], PlayerStatistics[playerid][pWeapon6], PlayerStatistics[playerid][pDatabaseID]);
Instead of saving any weapons for "weapon slot 0", I just removed it. Brass knuckles are banned from my server anyways... Thank's for the response guys and Calgon, I will probably need to remember that one for another time! Thanks again.

Quote:
Originally Posted by FireCat
Посмотреть сообщение
why do you even use sql? -.-
You're joking, right?


Re: Pawno Error - SAW-RL - 01.10.2010

Quote:
Originally Posted by FireCat
Посмотреть сообщение
why do you even use sql? -.-
cause its better.
@ RealCop: Yes, he is.