das geht ja eben nicht wenn ich eingebe /register passwort kommt gar nichts
achja der samp server stürzt immer ab ohne eine meldung
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);
new tmp[256];
new playername[MAX_PLAYER_NAME];
if (strcmp(cmd, "/login", true) ==0 )
{
if(IsPlayerConnected(playerid))
{
new tmppass[64];
if(gPlayerLogged[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "*::* Du bist bereits eingeloggt *::*");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "*::* /login [Passwort] *::*");
return 1;
}
strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
Encrypt(tmppass);
OnPlayerLogin(playerid,tmppass);
}
return 1;
}
if (strcmp(cmd, "/register", true)==0)
{
new string[265];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "*::* /register [Passwort] *::*");
return 1;
}
if (gPlayerAccount[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "*::* Du bist bereits registriert *::*");
return 1;
}
strmid(PlayerInfo[playerid][pPassword], tmp, 0, strlen(cmdtext), 255);
Encrypt(PlayerInfo[playerid][pPassword]);
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "/User/%s.cer", playername);
new File: file = fopen(string, io_read);
if (file)
{
SendClientMessage(playerid, COLOR_GREY, "*::* Du bist bereits registriert *::*");
fclose(file);
return 1;
}
new File:hFile;
hFile = fopen(string, io_append);
new var[32];//
format(var, 32, "%s\n", PlayerInfo[playerid][pPassword]);fwrite(hFile, var);
format(var, 32, "Kills=%d\n",PlayerInfo[playerid][pKills]);fwrite(hFile, var);
format(var, 32, "Deaths=%d\n",PlayerInfo[playerid][pDeaths]);fwrite(hFile, var);
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
format(var, 32, "Money=%d\n",PlayerInfo[playerid][pCash]);fwrite(hFile, var);
format(var, 32, "House=%d\n",PlayerInfo[playerid][pHouse]);fwrite(hFile, var);
fclose(hFile);
SendClientMessage(playerid, COLOR_WHITE, "*::* Du hast dich erfolgreich registriert! *::* (/login [Passwort]) *::*");
return 1;
}
Hier mal der cmd von mein regi sys