Little problem
#1

Ok, so I get errors while compiling my pawno code:
Код:
C:\Documents and Settings\Justas\Desktop\samp\gamemodes\gyvenimas.pwn(145) : error 017: undefined symbol "dcmd_register"
C:\Documents and Settings\Justas\Desktop\samp\gamemodes\gyvenimas.pwn(146) : error 017: undefined symbol "dcmd_login"
C:\Documents and Settings\Justas\Desktop\samp\gamemodes\gyvenimas.pwn(147) : error 017: undefined symbol "dcmd_register"
C:\Documents and Settings\Justas\Desktop\samp\gamemodes\gyvenimas.pwn(155) : error 017: undefined symbol "params"
C:\Documents and Settings\Justas\Desktop\samp\gamemodes\gyvenimas.pwn(156) : error 017: undefined symbol "params"
C:\Documents and Settings\Justas\Desktop\samp\gamemodes\gyvenimas.pwn(411) : warning 203: symbol is never used: "ret_memcpy"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
And dcmd is defined in the top of script, I was creating my register/login system.Please help me!!!
Reply
#2

Show some code please.
Reply
#3

You have to put dcmd(register, lengthofregisterstring,cmdtext); inside OnPlayerCommand.

I would recommend you to use zcmd.
Reply
#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
#5

Quote:
Originally Posted by karakana7
Посмотреть сообщение
[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.
QUOTE Not QOUTE x)

Anyway zcmd would be the same as dcmd, only faster.

an command would look like this: command(commandhere, playerid, params[]){} and no need to put things under callbacks
Reply
#6

Why you saying no need to put things under callbacks lol?So where I need to put them?
Reply
#7

Quote:
Originally Posted by karakana7
Посмотреть сообщение
Why you saying no need to put things under callbacks lol?So where I need to put them?
Outside callbacks

pawn Код:
public OnGameModeInit()
{
     return 1;
}

// Commands here :))

public OnPlayerConnect(playerid)
{
     return 1;
}
Reply
#8

if you're using ZCMD then you're doing it like Cameltoe said:

command(commandhere, playerid, params[]){ //inside of the command }

and thats your command, nice and simple
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)