Hello I have added this onScriptLoad
hello <- false;
and make this cmd
else if ( ( cmd == "hello" ) || ( cmd == "hello" ) )
{
local plr, b;
for( local i = 0; i < GetMaxPlayers(); i++ )
{
plr = FindPlayer( i );
if ( ( plr ) && ( hello ) )
{
if ( b ) b = b + ", " + plr.Name + " (" + hello + ")"
else b = plr.Name + " (" + hello + ")"
}
}
if ( b ) Message( "**In Game[ Hell Online: [ " + b + " ] ]" );
else Message( "** In Game [ No HEll Online ]." );
}
if ( cmd == "hell")
{
if ( pstats[ player.ID ].Logged == false ) PrivMessage( player, "You are not logged in");
else
{
hello = true;
PrivMessage( player, "Congratulation You Become New Hell Gate");
}
}
Now when i do /hell it show you become and then i type !hell it show name FinchDon but when i restart server and i join type !hell it show no hell online How i can store data for permanent?
(https://s-media-cache-ak0.pinimg.com/736x/d3/e0/a1/d3e0a1221de8cca4601b8885af1b6f39.jpg)
By using query.
Array will get removed as soon as you close the server
SO if u want to store permanently use DataBase aka SQLite or MySQL
Quote from: KAKAN on Sep 17, 2015, 04:17 PMArray will get removed as soon as you close the server
WOW, JUST WOW. Wasn't that obvious until now?
"else if ( ( cmd == "hello" ) || ( cmd == "hello" ) )"
...
hello <- false;
as will identifying which player? ???
I am FuZzie Account system it has update function bank= " + bank + " so how can i update array BFMe and save it in db?
fuzzie's account system updates player stats when player leaves
Quote from: Debian on Sep 18, 2015, 04:33 AMfuzzie's account system updates player stats when player leaves
Everyone who has take a look at the code, knows it, He had not taken a look at the code tho!
i made this
if ( cmd == "a" ) pstats[ player.ID ].BFME += 2;
and this
if ( cmd == "v" ) PrivMessage( player, " " + pstats[ player.ID ].BFME + "." );
Now when i type !a and !v it show BFME 2 and i add this on fuzzie account updater
BFME= " + pstats[ player.ID ].BFME + "
But when i rejoin it show BFME 0 Why?
What u mean LOL?
Show us the whole system, else nothing gonna happen
did you add BMFE in player class?
Yes
Are you sure that your BFME score gets saved into database when you leave the server?
Are you settting your BFME array's score from your database when you join the server?
something like this:
function onPlayerJoin( player )
{
//load here your class
local query = QuerySQL( db, "SELECT BFME FROM Your_Account_Table WHERE Name= '" + player.Name + "'" );
if ( GetSQLColumnData( query, 0 ) )
{
pstats[ player.ID ].BFME = GetSQLColumnData( query, 0 );
}
FreeSQLQuery( query );
}
No Mashreq I Didnt save it in Database i just save them on array pstats array BFME Class When did i do !v it show 2 Bfme coin on my rejoin it show coins 0
Because you are saving it on a database, but not loading it when a player joins, so how to know it'll work or not?
Post your onPlayerJoin, and the save query option along with the playerclass
Quote from: FinchDon on Sep 18, 2015, 09:56 AMNo Mashreq I Didnt save it in Database i just save them on array pstats array BFME Class When did i do !v it show 2 Bfme coin on my rejoin it show coins 0
Tell me, Why do you keep Kills, Deaths, Cash etc for each player in database? Yes, because you want to load it later, the same way you create an array for these to load a class on them the same way as your BFME class, then how do you expect the BMFE class data to get saved without saving it in database?
If even now you didn't get what I mean then don't ask for help again, first try to improve your English so you can understand the solution which people post here for you.
I understand Doom i add Coins in Accounts Table But i increase them by pstats[ player.ID ].BFME += 9999; This Set it but can't Update it How can i? i Mean On My rejoin it Become 0
I use that
QuerySqL( sqluteDb, "UPDATE Accounts Set Coins= " + pstats[ player.ID ].BFME + " WHERE Name= " + player.Name.tolower(); + " ); Something Like this It show no error but also no Change in Coins
Answer to questions which I asked before: Is there a column called BFME in your table which stores accounts.
If yes; are you saving the score when you leave the server?
Yes I save on Leave But its NOt BFME coloumn it is Coins
Have u ever thought about creating a table?
I didn't save anything in database .Quote from: FinchDon on Sep 18, 2015, 09:56 AMI Didnt save it in Database i just save them on array pstats array BFME Class
But , I'm saving them too .Quote from: FinchDon on Sep 18, 2015, 11:00 AMi add Coins in Accounts Table But i increase them by pstats[ player.ID ].BFME += 9999; This Set it but can't Update it How can i? i Mean On My rejoin it Become 0
I use that
QuerySqL( sqluteDb, "UPDATE Accounts Set Coins= " + pstats[ player.ID ].BFME + " WHERE Name= " + player.Name.tolower(); + " ); Something Like this It show no error but also no Change in Coins
Be more clear .
In order to keep something for when you leave, you have to... save it somewhere. Just adding a variable to a class won't let it be saved. You have to edit stuff.
There should be 2 functions you have to edit: The save function, and the load function.
Try to find those 2 functions and add your column to it. You don't have to create another query, just append to the current one. There's no need to make 2 if you can do it in 1.
Maybe SetCoins and GetCoins i will make it
LOL! 1st check the database that you have created the table or not, then check what Thijn, Doom_Killer etc have posted, If u can't understand, then this link may help you:- http://www.learnenglish.de/
Thanks Problem Solve I make SetCoins and GetCoins and its Work Anyway Thanks all
If those functions are doing a query each you might wanna reconsider doing it the easy way...