[HowTo] Using dudb 2.4 to save money/stats/whatever (0.2#Ready)
#41

I used dudb scripts.

if i login with my pass, and i get some money, after that i leave the sever.

and turn off the sever.

did my money saved?


and second question is easy.

can i make dudb scripts like this?

if I input command "/savedata", the userinfo will save.
Reply
#42

using udb_setAccState(PlayerName(playerid),GetPlayerMone y(playerid));

if(strcmp(cmd, "/savedata", true) == 0){
udb_setAccState(PlayerName(playerid),GetPlayerMone y(playerid));
SendClientMessage(playerid, color_whatever, "your data is saved");
return 1;
}

it is very simple code

한국인이시죠? 저 렌입니다 ㄳ
Reply
#43

You could make it easier to read with dcmd ... but its quite simple, isn't it?
Reply
#44

Код:
using udb_setAccState(PlayerName(playerid),GetPlayerMoney(playerid));

 if(strcmp(cmd, "/savedata", true) == 0){
 udb_setAccState(PlayerName(playerid),GetPlayerMoney(playerid));
 SendClientMessage(playerid, color_whatever, "your data is saved");
 return 1;
 }
Thanks Ren.

but I don't know where should i input these scripts.

랜님 저 한국인이에요 ㅎ 정말 감사하다는 ㅜㅜ

can you answer this question?


example : mytest, dutils.dtest, dudb.dtest, login .....
Reply
#45

i wanna know how to save Money+Score+Stat ? not save Money only
Reply
#46

Quote:
Originally Posted by Y_Less
I assume you've read the whole of this topic, yes?
that is save Money only
i want to know how to save Money+Score+Stat
Reply
#47

i actually can not find out the answer of save money+score+stats
can you give me a link , teach me how to make it
It's urgent
i am so sorry for you , i made you angry
but i actually can not find out the answer
Reply
#48

Quote:
Originally Posted by Y_Less
You read all the topic, studied it and understood it in 20 minutes? That's impressive, I couldn't so either you're a better coder than me in which case why can't you do it or you didn't. I'll give you a hint, the answer is on the first page when combined with just the tiniest bit of thinking, which, unfortunately for most of the people who try to code, is required all the time.
i am still can not find out the answer ,
i am a noob , can you details to me?

Reply
#49

Quote:
Originally Posted by Y_Less
http://forum.sa-mp.com/index.php?top...31438#msg31438

Right, there is the post which tells you how to add another piece of information, now read that and use the thing between your ears.
"This is an example how to add a setPostion/getPosition to the dudb!"
i am want to save Money+Score+Stats
sorry i don't understand it
i don't how can i modify


Replace eg
public udb_Create(nickname[],pwd[],acc_state,clantag[])

public udb_Create(nickname[],pwd[],acc_state,clantag[],Score[])??


Reply
#50

Quote:
Originally Posted by Y_Less
Read the method, not the code, that's what I meant by think.
CAN YOU teach me concrete?
i am research it 6 days!
but i can not understand how to make it = ="
Reply
#51

no because if you did it correctly the compiler would be able to find the include, hence you havent put dutils.inc into your pawno/include/

i mean really this is basic, if you can't do this then you should really be considering whether compiling a mode is such a good idea
Reply
#52

Quote:

no because if you did it correctly the compiler would be able to find the include, hence you havent put dutils.inc into your pawno/include/

I should only copy dulits.inc from archive to pawno/include/ or do something else with dulits.inc
Reply
#53

Copy it.
Reply
#54

The same error. What next?
Reply
#55

Quote:
Originally Posted by Neo_plus
The same error. What next?
I dont know how the hell you are still getting errors, when all of the people on this fourm installed dutils.inc they had no problems. Open your include folder thats in your pawno folder and take a screenshot by using alt+print, then open paint, paste the picture and save it, then upload it to either imageshack or photobucket, or whatever you use to upload pictures & movies, then paste the link to the picture here so we can see if you have the dutils.inc file or not.
Hope you can understand what I meant.
Reply
#56

Picture 1
Picture 2
Reply
#57

Picture 1 has nothing wrong with it, nor does picture 2, but then I saw the address bar os picture 2:


I think your problem is that you created a new folder for your gamemode/script, you should just save your script to the gamemodes folder that comes with samp. This is what my address bar looks like when my include folder is open:


You should rename your "SA-MP 01b Zazhigai server" folder to "samp" and then make sure it has the files/folder inside it like the picture on this wiki https://sampwiki.blast.hk/wiki/Image:SA-MP_Wiki_Windows.gif

If you still have problems, then tell me what they are and I will help you get them sorted.

Reply
#58

Quote:
Originally Posted by [NR
Luke ]
Picture 1 has nothing wrong with it, nor does picture 2, but then I saw the address bar os picture 2:


I think your problem is that you created a new folder for your gamemode/script, you should just save your script to the gamemodes folder that comes with samp. This is what my address bar looks like when my include folder is open:


You should rename your "SA-MP 01b Zazhigai server" folder to "samp" and then make sure it has the files/folder inside it like the picture on this wiki https://sampwiki.blast.hk/wiki/Image:SA-MP_Wiki_Windows.gif

If you still have problems, then tell me what they are and I will help you get them sorted.

In a seperate thread I tried to help him, told him everything that he should do, but he isn't reading carefully or just assuming.
Reply
#59

Quote:
Originally Posted by Nitroglycerine
Quote:
Originally Posted by [NR
Luke ]
Picture 1 has nothing wrong with it, nor does picture 2, but then I saw the address bar os picture 2:


I think your problem is that you created a new folder for your gamemode/script, you should just save your script to the gamemodes folder that comes with samp. This is what my address bar looks like when my include folder is open:


You should rename your "SA-MP 01b Zazhigai server" folder to "samp" and then make sure it has the files/folder inside it like the picture on this wiki https://sampwiki.blast.hk/wiki/Image:SA-MP_Wiki_Windows.gif

If you still have problems, then tell me what they are and I will help you get them sorted.

In a seperate thread I tried to help him, told him everything that he should do, but he isn't reading carefully or just assuming.
Yea, I saw that other topic that you tried to help him in, if he still has problems after this help that I have gave him, I think I might do what you did...
Give up!
Reply
#60

1.
Quote:

but he isn't reading carefully

perhaps I'm not understanding you =)
2. I think that it is a bug, I try to install DUDB, but now, when I'm completed file I saw 15 errors.
Now I have got these errors:
Код:
C:\PROGRA~1\CRIMIN~1\GAMEMO~1\src\lvdm.pwn(44) : warning 202: number of arguments does not match definition
C:\PROGRA~1\CRIMIN~1\GAMEMO~1\src\lvdm.pwn(44) : warning 202: number of arguments does not match definition
C:\PROGRA~1\CRIMIN~1\GAMEMO~1\src\lvdm.pwn(64) : error 017: undefined symbol "dUserINT"
C:\PROGRA~1\CRIMIN~1\GAMEMO~1\src\lvdm.pwn(64) : error 029: invalid expression, assumed zero
C:\PROGRA~1\CRIMIN~1\GAMEMO~1\src\lvdm.pwn(64) : error 033: array must be indexed (variable "-unknown-")
C:\PROGRA~1\CRIMIN~1\GAMEMO~1\src\lvdm.pwn(64) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.0.3367			Copyright © 1997-2005, ITB CompuPhase


4 Errors.
But line 44 is:
Код:
if (udb_Create(PlayerName(playerid),params)) return SystemMsg(playerid,"Account successfully created. Login with '/login password' now.");
And line 64 is:
Код:
GivePlayerMoney(playerid,dUserINT(PlayerName(playerid)).("money")-GetPlayerMoney(playerid));
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)