10.04.2008, 14:13
[HowTo] Using dudb 2.4 to save money/stats/whatever (0.2#Ready)
10.04.2008, 14:31
I didnt correct they lol I just show you something what was wrong
it should it be
at least the whole code again
and PlayerName(playerid) is that
pawn Код:
(GivePlayerMoney(playerid,dUserINT(PlayerName(playerid)).("money")GetPlayerMoney(playerid));
pawn Код:
GivePlayerMoney(playerid,dUserINT(PlayerName(playerid)).("money"));
pawn Код:
new string[48];
format(string, sizeof(string), "%s Has Joined The Server.", PlayerName(playerid));
SendClientMessageToAll(0xAAAAAAAA, string);
AllowPlayerTeleport( playerid, 1 );
SendClientMessage(playerid, COLOR_SPRINGGREEN, "~<>~<>Welcome To [BJT]Server~<>~<>");
GameTextForPlayer(playerid, "~~by [T_S]whooper~~", 4000, 4);
SendClientMessage(playerid, COLOR_FLBLUE, "~~~Made With Help Of On_Top_Non_Stop~~~");
SendClientMessage(playerid, COLOR_RED, "~~~~PLEASE /REGISTER OR /LOGIN PASSWORD BEFORE SPAWN!!~~~~");
SendClientMessage(playerid, COLOR_LIME, "~~~~Use /help For Commands~~~~");
SendClientMessage(playerid, COLOR_LIME, "~~~~If You See No Objects Or Some Objects, Tele To Somewhere Else, Then Tele Back To Your Place~~~~");
GivePlayerMoney(playerid,dUserINT(PlayerName(playerid)).("money"));
pawn Код:
stock PlayerName(playerid) {
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
return pname; }
10.04.2008, 14:45
Ok now im getting this error
C:\Documents and Settings\Owner.sheldons\Desktop\SWAT_SERVER\gamemo des\whoopers.pwn(1997) : warning 219: local variable "pname1" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Warning.
Line 1997 is:new pname1[MAX_PLAYER_NAME];
and if i left it at PlayerName i get 7 errors saying local variable"PlayerName" shadows...
C:\Documents and Settings\Owner.sheldons\Desktop\SWAT_SERVER\gamemo des\whoopers.pwn(1997) : warning 219: local variable "pname1" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Warning.
Line 1997 is:new pname1[MAX_PLAYER_NAME];
and if i left it at PlayerName i get 7 errors saying local variable"PlayerName" shadows...
10.04.2008, 15:16
Quote:
Originally Posted by pawn-lang.pdf
219 local variable identifier shadows a symbol at a preceding level
A local variable has the same name as a global variable, a function, a function argument, or a local variable at a lower precedence level. This is called “shadowing”, as the new local variable makes the previously defined function or variable inaccessible. Note: if there are also error messages further on in the script about missing variables (with these same names) or brace level problems, it could well be that the shadowing warnings are due to these syntactical and semantical errors. Fix the errors first before looking at the shadowing warnings. |
10.04.2008, 17:17
It doesn't even save not even the file or name itself!
10.04.2008, 17:41
Quote:
Originally Posted by whooper
It doesn't even save not even the file or name itself!
|
10.04.2008, 17:46
It won't let me :S
i tried but i dunno how to.
i tried but i dunno how to.
10.04.2008, 19:33
I love this. I prefer Dini though.
10.04.2008, 20:36
Well i tried dini but it confused me bnut i can try again
11.04.2008, 09:55
Quote:
Originally Posted by whooper
It won't let me :S
i tried but i dunno how to. |
that would be the right I think
pawn Код:
stock udb_Create(nickname[],pwd[])
Quote:
Originally Posted by [SAP
Francis ]
I love this. I prefer Dini though. |
11.04.2008, 19:45
help,
how can i use this to make levels and to set levels like in a admin script
please help :P
how can i use this to make levels and to set levels like in a admin script
please help :P
12.04.2008, 01:01
Dini for the win!!! xD
12.04.2008, 01:16
do i take that as im not getting a answer
12.04.2008, 10:57
pawn Код:
//OnGameModeInit()
if(!dini_Exists("Levels")) dini_Create("Levels");
pawn Код:
//OnPlayerConnect(playerid)
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
if(!dini_Int("Levels",pname)) dini_IntSet("Levels",pname,0);
pawn Код:
//OnPlayerCommandText(playerid,cmdtext[])
new idx;
if(!strcmp("/setlevel",cmdtext,true))
{
new Player = strtok(cmdtext, idx);
if(!strlen(Player)) return SendClientMessage(playerid,COLOR,"/setlevel [playerid] [0-4]");
new PlayerID = strval(Player);
if(!IsPlayerConnected(PlayerID)) return SendClientMessage(playerid,COLOR,"Invalid playerid!");
new Level = strval(strtok(cmdtext, idx));
if((Level < 0) || (Level > 4)) return SendClientMessage(playerid,COLOR,"/setlevel [playerid] [0-4]");
new pname[MAX_PLAYER_NAME];
GetPlayerName(PlayerID,pname,MAX_PLAYER_NAME);
if(dini_Int("Levels",pname) == Level) return SendClientMessage(playerid,COLOR,"The player already have this level");
new string[128];
dini_IntSet("Levels",pname,Level);
format(string,sizeof(string),"%s(%d) got a new Level (%d)",pname,PlayerID,Level);
SendClientMessage(playerid,COLOR,string);
}
13.04.2008, 07:57
thanksS
19.04.2008, 16:01
know someone how to get the string out the output from udb_hash ?
so I can get the password again
so I can get the password again
pawn Код:
stock udb_hash(buf[]) {
new length=strlen(buf);
new s1 = 1;
new s2 = 0;
new n;
for (n=0; n<length; n++)
{
s1 = (s1 + buf[n]) % 65521;
s2 = (s2 + s1) % 65521;
}
return (s2 << 16) + s1;
}
30.04.2008, 18:51
pawn Код:
C:\Documents and Settings\Monik&Vlad\Desktop\SA-MP SERVER\pawno\include\dutils.inc(28) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Monik&Vlad\Desktop\SA-MP SERVER\pawno\include\dutils.inc(132) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Monik&Vlad\Desktop\SA-MP SERVER\pawno\include\dutils.inc(172) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Monik&Vlad\Desktop\SA-MP SERVER\pawno\include\dutils.inc(267) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Monik&Vlad\Desktop\SA-MP SERVER\pawno\include\dutils.inc(324) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Monik&Vlad\Desktop\SA-MP SERVER\pawno\include\dutils.inc(366) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Monik&Vlad\Desktop\SA-MP SERVER\gamemodes\Xtreme.GM.pwn(651) : warning 219: local variable "PlayerName" shadows a variable at a preceding level
C:\Documents and Settings\Monik&Vlad\Desktop\SA-MP SERVER\gamemodes\Xtreme.GM.pwn(855) : error 017: undefined symbol "dcmd_login"
C:\Documents and Settings\Monik&Vlad\Desktop\SA-MP SERVER\gamemodes\Xtreme.GM.pwn(856) : error 017: undefined symbol "dcmd_register"
C:\Documents and Settings\Monik&Vlad\Desktop\SA-MP SERVER\gamemodes\Xtreme.GM.pwn(2217) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Monik&Vlad\Desktop\SA-MP SERVER\gamemodes\Xtreme.GM.pwn(3008) : warning 217: loose indentation
C:\Documents and Settings\Monik&Vlad\Desktop\SA-MP SERVER\gamemodes\Xtreme.GM.pwn(3008) : error 017: undefined symbol "dcmd_login"
C:\Documents and Settings\Monik&Vlad\Desktop\SA-MP SERVER\gamemodes\Xtreme.GM.pwn(3018) : error 017: undefined symbol "params"
C:\Documents and Settings\Monik&Vlad\Desktop\SA-MP SERVER\gamemodes\Xtreme.GM.pwn(3020) : error 017: undefined symbol "params"
C:\Documents and Settings\Monik&Vlad\Desktop\SA-MP SERVER\gamemodes\Xtreme.GM.pwn(3033) : warning 225: unreachable code
C:\Documents and Settings\Monik&Vlad\Desktop\SA-MP SERVER\gamemodes\Xtreme.GM.pwn(3033) : error 017: undefined symbol "dcmd_register"
C:\Documents and Settings\Monik&Vlad\Desktop\SA-MP SERVER\gamemodes\Xtreme.GM.pwn(3043) : error 017: undefined symbol "params"
C:\Documents and Settings\Monik&Vlad\Desktop\SA-MP SERVER\gamemodes\Xtreme.GM.pwn(3046) : error 017: undefined symbol "params"
C:\Documents and Settings\Monik&Vlad\Desktop\SA-MP SERVER\gamemodes\Xtreme.GM.pwn(3051) : warning 225: unreachable code
C:\Documents and Settings\Monik&Vlad\Desktop\SA-MP SERVER\gamemodes\Xtreme.GM.pwn(3051) : warning 217: loose indentation
C:\Documents and Settings\Monik&Vlad\Desktop\SA-MP SERVER\gamemodes\Xtreme.GM.pwn(6985) : warning 217: loose indentation
C:\Documents and Settings\Monik&Vlad\Desktop\SA-MP SERVER\gamemodes\Xtreme.GM.pwn(7013) : warning 217: loose indentation
C:\Documents and Settings\Monik&Vlad\Desktop\SA-MP SERVER\gamemodes\Xtreme.GM.pwn(7261) : warning 219: local variable "PlayerName" shadows a variable at a preceding level
C:\Documents and Settings\Monik&Vlad\Desktop\SA-MP SERVER\gamemodes\Xtreme.GM.pwn(7350) : error 025: function heading differs from prototype
C:\Documents and Settings\Monik&Vlad\Desktop\SA-MP SERVER\gamemodes\Xtreme.GM.pwn(7350) : error 025: function heading differs from prototype
C:\Documents and Settings\Monik&Vlad\Desktop\SA-MP SERVER\gamemodes\Xtreme.GM.pwn(7351) : error 021: symbol already defined: "strtok"
C:\Documents and Settings\Monik&Vlad\Desktop\SA-MP SERVER\gamemodes\Xtreme.GM.pwn(7366) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Monik&Vlad\Desktop\SA-MP SERVER\gamemodes\Xtreme.GM.pwn(7373) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Monik&Vlad\Desktop\SA-MP SERVER\gamemodes\Xtreme.GM.pwn(7377) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
15 Errors.
I did everythini what you sayd in 1st post but i dunno what is the problem
30.04.2008, 19:40
that are much errors and warnings I think some come because you forgot to add
because he say sometimes undefined symbol "params"
pawn Код:
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
01.05.2008, 06:13
Quote:
Originally Posted by Nero_3D
that are much errors and warnings I think some come because you forgot to add
pawn Код:
|
04.05.2008, 20:14
can i put arrays in dudb ?
EX:i wish this:in the dudb file de file say : name[0]=1,name[1]=0
i'm spanish,i don't speak english very well
EX:i wish this:in the dudb file de file say : name[0]=1,name[1]=0
i'm spanish,i don't speak english very well
« Next Oldest | Next Newest »
Users browsing this thread: 15 Guest(s)