Hallo Brotfische^^
Ich habe ein Problem mit meinem Login und Register System was ich mit PVars schreibe
Also Folgendes Problem:
OnPlayerRegister:
public OnPlayerRegister(playerid, password[])
{
if(IsPlayerConnected(playerid))
{
new string3[64];
new playername3[MAX_PLAYER_NAME];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(playerid, playername3, sizeof(playername3));
format(string3, sizeof(string3), "/Accounts/%s.ini", playername3);
new File: hFile = fopen(string3, io_write);
if (hFile)
{
/*strmid(*/
SetPVarString(playerid, "Passwort", strlen(password)); // ERROR
new var[32];
format(var, 32, "Passwort=%s\n", GetPVarString(playerid, "Passwort", password, 255));fwrite(hFile, var);
format(var, 32, "Geld=%d\n", PlayerMoney[playerid]);fwrite(hFile, var);
format(var, 32, "Admin=%d\n", GetPVarInt(playerid, "Admin"));fwrite(hFile, var);
format(var, 32, "Kills=%d\n", GetPVarInt(playerid, "Kills"));fwrite(hFile, var);
format(var, 32, "Tode=%d\n", GetPVarInt(playerid, "Tode"));fwrite(hFile, var);
format(var, 32, "Banned=%d\n", GetPVarInt(playerid, "Banned"));fwrite(hFile, var);
fclose(hFile);
SendClientMessage(playerid, COLOR_LIGHTGREEN, "* Du hast dich Erfolgreich Registriert.");
}
}
return 1;
}
So nun zeigt er mir aber folgenden Error an:
error 035: argument type mismatch (argument 3)
und dan noch bei OnPlayerLogin:
public OnPlayerLogin(playerid,password[])
{
new string2[64];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
new playername2[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername2, sizeof(playername2));
format(string2, sizeof(string2), "/Accounts/%s.ini", playername2);
new File: UserFile = fopen(string2, io_read);
if ( UserFile )
{
new PassData[256];
new keytmp[256], valtmp[256];
fread( UserFile , PassData , sizeof( PassData ) );
keytmp = ini_GetKey( PassData );
if( strcmp( keytmp , "Key" , true ) == 0 )
{
valtmp = ini_GetValue( PassData );
strmid(PlayerInfo[playerid][pKey], valtmp, 0, strlen(valtmp)-1, 255);
}
if(strcmp(PlayerInfo[playerid][pKey],password, true ) == 0 )
{
new key[ 256 ] , val[ 256 ];
new Data[ 256 ];
while ( fread( UserFile , Data , sizeof( Data ) ) )
{
key = ini_GetKey( Data );
if( strcmp( key , "Admin" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAdmin] = strval( val ); }
if( strcmp( key , "Geld" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCash] = strval( val ); }
if( strcmp( key , "Kills" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pKills] = strval( val ); }
if( strcmp( key , "Tode" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pTode] = strval( val ); }
if( strcmp( key , "Banned" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pBanned] = strval( val ); }
}
fclose(UserFile);
}
...........
OnPlayerLogin ist nochnicht umgeschrieben^^ da ich erst diese Frage habe..
nemlich wie schreibe ich dies hier um in PVars ... ich steh da erlich gesagt aufn Schlauch..
if( strcmp( keytmp , "Key" , true ) == 0 )
{
valtmp = ini_GetValue( PassData );
strmid(PlayerInfo[playerid][pKey], valtmp, 0, strlen(valtmp)-1, 255);
}
if(strcmp(PlayerInfo[playerid][pKey],password, true ) == 0 )
Wer eine Lösug weiß bitte melden^^
MFG Picaso