Little problem
#4

[QOUTE=iggy1;890298]Show some code please. [/QOUTE]
If you asking me to put registration and login code, so there it is(it's not completed, but anyway these errors should not be while compiling, becau in my opinion everything is fine:
Код:
#include <a_samp>

#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

new prisijunges[MAX_PLAYERS];
enum pInfo
{
	AdminLevel,
	Cash,
	Score,
}

public OnPlayerConnect(playerid)
{
	new file[MAX_PLAYER_NAME];
	new name[MAX_PLAYERS];
	GetPlayerName(playerid, name, sizeof(name));
	format(file, sizeof(file), "//Users//%s.ini", name);
	if(!fexist(file))
		{
			SendClientMessage(playerid, 0xFFFFFFFF, "Tau reikia uzsiregistruoti su /register komanda!");
			prisijunges[playerid] = 0;
			return 1;
		}
	if(fexist(file))
 		{
 			SendClientMessage(playerid, 0xFFFFFFFF, "Prisijunk su /login komanda!");
			return 1;
		}
	return 0;
}
public OnPlayerDisconnect(playerid, reason)
{
	new file[MAX_PLAYER_NAME];
	new name[MAX_PLAYERS];
    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file)), "//Users//%s.ini", name);
    if(dini_Exists(file))
        {
            dini_IntSet(file, "AdminLevel", PlayerInfo[playerid][AdminLevel]);
            dini_IntSet(file, "Cash", PlayerInfo[playerid][Cash]);
            dini_IntSet(file, "Score", PlayerInfo[playerid][Score]);
		}
	prisijunges[playerid] = 0;
	return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
	dcmd(register, 8, cmdtext);
	dcmd(login, 5, cmdtext);
	dcmd_register(playerid, params[])
	{
		new file[128], pname[MAX_PLAYER_NAME];
		GetPlayerName(playerid, pname, sizeof(pname));
		format(file, sizeof(file), "//Users//%s.ini", pname);
  		if(!strlen(file)) return SendClientMessage(playerid, YELLOW, "Kad uzsiregistruotumete reikia rasyti /register [slaptazodis]");
    	if(dini_Exists(file)) return SendClientMessage(playerid, GREY, "Jus jau esate uzsiregistraves!");
     	dini_Create(file);
      	dini_IntSet(file, "hashPW", udb_hash(params));
       	dini_Set(file, "Slaptazodis", params);
       	
	}
So this the whole code required for registration/login system, how you see it is not completed, but that's not why I get errors...Don't mind what means these senteces between "" if you don't understand my language.Please only help with the code.

[QOUTE=Cameltoe;890299]You have to put dcmd(register, lengthofregisterstring,cmdtext); inside OnPlayerCommand.

I would recommend you to use zcmd. [QOUTE]
I already put it under this callback.With zcmd you say?I know that it is same like dmcd, the difference is only that it's faster, but I know only that, so how do you think I can use it?!

P.S.-sorry, but this forum qoute system is crap, in other forums i can use it with no problems, but there i dont know what is the code for that!Because the form like this [QOUTE=NICKNAME][/QOUTE] isn't working here.
Reply


Messages In This Thread
Little problem - by karakana7 - 29.10.2010, 14:34
Re: Little problem - by iggy1 - 29.10.2010, 14:34
Re: Little problem - by Cameltoe - 29.10.2010, 14:35
Re: Little problem - by karakana7 - 29.10.2010, 14:51
Re: Little problem - by Cameltoe - 29.10.2010, 15:02
Re: Little problem - by karakana7 - 29.10.2010, 15:11
Re: Little problem - by Cameltoe - 29.10.2010, 15:13
Re: Little problem - by i514x - 29.10.2010, 15:14

Forum Jump:


Users browsing this thread: 1 Guest(s)