SA-MP Forums Archive
need big help - 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)
+--- Thread: need big help (/showthread.php?tid=449020)



need big help - mapcode - 07.07.2013

remove


Re: need big help - Deathstalker - 07.07.2013

This is the scripting help section, not troubleshooting for fortune tellers section.


Re: need big help - mapcode - 07.07.2013

what you on about


Re: need big help - CAR - 07.07.2013

Maybe you could show us some code
The login part of your script can be useful because at some part the admins are kicked when they're trying to login


Re: need big help - Deathstalker - 07.07.2013

Quote:
Originally Posted by mapcode
Посмотреть сообщение
what you on about
What I meant was, that we need some code as CAR stated above. We can't know what's wrong if we have no code to work with. We might have an idea, but we can't know for sure.


Re: need big help - mapcode - 07.07.2013

Код:
 if(dialogid == 1) //LOGIN
    {
		if(gPlayerLogged[playerid] == 1)
		{
			SendClientMessage(playerid, COLOR_WHITE, "SERVER: You are already logged in.");
			return 1;
		}
		if(response)
		{
		    if(!strlen(inputtext))
		    {
		        DisplayDialogForPlayer(playerid, 1); //login
				SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must enter a password.");
				return 1;
			}
			if(strlen(inputtext) >= 50)
			{
			    DisplayDialogForPlayer(playerid, 1); //login
				SendClientMessage(playerid, COLOR_WHITE, "SERVER: Password is too long.");
				return 0;
			}
	        new tmppass[64];
	        //Store Player ID & TMP pass in echo to find string used to crash server
	        new playername[MAX_PLAYER_NAME];
	        strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
	        GetPlayerName(playerid, playername, sizeof(playername));
			TextDrawShowForPlayer(playerid, SpawnClickI);
			TextDrawShowForPlayer(playerid, SpawnClickII);
//			printf("[login] [%s] %s", playername, inputtext[0]);
			if(strlen(playername) == 3)
			{
			    /*if(strcmp(playername, "Smo", true) == 0)
			    {
					return 0;
			    }
			    else
			    {*/
			    	SendClientMessage(playerid, COLOR_LIGHTRED, "Sorry, that name is too short, please change it.");
			    	Kick(playerid);
			    	return 1;
				//}
			}
	        Encrypt(tmppass);
	        OnPlayerLogin(playerid,tmppass);
		}
        else
        {
            DisplayDialogForPlayer(playerid, 1); //login



Re: need big help - Deathstalker - 07.07.2013

We might need to see OnPlayerLogin as well as the DisplayDialogForPlayer with ID 1.


Re: need big help - mapcode - 07.07.2013

forward OnPlayerLogin(playerid,password[]);

and

public OnPlayerLogin(playerid,password[])
{
new tmp2[256];
new string2[128];
format(string2, sizeof(string2), "%s.ini", PlayerName(playerid));
new File: UserFile = fopen(string2, io_read);
if ( UserFile )


Re: need big help - Deathstalker - 07.07.2013

And what about this one?
pawn Код:
DisplayDialogForPlayer(playerid, 1); //login



Re: need big help - mapcode - 07.07.2013

Quote:
Originally Posted by Deathstalker
Посмотреть сообщение
And what about this one?
pawn Код:
DisplayDialogForPlayer(playerid, 1); //login
what do you mean what about this one