SA-MP Forums Archive
Save Query help - 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)
+--- Thread: Save Query help (/showthread.php?tid=396525)



Save Query help - arko123 - 01.12.2012

F:\Personal Project\gamemodes\Arko.pwn(5115) : error 075: input line too long (after substitutions)
F:\Personal Project\gamemodes\Arko.pwn(5116) : error 037: invalid string (possibly non-terminated string)
F:\Personal Project\gamemodes\Arko.pwn(5116) : warning 215: expression has no effect
F:\Personal Project\gamemodes\Arko.pwn(5116) : error 001: expected token: ";", but found "-identifier-"
F:\Personal Project\gamemodes\Arko.pwn(5116) : error 017: undefined symbol "d"
F:\Personal Project\gamemodes\Arko.pwn(5116) : fatal error 107: too many error messages on one line

PHP код:
    format(saveQuerysizeof(saveQuery), "%s, playerPhoneBook = '%d', playerGroup = '%d', playerGroupRank = '%d', playerIP = '%s', playerDropCarTimeout = '%d', playerHotwireTime = '%d', playerRope = '%d', playerVehicleParts = '%d', playerScrewDriver = '%d', playerGasCan = '%d', playerIdentification = '%d',playerAdminDuty = '%d', playerCrimes = '%d', playerArrests = '%d', playerWarrants = '%d', playerAge = '%d', playerCarMod7 = '%d', playerCarMod8 = '%d', playerCarMod9 = '%d', playerCarMod10 = '%d', playerCarMod11 = '%d', playerCarMod12 = '%d'",
        
saveQueryplayerVariables[playerid][pPhoneBook], playerVariables[playerid][pGroup], playerVariables[playerid][pGroupRank], playerVariables[playerid][pConnectionIP], playerVariables[playerid][pDropCarTimeout], playerVariables[playerid][pHotwireTime], playerVariables[playerid][pRope], playerVariables[playerid][pVehicleParts], playerVariables[playerid][pScrewDriver], playerVariables[playerid][pGasCan], playerVariables[playerid][pIdentification], playerVariables[playerid][pAdminDuty],  playerVariables[playerid][pCrimes],
        
playerVariables[playerid][pArrests], playerVariables[playerid][pWarrants], playerVariables[playerid][pAge], playerVariables[playerid][pCarMods][7], playerVariables[playerid][pCarMods][8], playerVariables[playerid][pCarMods][9], playerVariables[playerid][pCarMods][10], playerVariables[playerid][pCarMods][11], playerVariables[playerid][pCarMods][12]); 
Can someone help me?


Re: Save Query help - arko123 - 01.12.2012

bump


Re: Save Query help - Ballu Miaa - 01.12.2012

You were required to make another string and format half variables in it and you were required to attach those two strings using strcat function function which is also known as String concatenation. Here's the code. Have fun scripting.

pawn Код:
new saveQuery2[200];
    format(saveQuery, sizeof(saveQuery), "%s, playerPhoneBook = '%d', playerGroup = '%d', playerGroupRank = '%d', playerIP = '%s', playerDropCarTimeout = '%d', playerHotwireTime = '%d', playerRope = '%d', playerVehicleParts = '%d', playerScrewDriver = '%d', playerGasCan = '%d', playerIdentification = '%d',playerAdminDuty = '%d', playerCrimes = '%d', playerArrests = '%d', playerWarrants = '%d', playerAge = '%d'"
    , saveQuery, playerVariables[playerid][pPhoneBook], playerVariables[playerid][pGroup]
    , playerVariables[playerid][pGroupRank], playerVariables[playerid][pConnectionIP]
    , playerVariables[playerid][pDropCarTimeout], playerVariables[playerid][pHotwireTime]
    , playerVariables[playerid][pRope], playerVariables[playerid][pVehicleParts]
    , playerVariables[playerid][pScrewDriver], playerVariables[playerid][pGasCan]
    , playerVariables[playerid][pIdentification], playerVariables[playerid][pAdminDuty]
    , playerVariables[playerid][pCrimes],playerVariables[playerid][pArrests], playerVariables[playerid][pWarrants]
    , playerVariables[playerid][pAge]);
   
    format(saveQuery2,sizeof(saveQuery2),", playerCarMod7 = '%d', playerCarMod8 = '%d', playerCarMod9 = '%d', playerCarMod10 = '%d', playerCarMod11 = '%d', playerCarMod12 = '%d'"
    , playerVariables[playerid][pCarMods][7], playerVariables[playerid][pCarMods][8]
    , playerVariables[playerid][pCarMods][9], playerVariables[playerid][pCarMods][10]
    , playerVariables[playerid][pCarMods][11], playerVariables[playerid][pCarMods][12]);
    strcat(saveQuery,saveQuery2);



Re: Save Query help - Konstantinos - 01.12.2012

strcat is useless, because we can use "\".
pawn Код:
// --
        format(saveQuery, sizeof(saveQuery), "%s, playerPhoneBook = '%d', playerGroup = '%d', playerGroupRank = '%d', playerIP = '%s', playerDropCarTimeout = '%d', playerHotwireTime = '%d', playerRope = '%d', playerVehicleParts = '%d', playerScrewDriver = '%d', playerGasCan = '%d', playerIdentification = '%d',playerAdminDuty = '%d', \
        playerCrimes = '%d', playerArrests = '%d', playerWarrants = '%d', playerAge = '%d', playerCarMod7 = '%d', playerCarMod8 = '%d', playerCarMod9 = '%d', playerCarMod10 = '%d', playerCarMod11 = '%d', playerCarMod12 = '%d'"
, playerVariables[playerid][pPhoneBook], playerVariables[playerid][pGroup], playerVariables[playerid][pGroupRank],
        playerVariables[playerid][pConnectionIP], playerVariables[playerid][pDropCarTimeout], playerVariables[playerid][pHotwireTime], playerVariables[playerid][pRope], playerVariables[playerid][pVehicleParts], playerVariables[playerid][pScrewDriver], playerVariables[playerid][pGasCan], playerVariables[playerid][pIdentification],
        playerVariables[playerid][pAdminDuty],  playerVariables[playerid][pCrimes], playerVariables[playerid][pArrests], playerVariables[playerid][pWarrants], playerVariables[playerid][pAge], playerVariables[playerid][pCarMods][7], playerVariables[playerid][pCarMods][8], playerVariables[playerid][pCarMods][9], playerVariables[playerid][pCarMods][10],
        playerVariables[playerid][pCarMods][11], playerVariables[playerid][pCarMods][12]);



Re: Save Query help - arko123 - 02.12.2012

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
You were required to make another string and format half variables in it and you were required to attach those two strings using strcat function function which is also known as String concatenation. Here's the code. Have fun scripting.

pawn Код:
new saveQuery2[200];
    format(saveQuery, sizeof(saveQuery), "%s, playerPhoneBook = '%d', playerGroup = '%d', playerGroupRank = '%d', playerIP = '%s', playerDropCarTimeout = '%d', playerHotwireTime = '%d', playerRope = '%d', playerVehicleParts = '%d', playerScrewDriver = '%d', playerGasCan = '%d', playerIdentification = '%d',playerAdminDuty = '%d', playerCrimes = '%d', playerArrests = '%d', playerWarrants = '%d', playerAge = '%d'"
    , saveQuery, playerVariables[playerid][pPhoneBook], playerVariables[playerid][pGroup]
    , playerVariables[playerid][pGroupRank], playerVariables[playerid][pConnectionIP]
    , playerVariables[playerid][pDropCarTimeout], playerVariables[playerid][pHotwireTime]
    , playerVariables[playerid][pRope], playerVariables[playerid][pVehicleParts]
    , playerVariables[playerid][pScrewDriver], playerVariables[playerid][pGasCan]
    , playerVariables[playerid][pIdentification], playerVariables[playerid][pAdminDuty]
    , playerVariables[playerid][pCrimes],playerVariables[playerid][pArrests], playerVariables[playerid][pWarrants]
    , playerVariables[playerid][pAge]);
   
    format(saveQuery2,sizeof(saveQuery2),", playerCarMod7 = '%d', playerCarMod8 = '%d', playerCarMod9 = '%d', playerCarMod10 = '%d', playerCarMod11 = '%d', playerCarMod12 = '%d'"
    , playerVariables[playerid][pCarMods][7], playerVariables[playerid][pCarMods][8]
    , playerVariables[playerid][pCarMods][9], playerVariables[playerid][pCarMods][10]
    , playerVariables[playerid][pCarMods][11], playerVariables[playerid][pCarMods][12]);
    strcat(saveQuery,saveQuery2);
Thank you