Hab ein Filterscript, das ich aber nicht hinbekomme. Ich hoffe ihr könnt mir helfen.
#include <a_samp>
#include <core>
#include <float>
#define COLOR_GREEN 0x33AA33AA
#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
new PLAYERLIST_authed[MAX_PLAYERS];
new IsSpawned[MAX_PLAYERS];
main()
{
print("------------------------------------");
print(" Login Script ");
print("------------------------------------");
}
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid, COLOR_GREEN, "Login Script");
return 1;
}
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)) return SystemMsg(playerid,"*** Account successfully created. Login with '/login password' now.");
return true;
}
dcmd_login(playerid,params[]) {
if(IsSpawned[playerid] == 1){
// 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
// Following thing is the same like the missing SetPlayerCommand
GivePlayerMoney(playerid,dUserINT(PlayerName(playerid)).("money")-GetPlayerMoney(playerid));
GivePlayerWeapon(playerid,dUserINT(PlayerName(playerid)).("shotgun"),99999);
GivePlayerWeapon(playerid,dUserINT(PlayerName(playerid)).("pistole"),99999);
GivePlayerWeapon(playerid,dUserINT(PlayerName(playerid)).("mitra"),99999);
shotgun[playerid] = dUserINT(PlayerName(playerid)).("shotgun");
pistole[playerid] = dUserINT(PlayerName(playerid)).("pistole");
mitra[playerid] = dUserINT(PlayerName(playerid)).("mitra");
bank[playerid] = dUserINT(PlayerName(playerid)).("bank");
character[playerid] = dUserINT(PlayerName(playerid)).("character");
PLAYERLIST_authed[playerid]=true;
if(GetPlayerMoney(playerid) == 0){
GivePlayerMoney(playerid,5000);
}
if(character[playerid] != 0){
SetPlayerSkin(playerid, character[playerid]);
}
return SystemMsg(playerid,"*** Successfully authed!");
} else {
// Login was incorrect
return SystemMsg(playerid,"*** Login failed!");
}
}else{SystemMsg(playerid,"*** Spawn before logging!"); }
return true;
}
public OnPlayerCommandText(playerid, cmdtext[], i)
{
new cmd[256];
new idx;
new say[256];
dcmd(login,5,cmdtext); // because login has 5 characters
dcmd(register,8,cmdtext); // because register has 8 characters
if (PLAYERLIST_authed[playerid]) {
}
return 0;
}
public SystemMsg(playerid,msg[]) {
if ((IsPlayerConnected(playerid))&&(strlen(msg)>0)) {
SendClientMessage(playerid,COLOR_SYSTEM,msg);
}
return 1;
}
login.pwn(31) : error 017: undefined symbol "udb_Exists"
login.pwn(37) : error 017: undefined symbol "udb_Create"
login.pwn(49) : error 017: undefined symbol "udb_Exists"
login.pwn(54) : error 017: undefined symbol "udb_CheckLogin"
login.pwn(58) : error 017: undefined symbol "dUserINT"
login.pwn(58) : error 029: invalid expression, assumed zero
login.pwn(58) : error 033: array must be indexed (variable "-unknown-")
login.pwn(58) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
8 Errors.
Alles anzeigen
Schon mal Danke. Für euere Hilfe