25.06.2015, 10:46
Well, I added more in saving system of mysql but it says The line is too long.
Here you can see the code. It says the ling is too long so then i tried something new but got error. So, I wanted to post it here cuz i want get something best from pro scripters. Thanks.
Then i tried this tho it would work but didn't work still got error and i think it's wrong. Do you have any idea?
Here you can see the code. It says the ling is too long so then i tried something new but got error. So, I wanted to post it here cuz i want get something best from pro scripters. Thanks.
PHP Code:
///mysql start
forward OnPlayerSave(playerid);
public OnPlayerSave(playerid)
{
new query[500];
if(IsLoggedIn[playerid] == 1 && playerid != INVALID_PLAYER_ID && !IsPlayerNPC(playerid))
{
mysql_format(MySQLCon, query, sizeof(query), "UPDATE `players` SET `Admin`=%d, `Vip`=%d, `Money`=%d, `Score`=%d, `Deaths`=%d, `Kills`=%d, `HitsCompleted`=%d, `SkinID`=%d, `Robbed`=%d, `RobbedMoney`=%d, `GotRobbed`=%d, `GotRobbedMoney`=%d, `StoreRobbed`=%d, `StoreRobbedMoney`=%d, `FoodPurchased`=%d, `FoodPurchasedMoney`=%d, `WeaponsPurchased`=%d, `WeaponsPurchasedMoney`=%d, `Healed`=%d, `Arrest`=%d, `Busted`=%d, `Crimes`=%d, `WantedLevel`=%d, `Drugs`=%d, `Medical`=%d WHERE `ID`=%d AND `user`='%e'",
pInfo[playerid][pAdmin],
pInfo[playerid][pVip],
GetPlayerMoney(playerid),
GetPlayerScore(playerid),
pInfo[playerid][pDeaths],
pInfo[playerid][pKills],
pInfo[playerid][pHitsCompleted],
GetPlayerSkin(playerid),
pInfo[playerid][pRobbed],
pInfo[playerid][pRobbedMoney],
pInfo[playerid][pGotRobbed],
pInfo[playerid][pGotRobbedMoney],
pInfo[playerid][pStoreRobbed],
pInfo[playerid][pStoreRobbedMoney],
pInfo[playerid][pFoodPurchased],
pInfo[playerid][pFoodPurchasedMoney],
pInfo[playerid][pWeaponsPurchased],
pInfo[playerid][pWeaponsPurchasedMoney],
pInfo[playerid][pHealed],
pInfo[playerid][pArrest],
pInfo[playerid][pBusted],
pInfo[playerid][pCrimes],
pInfo[playerid][pWantedLevel],
pInfo[playerid][pDrugs],
pInfo[playerid][pMedical],
pInfo[playerid][pID],
PlayerName(playerid));
mysql_tquery(MySQLCon, query, "", "");
print(query);
mysql_format(MySQLCon, query, sizeof(query), "UPDATE `players` SET `IsBanned`=%d WHERE `ID`=%d AND user='%e'", pInfo[playerid][pIsBanned], PlayerName(playerid));
mysql_tquery(MySQLCon, query, "", "");
IsLoggedIn[playerid] = 0;
if(pInfo[playerid][pAdmin] >= 1)
{
mysql_format(MySQLCon, query, sizeof(query), "UPDATE `players` SET `AdminName`=%s WHERE `ID`=%d AND `user`='%e'", pInfo[playerid][pAName]);
return true;
}
}
return 1;
}
PHP Code:
5475) : error 075: input line too long (after substitutions)
PHP Code:
forward OnPlayerSave(playerid);
public OnPlayerSave(playerid)
{
new query[500];
if(IsLoggedIn[playerid] == 1 && playerid != INVALID_PLAYER_ID && !IsPlayerNPC(playerid))
{
mysql_format(MySQLCon, query, sizeof(query), "UPDATE `players` SET `Admin`=%d, `Vip`=%d, `Money`=%d, `Score`=%d, `Deaths`=%d, `Kills`=%d, `HitsCompleted`=%d, `SkinID`=%d, `Robbed`=%d, `RobbedMoney`=%d, `GotRobbed`=%d, `GotRobbedMoney`=%d, `StoreRobbed`=%d, `StoreRobbedMoney`=%d, `FoodPurchased`=%d, `FoodPurchasedMoney`=%d, `WeaponsPurchased`=%d, `WeaponsPurchasedMoney`=%d, `Healed`=%d, `Arrest`=%d, `Busted`=%d, `Crimes`=%d, `WantedLevel`=%d, `Drugs`=%d, \
`Medical`=%d WHERE `ID`=%d AND `user`='%e'",
pInfo[playerid][pAdmin],
pInfo[playerid][pVip],
GetPlayerMoney(playerid),
GetPlayerScore(playerid),
pInfo[playerid][pDeaths],
pInfo[playerid][pKills],
pInfo[playerid][pHitsCompleted],
GetPlayerSkin(playerid),
pInfo[playerid][pRobbed],
pInfo[playerid][pRobbedMoney],
pInfo[playerid][pGotRobbed],
pInfo[playerid][pGotRobbedMoney],
pInfo[playerid][pStoreRobbed],
pInfo[playerid][pStoreRobbedMoney],
pInfo[playerid][pFoodPurchased],
pInfo[playerid][pFoodPurchasedMoney],
pInfo[playerid][pWeaponsPurchased],
pInfo[playerid][pWeaponsPurchasedMoney],
pInfo[playerid][pHealed],
pInfo[playerid][pArrest],
pInfo[playerid][pBusted],
pInfo[playerid][pCrimes],
pInfo[playerid][pWantedLevel],
pInfo[playerid][pDrugs],
pInfo[playerid][pMedical],
pInfo[playerid][pID],
PlayerName(playerid));
mysql_tquery(MySQLCon, query, "", "");
print(query);
mysql_format(MySQLCon, query, sizeof(query), "UPDATE `players` SET `IsBanned`=%d WHERE `ID`=%d AND user='%e'", pInfo[playerid][pIsBanned], PlayerName(playerid));
mysql_tquery(MySQLCon, query, "", "");
IsLoggedIn[playerid] = 0;
if(pInfo[playerid][pAdmin] >= 1)
{
mysql_format(MySQLCon, query, sizeof(query), "UPDATE `players` SET `AdminName`=%s WHERE `ID`=%d AND `user`='%e'", pInfo[playerid][pAName]);
return true;
}
}
return 1;
}