was ist falsch am bankregister warum gehen die commands nicht? (/bankregister PW geht nicht und /banklogin auch nicht...
#include <a_samp>
#include <dutils>
#include <dudb>
#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
#define COLOR_SYSTEM 0xEFEFF7AA
#define MAX_TRIES 3
#define COLOR_RED 0xFF0000FF
#define COLOR_BLUE 0xFF0AAAFF
new PLAYERLIST_authed[MAX_PLAYERS];
new tries[MAX_PLAYERS];
public OnFilterScriptInit()
{
print("\n==========================================");
print(" Bank RegisterSystem ");
print("\n==========================================");
}
stock SystemMsg(playerid,msg[]) {
if ((IsPlayerConnected(playerid))&&(strlen(msg)>0)) {
SendClientMessage(playerid,COLOR_SYSTEM,msg);
}
return 1;
}
stock PlayerName(playerid) {
new name[255];
GetPlayerName(playerid, name, 255);
return name;
}
dcmd_bankregister(playerid,params[]) {
if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"deine bank ist schon eongeloggt.");
if (udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Bankaccount existiert schon '/banklogin password'.");
if (strlen(params)==0) return SystemMsg(playerid,"Correct Usage: '/bankregister password'");
if (udb_Create(PlayerName(playerid),params)) return SystemMsg(playerid,"Bankaccount erstellt um einzuloggen '/banklogin password' now.");
return true;
}
dcmd_banklogin(playerid,params[]) {
if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"Deine bank ist schon eingeloggt.");
if (!udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Bankaccount existiert nicht '/bankregister password'.");
if (strlen(params)==0) return SystemMsg(playerid,"Mache '/banklogin password'");
if (udb_CheckLogin(PlayerName(playerid),params)) {
// Status
GivePlayerMoney(playerid,dUserINT(PlayerName(playerid)).("money")+GetPlayerMoney(playerid));
PLAYERLIST_authed[playerid]=true;
return SystemMsg(playerid,"bank erfolgreich eingeloggt!");
}
// Bad Password
tries[playerid]++;
if(tries[playerid] == MAX_TRIES) {
SystemMsg(playerid,"Falsches bank passwort!!");
}
else if (tries[playerid] == MAX_TRIES-1){
SendClientMessage(playerid, COLOR_RED, "Falsches passwort!!!");//ouch..
}
return 0;
}
public OnPlayerCommandText(playerid,cmdtext[]) {
dcmd(banklogin,5,cmdtext);
dcmd(bankregister,8,cmdtext);
return 0;
}
public OnPlayerConnect(playerid) {
tries[playerid] = 0;
PLAYERLIST_authed[playerid]=false;
if (udb_Exists(PlayerName(playerid))) return SendClientMessage(playerid, COLOR_BLUE, "Wilkommen zurück,(/banklogin password)");
return false;
}
public OnPlayerDisconnect(playerid) {
if (PLAYERLIST_authed[playerid]) {
// save
dUserSetINT(PlayerName(playerid)).("Money",GetPlayerMoney(playerid));
}
PLAYERLIST_authed[playerid]=false;
return false;
}
kan jemd helfen ??