Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Pawn Scripting [Pawn] How to save player stats in mysql?

 
  • 0 Vote(s) - 0 Average
Pawn How to save player stats in mysql?
CrypticSin
Offline

Burgershot Member
Posts: 24
Threads: 9
Joined: Mar 2021
Reputation: 0
#4
2021-06-19, 02:19 PM
(2021-06-19, 01:09 AM)PutuSuhartawan Wrote: stats with coordinate? https://www.youtube.com/watch?v=KNj2O6c9-uo

The only thing i've done so far is creating a stock for saving user stats. 

I don't know what to do from this point after as it's still not storing the data in mysql (phpmyadmin)

When i run the code, im not getting any errors on but im getting two warning stating: "number of arguments does not match definition"

PHP Code:
stock SaveUserStats(playerid)
{

new 
Float:x,Float:y,Float:z;
GetPlayerPos(playerid,Float:x,Float:y,Float:z);

if(
PlayerInfo[playerid][pLoggedIn] == true)
{
PlayerInfo[playerid][pX] = x;
PlayerInfo[playerid][pY] = y;
PlayerInfo[playerid][pZ] = z;
}

new 
query[256];
  strcat(query, "UPDATE `playerinfo` SET `skin` = '%d', `score` = '%d', `money` = '%d', `murders` = '%d', `zombieskilled` = '%d', `health` = '%d', `armour` = '%d',`deaths` = '%d', `hunger` = '%d', `thirst` = '%d', `pX` = '%i', `pY` = '%i', `pZ` = '%i',  WHERE 'acc_name' = '%e'");
format(query, sizeof(query), query, PlayerInfo[playerid][pSkin],
PlayerInfo[playerid][pScore],
PlayerInfo[playerid][pMoney],
PlayerInfo[playerid][pKills],
PlayerInfo[playerid][pZombiesKilled],
PlayerInfo[playerid][pHealth],
PlayerInfo[playerid][pArmour],
PlayerInfo[playerid][pDeaths],
PlayerInfo[playerid][pHunger],
PlayerInfo[playerid][pX],
PlayerInfo[playerid][pY],
PlayerInfo[playerid][pZ],
GetPlayerName(playerid));
mysql_tquery(handle, query, "", "");
printf("%s", query);
return 
1;
} 
« Next Oldest | Next Newest »



Messages In This Thread
How to save player stats in mysql? - by CrypticSin - 2021-06-16, 10:15 PM
RE: How to save player stats in mysql? - by Kwarde - 2021-06-16, 11:26 PM
RE: How to save player stats in mysql? - by PutuSuhartawan - 2021-06-19, 01:09 AM
RE: How to save player stats in mysql? - by CrypticSin - 2021-06-19, 02:19 PM

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Burgershot - Powered by our Community and MyBB Original Theme by Emerald

Linear Mode
Threaded Mode