Problems Making My Admin script
#1

Ok, sorry about so many posts asking for help (this is like my third one) but im following this tutorial: https://sampwiki.blast.hk/wiki/Creating_...n_FilterScript

Код:
dcmd_register(playerid, params[])
{
    if(gPlayerInfo[playerid][PLAYER_REGGED] == 1)
	return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You have already registered!");
    else if(!params[0])
	return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /register [password]");
    else if(strlen(params) < gSettings[PASS_MIN] || strlen(params) > gSettings[PASS_MAX])
    {
	new string[128];
        format(string, sizeof(string), "ERROR: Password must be between %d and $d characters long!", gSettings[PASS_MIN], gSettings[PASS_MAX]);
	return SendClientMessage(playerid, COLOUR_ORANGE, string);
    }
    else
    {
	new password = num_hash(params);
	gPlayerInfo[playerid][PLAYER_PASS] = password;
	gPlayerInfo[playerid][PLAYER_REGGED] = 1;
        gPlayerInfo[playerid][PLAYER_LOGGED] = 1;
	GetPlayerIp(playerid, gPlayerInfo[playerid][PLAYER_IP], 16);
	new string[128]; format(string, sizeof(string), "You have successfully registered your account with the password \'%s\'. You have been automatically logged in.", params);
	return SendClientMessage(playerid, COLOUR_LIGHTBLUE, string);
    }
}
I got this:

Код:
C:\Documents and Settings\Ed\My Documents\SAMP Server TKFS\filterscripts\TKAdmin.pwn(8) : warning 201: redefinition of constant/macro (symbol "dcmd(%1,%2,%3)")
C:\Documents and Settings\Ed\My Documents\SAMP Server TKFS\filterscripts\TKAdmin.pwn(84) : warning 217: loose indentation
C:\Documents and Settings\Ed\My Documents\SAMP Server TKFS\filterscripts\TKAdmin.pwn(88) : warning 217: loose indentation
C:\Documents and Settings\Ed\My Documents\SAMP Server TKFS\filterscripts\TKAdmin.pwn(109) : warning 217: loose indentation
C:\Documents and Settings\Ed\My Documents\SAMP Server TKFS\filterscripts\TKAdmin.pwn(110) : warning 217: loose indentation
C:\Documents and Settings\Ed\My Documents\SAMP Server TKFS\filterscripts\TKAdmin.pwn(132) : warning 217: loose indentation
C:\Documents and Settings\Ed\My Documents\SAMP Server TKFS\filterscripts\TKAdmin.pwn(133) : warning 217: loose indentation
C:\Documents and Settings\Ed\My Documents\SAMP Server TKFS\filterscripts\TKAdmin.pwn(140) : warning 217: loose indentation
C:\Documents and Settings\Ed\My Documents\SAMP Server TKFS\filterscripts\TKAdmin.pwn(141) : warning 217: loose indentation
C:\Documents and Settings\Ed\My Documents\SAMP Server TKFS\filterscripts\TKAdmin.pwn(161) : warning 217: loose indentation
C:\Documents and Settings\Ed\My Documents\SAMP Server TKFS\filterscripts\TKAdmin.pwn(162) : warning 217: loose indentation
C:\Documents and Settings\Ed\My Documents\SAMP Server TKFS\filterscripts\TKAdmin.pwn(198) : warning 217: loose indentation
C:\Documents and Settings\Ed\My Documents\SAMP Server TKFS\filterscripts\TKAdmin.pwn(199) : warning 217: loose indentation
C:\Documents and Settings\Ed\My Documents\SAMP Server TKFS\filterscripts\TKAdmin.pwn(193) : warning 203: symbol is never used: "index"
C:\Documents and Settings\Ed\My Documents\SAMP Server TKFS\filterscripts\TKAdmin.pwn(183) : warning 203: symbol is never used: "params"
C:\Documents and Settings\Ed\My Documents\SAMP Server TKFS\filterscripts\TKAdmin.pwn(243) : warning 203: symbol is never used: "dcmd_akill"
C:\Documents and Settings\Ed\My Documents\SAMP Server TKFS\filterscripts\TKAdmin.pwn(243) : warning 203: symbol is never used: "ret_memcpy"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


17 Warnings.
As you can see its only warnings, but in game when I do /register hhjjkk3344 (password I made up) it says: ERROR: Password must be between 0 and $d characters long!

Now, I got dcmd in the includes folder so it isn't that. So, I have no idea what it is.

And this is in the password command. So again sorry for making so many help posts.
Reply
#2

Well how about you fix those warning first? It says you defined dcmd twice. So probably once in the includes and once in your script.
Reply
#3

The loose indetations are nothing to worry about. In most of my scripts it says:
Код:
warning 203: symbol is never used: "ret_memcpy"
, i'm at school atm, I will try and see the problem when I get home. But the tutorial is still in progress, so we might need the redefintition. If anyone else can help?
Reply
#4

for that ret_mempcy the solution is #pragma unused ret_mempcy.
Yes, I agree with Backwardsman, you should fix the indentation, and delete variables which aren't used.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)