bin grade am anfang vom registersystem weiß aber net weiter hier der script:
forward login(playerid);
forward logout(playerid);
new loggedin[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(register,8,cmdtext);
return 0;
}
dcmd_register(playerid,params[])
//----------------Registrieren---------------------
if(loggedin[playerid] != 0)
{
SendClientMessage(playerid,COLOR_GREY,"Du bist bereits registriert.");
return 1;
}
new msg[200];
new pname[40];
GetPlayerName(playerid,pname,sizeof(pname));
format(msg,sizeof(msg),"Willkommen %s.\n\nDu kannst dich jetzt registrieren.\nGib bitte dein gewünschtes Passwort\nein.",pname);
ShowPlayerDialog(playerid, 0,DIALOG_STYLE_INPUT, "Registrierung:", msg, "Bestätigen", "Abbrechen");
return 1;
}
return 1;
}
//--------------Einloggen-------------------------
dcmd_login(playerid,params[])
{
if(loggedin[playerid] != 0)
{
SendClientMessage(playerid,COLOR_GREY,"Du bist bereits eingeloggt.");
return 1;
}
new msg[200];
new name[40];
GetPlayerName(playerid,name,sizeof(name));
new msg[200];
format(msg,sizeof(msg),"Willkommen zurück %s.\n\nDu kannst dich jetzt einloggen.\nGib bitte dein Passwort ein.",name);
ShowPlayerDialog(playerid, 1,DIALOG_STYLE_INPUT, "Einloggen:", msg, "Bestätigen", "Abbrechen");
return 1;
}
public login(playerid)
{
new name[MAX_PLAYER_NAME];
new save[40];
GetPlayerName(playerid,name,sizeof(name));
format(save,sizeof(save),"/Spieler/%s.ini",name);
pInfo[playerid][admin] = dini_Int(save,"Adminlevel");
SetPlayerMoney(playerid, dini_Int(save,"Geld"));
pInfo[playerid][score] = dini_Int(save,"Score");
return 1;
}
public logout(playerid)
{
new name[MAX_PLAYER_NAME];
new save[40];
GetPlayerName(playerid,name,sizeof(name));
format(save,sizeof(save),"/Spieler/%s.ini",name);
dini_IntSet(save,"Adminlevel",pInfo[playerid][admin]);
dini_IntSet(save,"Geld",GetPlayerMoney(playerid));
dini_IntSet(save,"Score",GetPlayerScore(playerid));
pInfo[playerid][admin] = 0;
pInfo[playerid][score] = 0;
SetPlayerMoney(playerid,0);
return 1;
}
Hab es ja definiert aber komm die Errors:
C:\PROGRA~1\GTASAN~1\GTASAN~1\SAMP03~1\GAMEMO~1\samplee.pwn(140) : error 017: undefined symbol "loggedin"
C:\PROGRA~1\GTASAN~1\GTASAN~1\SAMP03~1\GAMEMO~1\samplee.pwn(140) : warning 215: expression has no effect
C:\PROGRA~1\GTASAN~1\GTASAN~1\SAMP03~1\GAMEMO~1\samplee.pwn(140) : error 001: expected token: ";", but found "]"
C:\PROGRA~1\GTASAN~1\GTASAN~1\SAMP03~1\GAMEMO~1\samplee.pwn(137) : error 010: invalid function or declaration
C:\PROGRA~1\GTASAN~1\GTASAN~1\SAMP03~1\GAMEMO~1\samplee.pwn(137 -- 143) : fatal error 107: too many error messages on one line
auf der zeile:
if(loggedin[playerid] != 0)
//wenn ich daraus das hier mache:
if(loggedin(playerid) != 0)
//läuft der compiler weiter aber es "findet" loggedin trotzdem nicht
kann einer helfen ?
MfG bad_company