SA-MP Forums Archive
Problem with OnPlayerConnect - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem with OnPlayerConnect (/showthread.php?tid=69491)



Problem with OnPlayerConnect - Shellegg - 18.03.2009

So.. this iss the deal.
In my RP Gm, wich it isnґt a GF edit ^^ the chat that tells you to type your password/to register is not appearing.
Anyone knows why?

This is the OnPlayerConnect:

Quote:

public OnPlayerConnect(playerid)
{
//==================[Join Counter]=========================
JoinCounter = JoinCounter + 1;
dini_IntSet("CRP_Scriptfiles/Other/JoinCounter.cfg", "Connections", JoinCounter);
//================================================== =======

ResetStats(playerid);//Setting variables to 0.
ClearScreen(playerid);//Clearing the users screen from SA-MP messages.
ShowScriptStats(playerid);//Showing the script information.
new first[MAX_PLAYER_NAME], last[MAX_PLAYER_NAME];
if(RPName(PlayerName(playerid),first,last))
{
SendClientMessage(playerid,COLOR_YELLOW,"_________ _________________________________________________" );
SendClientMessage(playerid,COLOR_LIGHTYELLOW2," LOGIN ");
new sendername[MAX_PLAYER_NAME];
new accstring[128];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(accstring, sizeof(accstring), "CRP_Scriptfiles/Accounts/%s.ini", sendername);
new File: hFile = fopen(accstring, io_read);
if (hFile)
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "Jб estбs registado, escreve a tua password para fazeres o login");
fclose(hFile);
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "Ainda nгo estбs registado, escreve a tua password em baixo para o fazeres.");
}
SendClientMessage(playerid,COLOR_YELLOW,"_________ ________________________________________________") ;
}
else
{
KickPlayer(playerid," o Merdas","Nome Invбlido, Formato Correcto: Nome_Apelido.");
}
return 1;
}

thank you


Re: Problem with OnPlayerConnect - Shellegg - 18.03.2009

anyone?


Re: Problem with OnPlayerConnect - Shellegg - 19.03.2009

sorry but i made this yesterday and it is already at the 4rd page..
anyone?


Re: Problem with OnPlayerConnect - MenaceX^ - 19.03.2009

Check if the player exists.


Re: Problem with OnPlayerConnect - Shellegg - 19.03.2009

he existe, because it doesent appear the message to login, but if i type my password he will login..