ERROR Compile
#1

I am making a /register /login script but i get this compile errors.
Sorry for my bad english language
can somebody help me out?

Compile Error:
----------------------------------------------------------------------------------------------------------------------------------
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(12) : warning 235: public function lacks forward declaration (symbol "SystemMsg")
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(20) : error 017: undefined symbol "dcmd_login"
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(21) : error 001: expected token: ";", but found "if"
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(21) : error 017: undefined symbol "dcmd_register"
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(22) : error 001: expected token: ";", but found "return"
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(27) : warning 217: loose indentation
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(29) : warning 235: public function lacks forward declaration (symbol "PlayerName")
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(32) : error 090: public functions may not return arrays (symbol "PlayerName")
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(37) : warning 225: unreachable code
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(37) : error 017: undefined symbol "dcmd_register"
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(40) : error 079: inconsistent return types (array & non-array)
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(44) : error 079: inconsistent return types (array & non-array)
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(47) : error 017: undefined symbol "params"
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(47) : error 079: inconsistent return types (array & non-array)
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(50) : error 017: undefined symbol "params"
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(50) : error 079: inconsistent return types (array & non-array)
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(51) : error 079: inconsistent return types (array & non-array)
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(56) : warning 225: unreachable code
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(56) : warning 217: loose indentation
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(56) : error 017: undefined symbol "dcmd_login"
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(59) : error 079: inconsistent return types (array & non-array)
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(63) : error 079: inconsistent return types (array & non-array)
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(66) : error 017: undefined symbol "params"
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(66) : error 079: inconsistent return types (array & non-array)
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(6 : error 017: undefined symbol "params"
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(75) : error 017: undefined symbol "udb_getAccState"
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(79) : error 079: inconsistent return types (array & non-array)
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(82) : error 079: inconsistent return types (array & non-array)
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(84) : warning 225: unreachable code
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(84) : error 079: inconsistent return types (array & non-array)
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(86) : warning 225: unreachable code
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(86) : warning 217: loose indentation
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(86) : error 029: invalid expression, assumed zero
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(86) : error 004: function "OnPlayerDisconnect" is not implemented
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(89) : error 017: undefined symbol "udb_setAccState"

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


26 Errors.
--------------------------------------------------------------------------------------------------------------------------------

Script I writed:
--------------------------------------------------------------------------------------------------------------------------------
#include <a_samp>
// for the samp stuff
#include <dutils>
// for the functions dini and dudb need
#include <dudb>
// for the userdatabase, get dudb version 1.2 for this.
#define dcmd(%1,%2,%3) if ((strcmp(%3, "/%1", true, %2+1) == 0)&&(((%3[%2+1]==0)&&(dcmd_%1(playerid,"")))||((%3[%2+1]==32)&&(dcmd_%1(playerid,%3[%2+2]))))) return 1
#define COLOR_SYSTEM 0xEFEFF7AA

new PLAYERLIST_authed[MAX_PLAYERS];
public
SystemMsg(playerid,msg[]) {
if ((IsPlayerConnected(playerid))&&(strlen(msg)>0)) {
SendClientMessage(playerid,COLOR_SYSTEM,msg);
}
return 1;
}

public OnPlayerCommandText(playerid,cmdtext[]) {
dcmd(login,5,cmdtext) // because login has 5 characters
dcmd(register,8,cmdtext) // because register has 8 characters
return false;
}

public OnPlayerConnect(playerid) {
PLAYERLIST_authed[playerid]=false;
return false;
}
public PlayerName(playerid) {
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
return name;
/*
* /register password
*
*/
dcmd_register(playerid,params[]) {

// The command shouldn't work if we already are authed
if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"Already authed.");

// The command shouldn't work if an account with this
// nick already exists
if (udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Account already exists, please use '/login password'.");

// Did he forgot the password?
if (strlen(params)==0) return SystemMsg(playerid,"Correct usage: '/register password'");

// We save the money to the accstate
if (udb_Create(PlayerName(playerid),params,GetPlayerM oney(playerid),"")) return SystemMsg(playerid,"Account successfully created. Login with '/login password' now.");
return true;
/*
* /login password
*
*/
dcmd_login(playerid,params[]) {

// The command shouldn't work if we already are authed
if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"Already authed.");

// The command shouldn't work if an account with this
// nick does not exists
if (!udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Account doesn't exist, please use '/register password'.");

// Did he forgot the password?
if (strlen(params)==0) return SystemMsg(playerid,"Correct usage: '/login password'");

if (udb_CheckLogin(PlayerName(playerid),params)) {
// Login was correct

// Since we are using the "accstate"-variable to save and
// read the money of the player, we can update his money now.

// Following thing is the same like the missing SetPlayerCommand
GivePlayerMoney(playerid,udb_getAccState(PlayerNam e(playerid))-GetPlayerMoney(playerid));

PLAYERLIST_authed[playerid]=true;

return SystemMsg(playerid,"Successfully authed!");
} else {
// Login was incorrect
return SystemMsg(playerid,"Login failed!");
}
return true;
}
public OnPlayerDisconnect(playerid) {
if (PLAYERLIST_authed[playerid]) {
// Was loggedin, so save the data!
udb_setAccState(PlayerName(playerid),GetPlayerMone y(playerid));
}
return false;
-----------------------------------------------------------------------------------------
Reply
#2

You're missing an ending bracket at PlayerName function.
Reply
#3

Now I Get This, thanks for helping but its not over yet

Compile errors
-----------------------------------------------------------------------------------------------------------------
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(12) : warning 235: public function lacks forward declaration (symbol "SystemMsg")
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(20) : error 017: undefined symbol "dcmd_login"
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(21) : error 001: expected token: ";", but found "if"
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(22) : error 001: expected token: ";", but found "return"
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(27) : warning 217: loose indentation
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(29) : warning 235: public function lacks forward declaration (symbol "PlayerName")
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(32) : error 090: public functions may not return arrays (symbol "PlayerName")
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(51) : warning 202: number of arguments does not match definition
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(51) : warning 202: number of arguments does not match definition
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(57) : warning 225: unreachable code
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(57) : warning 217: loose indentation
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(57) : error 017: undefined symbol "dcmd_login"
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(76) : error 017: undefined symbol "udb_getAccState"
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(85) : warning 225: unreachable code
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(87) : warning 225: unreachable code
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(87) : warning 217: loose indentation
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(87) : error 029: invalid expression, assumed zero
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(87) : error 004: function "OnPlayerDisconnect" is not implemented
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(90) : error 017: undefined symbol "udb_setAccState"
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(94) : error 030: compound statement not closed at the end of file (started at line 41)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


10 Errors.

---------------------------------------------------------------------------------------------------------------------------

Writed scripts:
--------------------------------------------------------------------------------------------------------------------------
#include <a_samp>
// for the samp stuff
#include <dutils>
// for the functions dini and dudb need
#include <dudb>
// for the userdatabase, get dudb version 1.2 for this.
#define dcmd(%1,%2,%3) if ((strcmp(%3, "/%1", true, %2+1) == 0)&&(((%3[%2+1]==0)&&(dcmd_%1(playerid,"")))||((%3[%2+1]==32)&&(dcmd_%1(playerid,%3[%2+2]))))) return 1
#define COLOR_SYSTEM 0xEFEFF7AA

new PLAYERLIST_authed[MAX_PLAYERS];
public
SystemMsg(playerid,msg[]) {
if ((IsPlayerConnected(playerid))&&(strlen(msg)>0)) {
SendClientMessage(playerid,COLOR_SYSTEM,msg);
}
return 1;
}

public OnPlayerCommandText(playerid,cmdtext[]) {
dcmd(login,5,cmdtext) // because login has 5 characters
dcmd(register,8,cmdtext) // because register has 8 characters
return false;
}

public OnPlayerConnect(playerid) {
PLAYERLIST_authed[playerid]=false;
return false;
}
public PlayerName(playerid) {
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
return name;
}
/*
* /register password
*
*/
dcmd_register(playerid,params[]) {

// The command shouldn't work if we already are authed
if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"Already authed.");

// The command shouldn't work if an account with this
// nick already exists
if (udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Account already exists, please use '/login password'.");

// Did he forgot the password?
if (strlen(params)==0) return SystemMsg(playerid,"Correct usage: '/register password'");

// We save the money to the accstate
if (udb_Create(PlayerName(playerid),params,GetPlayerM oney(playerid),"")) return SystemMsg(playerid,"Account successfully created. Login with '/login password' now.");
return true;
/*
* /login password
*
*/
dcmd_login(playerid,params[]) {

// The command shouldn't work if we already are authed
if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"Already authed.");

// The command shouldn't work if an account with this
// nick does not exists
if (!udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Account doesn't exist, please use '/register password'.");

// Did he forgot the password?
if (strlen(params)==0) return SystemMsg(playerid,"Correct usage: '/login password'");

if (udb_CheckLogin(PlayerName(playerid),params)) {
// Login was correct

// Since we are using the "accstate"-variable to save and
// read the money of the player, we can update his money now.

// Following thing is the same like the missing SetPlayerCommand
GivePlayerMoney(playerid,udb_getAccState(PlayerNam e(playerid))-GetPlayerMoney(playerid));

PLAYERLIST_authed[playerid]=true;

return SystemMsg(playerid,"Successfully authed!");
} else {
// Login was incorrect
return SystemMsg(playerid,"Login failed!");
}
return true;
}
public OnPlayerDisconnect(playerid) {
if (PLAYERLIST_authed[playerid]) {
// Was loggedin, so save the data!
udb_setAccState(PlayerName(playerid),GetPlayerMone y(playerid));
}
return false;
}
---------------------------------------------------------------------------------------------------------------------------
Reply
#4

You're also missing an ending bracket at dcmd_register.
Reply
#5

thanks man , but its not over yet Look

compile error:
---------------------------------------------------------------------------------------------------------------------------
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(12) : warning 235: public function lacks forward declaration (symbol "SystemMsg")
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(21) : error 001: expected token: ";", but found "if"
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(22) : error 001: expected token: ";", but found "return"
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(27) : warning 217: loose indentation
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(29) : warning 235: public function lacks forward declaration (symbol "PlayerName")
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(32) : error 090: public functions may not return arrays (symbol "PlayerName")
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(51) : warning 202: number of arguments does not match definition
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(51) : warning 202: number of arguments does not match definition
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(77) : error 017: undefined symbol "udb_getAccState"
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(86) : warning 225: unreachable code
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(91) : error 017: undefined symbol "udb_setAccState"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.

---------------------------------------------------------------------------------------------------------------------------

Writed Scripts:
---------------------------------------------------------------------------------------------------------------------------
#include <a_samp>
// for the samp stuff
#include <dutils>
// for the functions dini and dudb need
#include <dudb>
// for the userdatabase, get dudb version 1.2 for this.
#define dcmd(%1,%2,%3) if ((strcmp(%3, "/%1", true, %2+1) == 0)&&(((%3[%2+1]==0)&&(dcmd_%1(playerid,"")))||((%3[%2+1]==32)&&(dcmd_%1(playerid,%3[%2+2]))))) return 1
#define COLOR_SYSTEM 0xEFEFF7AA

new PLAYERLIST_authed[MAX_PLAYERS];
public
SystemMsg(playerid,msg[]) {
if ((IsPlayerConnected(playerid))&&(strlen(msg)>0)) {
SendClientMessage(playerid,COLOR_SYSTEM,msg);
}
return 1;
}

public OnPlayerCommandText(playerid,cmdtext[]) {
dcmd(login,5,cmdtext) // because login has 5 characters
dcmd(register,8,cmdtext) // because register has 8 characters
return false;
}

public OnPlayerConnect(playerid) {
PLAYERLIST_authed[playerid]=false;
return false;
}
public PlayerName(playerid) {
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
return name;
}
/*
* /register password
*
*/
dcmd_register(playerid,params[]) {

// The command shouldn't work if we already are authed
if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"Already authed.");

// The command shouldn't work if an account with this
// nick already exists
if (udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Account already exists, please use '/login password'.");

// Did he forgot the password?
if (strlen(params)==0) return SystemMsg(playerid,"Correct usage: '/register password'");

// We save the money to the accstate
if (udb_Create(PlayerName(playerid),params,GetPlayerM oney(playerid),"")) return SystemMsg(playerid,"Account successfully created. Login with '/login password' now.");
return true;
}
/*
* /login password
*
*/
dcmd_login(playerid,params[]) {

// The command shouldn't work if we already are authed
if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"Already authed.");

// The command shouldn't work if an account with this
// nick does not exists
if (!udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Account doesn't exist, please use '/register password'.");

// Did he forgot the password?
if (strlen(params)==0) return SystemMsg(playerid,"Correct usage: '/login password'");

if (udb_CheckLogin(PlayerName(playerid),params)) {
// Login was correct

// Since we are using the "accstate"-variable to save and
// read the money of the player, we can update his money now.

// Following thing is the same like the missing SetPlayerCommand
GivePlayerMoney(playerid,udb_getAccState(PlayerNam e(playerid))-GetPlayerMoney(playerid));

PLAYERLIST_authed[playerid]=true;

return SystemMsg(playerid,"Successfully authed!");
} else {
// Login was incorrect
return SystemMsg(playerid,"Login failed!");
}
return true;
}
public OnPlayerDisconnect(playerid) {
if (PLAYERLIST_authed[playerid]) {
// Was loggedin, so save the data!
udb_setAccState(PlayerName(playerid),GetPlayerMone y(playerid));
}
return false;
}
---------------------------------------------------------------------------------------------------------------------------
Reply
#6

Change:
pawn Код:
dcmd(login, 5, cmdtext)
dcmd(register, 8, cmdtext)
to:
pawn Код:
dcmd(login, 5, cmdtext);
dcmd(register, 8, cmdtext);
And:
pawn Код:
public PlayerName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
return name;
}
to:
pawn Код:
stock PlayerName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
return name;
}
And about udb_setAccState and udb_getAccState:
Change udb_setAccState to udb_UserSetInt and udb_getAccState to udb_UserInt.
Reply
#7

Everybody Its Almost Done only. there are a couple of errors

Compile Error
----------------------------------------------------------------------------------------------------------
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(12) : warning 235: public function lacks forward declaration (symbol "SystemMsg")
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(27) : warning 217: loose indentation
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(51) : warning 202: number of arguments does not match definition
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(51) : warning 202: number of arguments does not match definition
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(77) : warning 202: number of arguments does not match definition
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(86) : warning 225: unreachable code
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(91) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
---------------------------------------------------------------------------------------------------------------

Writed Scripts:
---------------------------------------------------------------------------------------------------------------
#include <a_samp>
// for the samp stuff
#include <dutils>
// for the functions dini and dudb need
#include <dudb>
// for the userdatabase, get dudb version 1.2 for this.
#define dcmd(%1,%2,%3) if ((strcmp(%3, "/%1", true, %2+1) == 0)&&(((%3[%2+1]==0)&&(dcmd_%1(playerid,"")))||((%3[%2+1]==32)&&(dcmd_%1(playerid,%3[%2+2]))))) return 1
#define COLOR_SYSTEM 0xEFEFF7AA

new PLAYERLIST_authed[MAX_PLAYERS];
public
SystemMsg(playerid,msg[]) {
if ((IsPlayerConnected(playerid))&&(strlen(msg)>0)) {
SendClientMessage(playerid,COLOR_SYSTEM,msg);
}
return 1;
}

public OnPlayerCommandText(playerid,cmdtext[]) {
dcmd(login ,5, cmdtext); // because login has 5 characters
dcmd(register ,8, cmdtext); // because register has 8 characters
return false;
}

public OnPlayerConnect(playerid) {
PLAYERLIST_authed[playerid]=false;
return false;
}
stock PlayerName(playerid) {
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
return name;
}
/*
* /register password
*
*/
dcmd_register(playerid,params[]) {

// The command shouldn't work if we already are authed
if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"Already authed.");

// The command shouldn't work if an account with this
// nick already exists
if (udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Account already exists, please use '/login password'.");

// Did he forgot the password?
if (strlen(params)==0) return SystemMsg(playerid,"Correct usage: '/register password'");

// We save the money to the accstate
if (udb_Create(PlayerName(playerid),params,GetPlayerM oney(playerid),"")) return SystemMsg(playerid,"Account successfully created. Login with '/login password' now.");
return true;
}
/*
* /login password
*
*/
dcmd_login(playerid,params[]) {

// The command shouldn't work if we already are authed
if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"Already authed.");

// The command shouldn't work if an account with this
// nick does not exists
if (!udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Account doesn't exist, please use '/register password'.");

// Did he forgot the password?
if (strlen(params)==0) return SystemMsg(playerid,"Correct usage: '/login password'");

if (udb_CheckLogin(PlayerName(playerid),params)) {
// Login was correct

// Since we are using the "accstate"-variable to save and
// read the money of the player, we can update his money now.

// Following thing is the same like the missing SetPlayerCommand
GivePlayerMoney(playerid,udb_UserInt(PlayerName(pl ayerid))-GetPlayerMoney(playerid));

PLAYERLIST_authed[playerid]=true;

return SystemMsg(playerid,"Successfully authed!");
} else {
// Login was incorrect
return SystemMsg(playerid,"Login failed!");
}
return true;
}
public OnPlayerDisconnect(playerid) {
if (PLAYERLIST_authed[playerid]) {
// Was loggedin, so save the data!
udb_UserSetInt(PlayerName(playerid),GetPlayerMoney (playerid));
}
return false;
}
---------------------------------------------------------------------------------------------------------------
Reply
#8

At OnPlayerDisconnect, change:
pawn Код:
udb_UserSetInt(PlayerName(playerid), GetPlayerMoney(playerid));
to:
pawn Код:
udb_UserSetInt(PlayerName(playerid)).("money", GetPlayerMoney(playerid));
And at dcmd_login:
pawn Код:
GivePlayerMoney(playerid, udb_UserInt(PlayerName(playerid)) - GetPlayerMoney(playerid));
to:
pawn Код:
GivePlayerMoney(playerid, udb_UserInt(PlayerName(playerid)).("money") - GetPlayerMoney(playerid));
Reply
#9

If i do That i get more errors look

Compile Errors:
----------------------------------------------------------------------------------
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(12) : warning 235: public function lacks forward declaration (symbol "SystemMsg")
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(27) : warning 217: loose indentation
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(51) : warning 202: number of arguments does not match definition
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(51) : warning 202: number of arguments does not match definition
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(77) : warning 202: number of arguments does not match definition
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(77) : error 001: expected token: ",", but found "."
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(77) : error 029: invalid expression, assumed zero
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(77) : error 033: array must be indexed (variable "-unknown-")
C:\Users\Michael\Desktop\opslaan wachtwoorden.pwn(77) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
------------------------------------------------------------------------------------

Script Writed:
-------------------------------------------------------------------------------------------------------------------------
#include <a_samp>
// for the samp stuff
#include <dutils>
// for the functions dini and dudb need
#include <dudb>
// for the userdatabase, get dudb version 1.2 for this.
#define dcmd(%1,%2,%3) if ((strcmp(%3, "/%1", true, %2+1) == 0)&&(((%3[%2+1]==0)&&(dcmd_%1(playerid,"")))||((%3[%2+1]==32)&&(dcmd_%1(playerid,%3[%2+2]))))) return 1
#define COLOR_SYSTEM 0xEFEFF7AA

new PLAYERLIST_authed[MAX_PLAYERS];
public
SystemMsg(playerid,msg[]) {
if ((IsPlayerConnected(playerid))&&(strlen(msg)>0)) {
SendClientMessage(playerid,COLOR_SYSTEM,msg);
}
return 1;
}

public OnPlayerCommandText(playerid,cmdtext[]) {
dcmd(login ,5, cmdtext); // because login has 5 characters
dcmd(register ,8, cmdtext); // because register has 8 characters
return false;
}

public OnPlayerConnect(playerid) {
PLAYERLIST_authed[playerid]=false;
return false;
}
stock PlayerName(playerid) {
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
return name;
}
/*
* /register password
*
*/
dcmd_register(playerid,params[]) {

// The command shouldn't work if we already are authed
if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"Already authed.");

// The command shouldn't work if an account with this
// nick already exists
if (udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Account already exists, please use '/login password'.");

// Did he forgot the password?
if (strlen(params)==0) return SystemMsg(playerid,"Correct usage: '/register password'");

// We save the money to the accstate
if (udb_Create(PlayerName(playerid),params,GetPlayerM oney(playerid),"")) return SystemMsg(playerid,"Account successfully created. Login with '/login password' now.");
return true;
}
/*
* /login password
*
*/
dcmd_login(playerid,params[]) {

// The command shouldn't work if we already are authed
if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"Already authed.");

// The command shouldn't work if an account with this
// nick does not exists
if (!udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Account doesn't exist, please use '/register password'.");

// Did he forgot the password?
if (strlen(params)==0) return SystemMsg(playerid,"Correct usage: '/login password'");

if (udb_CheckLogin(PlayerName(playerid),params)) {
// Login was correct

// Since we are using the "accstate"-variable to save and
// read the money of the player, we can update his money now.

// Following thing is the same like the missing SetPlayerCommand
GivePlayerMoney(playerid, udb_UserInt(PlayerName(playerid)).("money") - GetPlayerMoney(playerid));

PLAYERLIST_authed[playerid]=true;

return SystemMsg(playerid,"Successfully authed!");
} else {
// Login was incorrect
return SystemMsg(playerid,"Login failed!");
}
return true;
}
public OnPlayerDisconnect(playerid) {
if (PLAYERLIST_authed[playerid]) {
// Was loggedin, so save the data!
udb_UserSetInt(PlayerName(playerid)).("money", GetPlayerMoney(playerid));
}
return false;
}
-------------------------------------------------------------------------------------------------------------------------
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)