Originally Posted by ·٠•●°Alive°●•٠·
And when I login it sayies that player isn\'t registered, but if I login it logins perfectly...
|
Originally Posted by [B2K
Hustler ]
you mean when you connect it says that you are not registred, ([SERVER]Account %s isn\'t registered. Register using /register password") but when u use /login [password] it logs in correctly? before you said when u login you get that message and then when u login it works fine - makes no sense. Quote:
|
298.public OnPlayerConnect(playerid)
299.{
300. new string[256];
301. new playrname[MAX_PLAYER_NAME];
302. new planame[MAX_PLAYER_NAME];
303. new connect[128], string2[256];
304. new pName[MAX_PLAYER_NAME];
305. new jstring[48];
306.
307. GetPlayerName(playerid, planame, sizeof(planame));
308. GetPlayerName(playerid, playrname, sizeof(playrname));
309. GetPlayerName(playerid, pName, sizeof(pName));
310. format(connect, sizeof(string), "Admin/Users/%s.djson", playrname);
311. format(string2, sizeof(string2), "Admin/Users/%s.djson", playrname);
312.
313. PlayerInfo[playerid][pLevel] = 0;
314. PlayerInfo[playerid][pKills] = 0;
315. PlayerInfo[playerid][pDeaths] = 0;
316. PlayerInfo[playerid][pCash] = 0;
317.
318. gPlayerLogged[playerid] = 0;
319.
320. format(jstring, sizeof(jstring), "***%s has joined the server.", pName);
321. SendClientMessageToAll(0xAAAAAAAA, jstring);
322.
323. if(fexist(connect))
324. {
325. new tmp[50],tmp2[256];
326. GetPlayerIp(playerid,tmp,50);
327. tmp2 = dini_Get(connect,"IP");
328. if(!strcmp(tmp,tmp2,true))
329. {
330. format(string, sizeof(string), "[SUCESS]%s, you have been automatically logged in.", playrname);
331. SendClientMessage(playerid, COLOR_GREEN, string);
332. gPlayerLogged[playerid] = 1;
333. new playername2[MAX_PLAYER_NAME];
334. GetPlayerName(playerid, playername2, sizeof(playername2));
335. format(string2, sizeof(string2), "Admin/Users/%s.ini", playername2);
336. new File: UserFile = fopen(string2, io_read);
337. if ( UserFile )
338. {
339. new PassData[256];
340. new keytmp[256], valtmp[256];
341. fread( UserFile , PassData , sizeof( PassData ) );
342. keytmp = ini_GetKey( PassData );
343. if( strcmp( keytmp , "Password" , true ) == 0 )
344. {
345. valtmp = ini_GetValue( PassData );
346. strmid(PlayerInfo[playerid][pPassword], valtmp, 0, strlen(valtmp)-1, 255);
347. new key[ 256 ] , val[ 256 ];
348. new Data[ 256 ];
349. while ( fread( UserFile , Data , sizeof( Data ) ) )
350. {
351. key = ini_GetKey( Data );
352. if( strcmp( key , "Level" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLevel] = strval( val ); }
353. if( strcmp( key , "Kills" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pKills] = strval( val ); }
354. if( strcmp( key , "Deaths" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDeaths] = strval( val ); }
355. if( strcmp( key , "Money" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCash] = strval( val ); }
356. }
357. fclose(UserFile);
358. gPlayerLogged[playerid] = 1;
359. }
360. }
361. }
362. else
363. {
364. gPlayerAccount[playerid] = 1;
365. format(string, sizeof(string), "[SERVER]Welcome back %s! Please login.", playrname);
366. SendClientMessage(playerid, COLOR_YELLOW, string);
367. gPlayerLogged[playerid] = 0;
368. return 1;
369. }
370. }
371. else
372. {
373. gPlayerAccount[playerid] = 0;
374. format(string, sizeof(string),"[SERVER]Account %s isn\'t registered. Register using /register password", playrname);
375. SendClientMessage(playerid, COLOR_YELLOW,string);
376. gPlayerLogged[playerid] = 0;
377. return 1;
378. }
379. return 1;
380.}
public OnPlayerConnect(playerid)
{//New\'s
new string[256];
new PNAME[MAX_PLAYER_NAME];
GetPlayerName(playerid, PNAME, sizeof(PNAME));
//PlayerInfo == 0
PlayerInfo[playerid][pLevel] = 0;
PlayerInfo[playerid][pKills] = 0;
PlayerInfo[playerid][pDeaths] = 0;
PlayerInfo[playerid][pCash] = 0;
gPlayerAccount[playerid] = 0;
gPlayerLogged[playerid] = 0;
//Connect Message
format(string, sizeof(string), "***%s has joined the server.", PNAME);
SendClientMessageToAll(0xAAAAAAAA, string);
//Does Account Exist?
format(string, sizeof(string), "Admin/Users/%s.ini", PNAME);
if(fexist(string))
{
gPlayerAccount[playerid] = 1;
//IP Checker
new IP[20];
new IP2[20]=dini_Get(string,"IP");
GetPlayerIp(playerid,IP,sizeof(IP));
if(strcmp(IP,IP2,true)==0)
{
new key[256] , val[256];
new Data[256];
while (fread(string,Data,sizeof(Data)))
{
key = ini_GetKey( Data );
if( strcmp( key , "Level" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLevel] = strval( val ); }
if( strcmp( key , "Kills" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pKills] = strval( val ); }
if( strcmp( key , "Deaths" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDeaths] = strval( val ); }
if( strcmp( key , "Money" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCash] = strval( val ); }
}
fclose(UserFile);
gPlayerLogged[playerid] = 1;
format(string, sizeof(string), "[SUCESS]%s, you have been automatically logged in.", PNAME);
SendClientMessage(playerid, COLOR_GREEN, string);
}
else
{
format(string, sizeof(string), "[SERVER]Welcome back %s! Please login.", PNAME);
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
}
else
{
format(string, sizeof(string),"[SERVER]Account %s isn\'t registered. Register using /register password",PNAME);
SendClientMessage(playerid, COLOR_YELLOW,string);
return 1;
}
return 1;
}
public OnPlayerConnect(playerid)
{
new string[256];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
PlayerInfo[playerid][pLevel] = 0;
PlayerInfo[playerid][pKills] = 0;
PlayerInfo[playerid][pDeaths] = 0;
PlayerInfo[playerid][pCash] = 0;
gPlayerAccount[playerid] = 0;
gPlayerLogged[playerid] = 0;
//Does Account Exist?
format(string, sizeof(string), "Users/%s.ini", pName);
if(fexist(string))
{
gPlayerAccount[playerid] = 1;
//IP Checker
new IP[20];
new IP2[20] = dini_Get(string,"IP");
GetPlayerIp(playerid,IP,sizeof(IP));
if(strcmp(IP,IP2,true)==0)
{
new key[256] , val[256];
new Data[256];
while (fread(string,Data,sizeof(Data)))
{
key = ini_GetKey( Data );
if( strcmp( key , "Level" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLevel] = strval( val ); }
if( strcmp( key , "Kills" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pKills] = strval( val ); }
if( strcmp( key , "Deaths" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDeaths] = strval( val ); }
if( strcmp( key , "Money" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCash] = strval( val ); }
}
fclose(UserFile);
gPlayerLogged[playerid] = 1;
format(string, sizeof(string), "[SUCESS]%s, you have been automatically logged in.", pName);
SendClientMessage(playerid, COLOR_GREEN, string);
}
else
{
format(string, sizeof(string), "[SERVER]Welcome back %s! Please login.", pName);
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
}
else
{
format(string, sizeof(string),"[SERVER]Account %s isn\'t registered. Register using /register password",pName);
SendClientMessage(playerid, COLOR_YELLOW,string);
return 1;
}
return 1;
}
public OnPlayerConnect(playerid)
{
new string[256];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
PlayerInfo[playerid][pLevel] = 0;
PlayerInfo[playerid][pKills] = 0;
PlayerInfo[playerid][pDeaths] = 0;
PlayerInfo[playerid][pCash] = 0;
gPlayerAccount[playerid] = 0;
gPlayerLogged[playerid] = 0;
//Does Account Exist?
format(string, sizeof(string), "Users/%s.ini", pName);
if(fexist(string))
{
new File:PFILE=fopen(string, io_read);
if(PFILE)
{
gPlayerAccount[playerid] = 1;
//IP Checker
new IP[20];
new IP2[20];
new key[256] , val[256];
new Data[256];
while (fread(PFILE,Data,sizeof(Data)))
{
key = ini_GetKey( Data );
if( strcmp( key , "IP" , true ) == 0 ) { val = ini_GetValue( Data ); format(IP2,sizeof(IP2),"%s",val);}
fclose(PFILE);
}
GetPlayerIp(playerid,IP,sizeof(IP));
if(strcmp(IP,IP2,true)==0)
{
while (fread(PFILE,Data,sizeof(Data)))
{
key = ini_GetKey( Data );
if( strcmp( key , "Level" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLevel] = strval( val ); }
if( strcmp( key , "Kills" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pKills] = strval( val ); }
if( strcmp( key , "Deaths" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDeaths] = strval( val ); }
if( strcmp( key , "Money" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCash] = strval( val ); }
}
fclose(PFILE);
gPlayerLogged[playerid] = 1;
format(string, sizeof(string), "[SUCESS]%s, you have been automatically logged in.", pName);
SendClientMessage(playerid, COLOR_GREEN, string);
}
else
{
format(string, sizeof(string), "[SERVER]Welcome back %s! Please login.", pName);
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
}
}
else
{
format(string, sizeof(string),"[SERVER]Account %s isn\'t registered. Register using /register password",pName);
SendClientMessage(playerid, COLOR_YELLOW,string);
return 1;
}
return 1;
}
Originally Posted by v0nzz
"And when I login it sayies that player isn\'t registered, but if I login it logins perfectly... " Your contradicting yourself.
|