SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 13/12/2010, 07:25 AM   #1
Face9000
Banned
 
Join Date: Jan 2010
Location: Pigland
Posts: 3,351
Reputation: 190
Default WTF lots errors?What i've done wrong?

Code:
#include <a_samp>
#include <dini>
#include <dutils>
#define adm
#if defined adm
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#define COLOUR_GREEN           0x33AA33AA
#define COLOUR_RED             0xAA3333AA
#define COLOUR_YELLOW          0xFFFF00AA
#define COLOUR_LIGHTBLUE       0x33CCFFAA
#define COLOUR_ORANGE          0xFF9900AA

#define PlayerFile 	       "Accounts/%s.dudb.sav"
#define SettingFile            "Adm/settings.ini"
#define CommandFile            "Adm/commands.ini"

new gPlayerInfo[MAX_PLAYERS][PLAYER_MAIN];

public OnFilterScriptInit()
{
 	print("\n****************************************");
	print("* CrazyAdmin loaded. *");
	print("****************************************\n");

    if(!fexist(SettingFile))
	{
		dini_Create(SettingFile);
		dini_IntSet(SettingFile, "PocketMoney", 3000);
		dini_IntSet(SettingFile, "JailCommands", 0);
		dini_IntSet(SettingFile, "AnnounceSeconds", 3);
		dini_IntSet(SettingFile, "PassMin", 3);
		dini_IntSet(SettingFile, "PassMax", 15);
	}

	gSettings[POCKET_MONEY] 		= dini_Int(SettingFile, "PocketMoney");
	gSettings[JAIL_COMMANDS] 		= dini_Int(SettingFile, "JailCommands");
	gSettings[ANNOUNCE_SECONDS] 	= dini_Int(SettingFile, "AnnounceSeconds");
	gSettings[PASS_MIN] 			= dini_Int(SettingFile, "PassMin");
	gSettings[PASS_MAX] 			= dini_Int(SettingFile, "PassMax");

	if(!fexist(CommandFile))
	{
		dini_Create(CommandFile);
		dini_IntSet(CommandFile, "Akill", 6);
		dini_IntSet(CommandFile, "Announce", 5);
        }

	gCommands[AKILL] 			= dini_Int(CommandFile, "Akill");
	gCommands[ANNOUNCE] 		= dini_Int(CommandFile, "Announce");
	
	new gCommands[COMMANDS_MAIN];

 	return 1;
}

    #endif
    

enum PLAYER_MAIN {
	PLAYER_NAME[MAX_PLAYER_NAME],
	PLAYER_IP[16],
	PLAYER_REGGED,
	PLAYER_PASS,
	PLAYER_LOGGED,
	PLAYER_LEVEL,
	PLAYER_WIRED,
	PLAYER_JAILED
}

enum SETTINGS_MAIN {
    POCKET_MONEY,
    JAIL_COMMANDS,
    ANNOUNCE_SECONDS,
    PASS_MIN,
    PASS_MAX
}

new gSettings[SETTINGS_MAIN];

enum COMMANDS_MAIN {
    AKILL,
    ANNOUNCE
}

new gCommands[COMMANDS_MAIN];

public OnPlayerConnect(playerid)
{
 	new file[100],Name[MAX_PLAYER_NAME],Ip[16];
    GetPlayerName(playerid,Name,sizeof(Name));
    GetPlayerIp(playerid,Ip,sizeof(Ip));
    format(file,sizeof(file),PlayerFile,Name);

	if(!dini_Exists(file))
    {
    dini_Create(file);
    dini_Set(file,"Name",Name);
    dini_Set(file,"Ip",Ip);
	dini_IntSet(file,"Registered",-1);
	dini_IntSet(file,"Password",0);
	dini_IntSet(file,"Level",0);
	dini_IntSet(file,"Wired",0);
	dini_IntSet(file,"Jailed",0);
	else
	}
	strcat(gPlayerInfo[playerid][PLAYER_NAME],			    dini_Get(file,"Name"));
	strcat(gPlayerInfo[playerid][PLAYER_IP],			    dini_Get(file,"Ip"));
	gPlayerInfo[playerid][PLAYER_REGGED] 			      = dini_Int(file,"Registered");
	gPlayerInfo[playerid][PLAYER_PASS]                    = dini_Int(file,"Password");
	gPlayerInfo[playerid][PLAYER_LEVEL] 			      = dini_Int(file,"Level");
	gPlayerInfo[playerid][PLAYER_WIRED]                   = dini_Int(file,"Wired");
	gPlayerInfo[playerid][PLAYER_JAILED] 			      = dini_Int(file,"Jailed");
	if(gPlayerInfo[playerid][PLAYER_REGGED] == 0) 	        SendClientMessage(playerid,COLOUR_ORANGE,"You're username is recognised on this server, but you have not registered. Please /register to continue.");
	else if(gPlayerInfo[playerid][PLAYER_REGGED] == 1)      SendClientMessage(playerid,COLOUR_ORANGE,"You're username is recognised on this server. Please /login to continue.");
    gPlayerInfo[playerid][PLAYER_REGGED]                          = 0;
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	new file[100];
    format(file,sizeof(file),PlayerFile,gPlayerInfo[playerid][PLAYER_NAME]);
	dini_Set(file,"Name",gPlayerInfo[playerid][PLAYER_NAME]);
	dini_Set(file,"Ip",gPlayerInfo[playerid][PLAYER_IP]);
	dini_IntSet(file,"Registered",gPlayerInfo[playerid][PLAYER_REGGED]);
	dini_IntSet(file,"Password",gPlayerInfo[playerid][PLAYER_PASS]);
	dini_IntSet(file,"Level",gPlayerInfo[playerid][PLAYER_LEVEL]);
	dini_IntSet(file,"Wired",gPlayerInfo[playerid][PLAYER_WIRED]);
	dini_IntSet(file,"Jailed",gPlayerInfo[playerid][PLAYER_JAILED]);
	gPlayerInfo[playerid][PLAYER_NAME]   = 0;
	gPlayerInfo[playerid][PLAYER_IP]     = 0;
	gPlayerInfo[playerid][PLAYER_REGGED] = 0;
	gPlayerInfo[playerid][PLAYER_LOGGED] = 0;
	gPlayerInfo[playerid][PLAYER_PASS]   = 0;
	gPlayerInfo[playerid][PLAYER_LEVEL]  = 0;
	gPlayerInfo[playerid][PLAYER_WIRED]  = 0;
	gPlayerInfo[playerid][PLAYER_JAILED] = 0;
    	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(register, 8, cmdtext);
    dcmd(login, 5, cmdtext);
    dcmd(logout, 6, cmdtext);
    dcmd(password, 8, cmdtext);

    return 0;
}

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;
    if(gPlayerInfo[playerid][PLAYER_REGGED] == 1)
	return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You have already registered!");
	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);
    }
}

dcmd_login(playerid, params[])
{
    if(gPlayerInfo[playerid][PLAYER_REGGED] != 1)
	return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You must register first to do that! Use /register [password] to register and login.");
    else if(gPlayerInfo[playerid][PLAYER_LOGGED] == 1)
	return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You are already logged-in.");
    else if(!params[0])
	return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /login [password]");
    else
    {
	new password = num_hash(params);
	if(gPlayerInfo[playerid][PLAYER_PASS] == password)
	{
	    gPlayerInfo[playerid][PLAYER_LOGGED] = 1;
            GetPlayerIp(playerid, gPlayerInfo[playerid][PLAYER_IP], 16);
	    return SendClientMessage(playerid, COLOUR_LIGHTBLUE, "You have successfully logged in to your account.");
	}
	else
	    return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: Incorrect password.");
    }
}

dcmd_logout(playerid, params[])
{
    #pragma unused params
    if(gPlayerInfo[playerid][PLAYER_REGGED] != 1)
	return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You must register first to do that! Use /register [password] to register.");
    else if(gPlayerInfo[playerid][PLAYER_LOGGED] == 0)
	return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You are already logged-out.");
    else
    {
	gPlayerInfo[playerid][PLAYER_LOGGED] = 0;
	return SendClientMessage(playerid, COLOUR_LIGHTBLUE, "You have successfully logged out of your account.");
    }
}

dcmd_password(playerid, params[])
{
    if(gPlayerInfo[playerid][PLAYER_REGGED] != 1)
        return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You must register first to do that! Use /register [password] to register and login.");
    else if(gPlayerInfo[playerid][PLAYER_LOGGED] == 0)
	return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You must be logged-in to do that! Use /login [password] to login.");
    else
    {
	new tmp[30],
	    tmp2[30],
	    index;
	tmp = strtok(params, index);
	if(!strlen(tmp))
            return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /password [password] [new password]");
	tmp2 = strtok(params, index);
	if(!strlen(tmp2))
	    return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /password [password] [new password]");
        new oldpassword = num_hash(tmp), newpassword = num_hash(tmp2);
	if(gPlayerInfo[playerid][PLAYER_PASS] == oldpassword)
	{
	    if(oldpassword == newpassword)
	        return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: Your old password can not be the same as your new password.");
          else if(strlen(tmp2) < gSettings[PASS_MIN] || strlen(tmp2) > gSettings[PASS_MAX])
            {
                new string[100]; format(string, sizeof(string), "ERROR: Your new password must be between %d and %d characters long!", gSettings[PASS_MIN], gSettings[PASS_MAX]);
                return SendClientMessage(playerid, COLOUR_ORANGE, string);
            }
	    gPlayerInfo[playerid][PLAYER_PASS] = newpassword;
	    new string[128]; format(string, sizeof(string), "You have successfully changed your password from \'%s\' to \'%s\'.", tmp, tmp2);
	    return SendClientMessage(playerid, COLOUR_LIGHTBLUE, string);
	}
	else
	    return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: Incorrect password.");
    }
}

dcmd_akill(playerid, params[])
{
    if(gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[AKILL])
    {
        new string[100];
        format(string, sizeof(string), "You must be administrator level %d to use that command!", gCommands[AKILL]);
        return SendClientMessage(playerid, COLOUR_ORANGE, string);
    }
    else if(!strlen(params))
        return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /akill [id | name]");
    else
    {
	new id = (isNumeric(params)) ? strval(params) : GetPlayerId(params);
	if(IsPlayerConnected(id) && id != playerid)
	{
	    SetPlayerHealth(id, 0.0);
	    new string[128];
	    format(string, sizeof(string), "You have been admin-killed by administrator \'%s\'.", gPlayerInfo[playerid][PLAYER_NAME]);
	    SendClientMessage(id, COLOUR_ORANGE, string);
	    format(string, sizeof(string), "You have successfully admin-killed player \'%s\'.", gPlayerInfo[id][PLAYER_NAME]);
	    return SendClientMessage(playerid, COLOUR_LIGHTBLUE, string);
	}
	else
	    return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You can not admin-kill yourself or a disconnected player.");
    }
}

dcmd_announce(playerid, params[])
{
    if(gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[ANNOUNCE])
    {
        new string[100];
        format(string, sizeof(string), "You must be administrator level %d to use that command!", gCommands[ANNOUNCE]);
        return SendClientMessage(playerid, COLOUR_ORANGE, string);
    }
    else if(!strlen(params))
        return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /announce [message]");
    else
        return GameTextForAll(params, gSettings[ANNOUNCE_SECONDS] * 1000, 3);
}
And this are the errors:

Code:
C:\Documents and Settings\Symone\Desktop\adm.pwn(17) : error 017: undefined symbol "PLAYER_MAIN"
C:\Documents and Settings\Symone\Desktop\adm.pwn(17) : error 009: invalid array size (negative, zero or out of bounds)
C:\Documents and Settings\Symone\Desktop\adm.pwn(35) : error 017: undefined symbol "gSettings"
C:\Documents and Settings\Symone\Desktop\adm.pwn(36) : error 017: undefined symbol "gSettings"
C:\Documents and Settings\Symone\Desktop\adm.pwn(37) : error 017: undefined symbol "gSettings"
C:\Documents and Settings\Symone\Desktop\adm.pwn(38) : error 017: undefined symbol "gSettings"
C:\Documents and Settings\Symone\Desktop\adm.pwn(39) : error 017: undefined symbol "gSettings"
C:\Documents and Settings\Symone\Desktop\adm.pwn(48) : error 017: undefined symbol "gCommands"
C:\Documents and Settings\Symone\Desktop\adm.pwn(49) : error 017: undefined symbol "gCommands"
C:\Documents and Settings\Symone\Desktop\adm.pwn(51) : warning 219: local variable "gCommands" shadows a variable at a preceding level
C:\Documents and Settings\Symone\Desktop\adm.pwn(51) : error 017: undefined symbol "COMMANDS_MAIN"
C:\Documents and Settings\Symone\Desktop\adm.pwn(51) : error 009: invalid array size (negative, zero or out of bounds)
C:\Documents and Settings\Symone\Desktop\adm.pwn(51) : error 036: empty statement
C:\Documents and Settings\Symone\Desktop\adm.pwn(51) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


13 Errors
Thanks.
Face9000 is offline  
Old 13/12/2010, 08:19 AM   #2
silvan
Huge Clucker
 
Join Date: Oct 2007
Posts: 415
Reputation: 15
Default Re: WTF lots errors?What i've done wrong?

put the line:
Code:
new gCommands[COMMANDS_MAIN];
Before you use it.... remember, you need to first: define, then use. so " new " must be always be before the code that you're gonna work with.
__________________
Rep+ if my post helped, Thanks.
silvan is offline  
Old 13/12/2010, 08:22 AM   #3
Face9000
Banned
 
Join Date: Jan 2010
Location: Pigland
Posts: 3,351
Reputation: 190
Default Re: WTF lots errors?What i've done wrong?

Same problems...
Face9000 is offline  
Old 13/12/2010, 09:44 AM   #4
Scenario
Godfather
 
Scenario's Avatar
 
Join Date: Feb 2010
Location: Heaven
Posts: 7,801
Reputation: 701
Default Re: WTF lots errors?What i've done wrong?

You must have your enumerators at the top of the script and below them; their variables.
Scenario is offline  
Old 13/12/2010, 09:51 AM   #5
Face9000
Banned
 
Join Date: Jan 2010
Location: Pigland
Posts: 3,351
Reputation: 190
Default Re: WTF lots errors?What i've done wrong?

Done,now errors are 8.

Code:

Code:
#include <a_samp>
#include <dini>
#include <dutils>
#define adm
#if defined adm
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#define COLOUR_GREEN           0x33AA33AA
#define COLOUR_RED             0xAA3333AA
#define COLOUR_YELLOW          0xFFFF00AA
#define COLOUR_LIGHTBLUE       0x33CCFFAA
#define COLOUR_ORANGE          0xFF9900AA

#define PlayerFile 	       "Accounts/%s.dudb.sav"
#define SettingFile            "Adm/settings.ini"
#define CommandFile            "Adm/commands.ini"

enum PLAYER_MAIN {
	PLAYER_NAME[MAX_PLAYER_NAME],
	PLAYER_IP[16],
	PLAYER_REGGED,
	PLAYER_PASS,
	PLAYER_LOGGED,
	PLAYER_LEVEL,
	PLAYER_WIRED,
	PLAYER_JAILED
}

enum SETTINGS_MAIN {
    POCKET_MONEY,
    JAIL_COMMANDS,
    ANNOUNCE_SECONDS,
    PASS_MIN,
    PASS_MAX
}

enum COMMANDS_MAIN {
    AKILL,
    ANNOUNCE
}

new gPlayerInfo[MAX_PLAYERS][PLAYER_MAIN];

public OnFilterScriptInit()
{
 	print("\n****************************************");
	print("* CrazyAdmin loaded. *");
	print("****************************************\n");

    if(!fexist(SettingFile))
	{
		dini_Create(SettingFile);
		dini_IntSet(SettingFile, "PocketMoney", 3000);
		dini_IntSet(SettingFile, "JailCommands", 0);
		dini_IntSet(SettingFile, "AnnounceSeconds", 3);
		dini_IntSet(SettingFile, "PassMin", 3);
		dini_IntSet(SettingFile, "PassMax", 15);
	}

	gSettings[POCKET_MONEY] 		= dini_Int(SettingFile, "PocketMoney");
	gSettings[JAIL_COMMANDS] 		= dini_Int(SettingFile, "JailCommands");
	gSettings[ANNOUNCE_SECONDS] 	= dini_Int(SettingFile, "AnnounceSeconds");
	gSettings[PASS_MIN] 			= dini_Int(SettingFile, "PassMin");
	gSettings[PASS_MAX] 			= dini_Int(SettingFile, "PassMax");

	if(!fexist(CommandFile))
	{
		dini_Create(CommandFile);
		dini_IntSet(CommandFile, "Akill", 6);
		dini_IntSet(CommandFile, "Announce", 5);
        }

	gCommands[AKILL] 			= dini_Int(CommandFile, "Akill");
	gCommands[ANNOUNCE] 		= dini_Int(CommandFile, "Announce");

	new gCommands[COMMANDS_MAIN];

 	return 1;
}

    #endif

new gSettings[SETTINGS_MAIN];

new gCommands[COMMANDS_MAIN];

public OnPlayerConnect(playerid)
{
 	new file[100],Name[MAX_PLAYER_NAME],Ip[16];
    GetPlayerName(playerid,Name,sizeof(Name));
    GetPlayerIp(playerid,Ip,sizeof(Ip));
    format(file,sizeof(file),PlayerFile,Name);

	if(!dini_Exists(file))
    {
    dini_Create(file);
    dini_Set(file,"Name",Name);
    dini_Set(file,"Ip",Ip);
	dini_IntSet(file,"Registered",-1);
	dini_IntSet(file,"Password",0);
	dini_IntSet(file,"Level",0);
	dini_IntSet(file,"Wired",0);
	dini_IntSet(file,"Jailed",0);
	else
	}
	strcat(gPlayerInfo[playerid][PLAYER_NAME],			    dini_Get(file,"Name"));
	strcat(gPlayerInfo[playerid][PLAYER_IP],			    dini_Get(file,"Ip"));
	gPlayerInfo[playerid][PLAYER_REGGED] 			      = dini_Int(file,"Registered");
	gPlayerInfo[playerid][PLAYER_PASS]                    = dini_Int(file,"Password");
	gPlayerInfo[playerid][PLAYER_LEVEL] 			      = dini_Int(file,"Level");
	gPlayerInfo[playerid][PLAYER_WIRED]                   = dini_Int(file,"Wired");
	gPlayerInfo[playerid][PLAYER_JAILED] 			      = dini_Int(file,"Jailed");
	if(gPlayerInfo[playerid][PLAYER_REGGED] == 0) 	        SendClientMessage(playerid,COLOUR_ORANGE,"You're username is recognised on this server, but you have not registered. Please /register to continue.");
	else if(gPlayerInfo[playerid][PLAYER_REGGED] == 1)      SendClientMessage(playerid,COLOUR_ORANGE,"You're username is recognised on this server. Please /login to continue.");
    gPlayerInfo[playerid][PLAYER_REGGED]                          = 0;
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	new file[100];
    format(file,sizeof(file),PlayerFile,gPlayerInfo[playerid][PLAYER_NAME]);
	dini_Set(file,"Name",gPlayerInfo[playerid][PLAYER_NAME]);
	dini_Set(file,"Ip",gPlayerInfo[playerid][PLAYER_IP]);
	dini_IntSet(file,"Registered",gPlayerInfo[playerid][PLAYER_REGGED]);
	dini_IntSet(file,"Password",gPlayerInfo[playerid][PLAYER_PASS]);
	dini_IntSet(file,"Level",gPlayerInfo[playerid][PLAYER_LEVEL]);
	dini_IntSet(file,"Wired",gPlayerInfo[playerid][PLAYER_WIRED]);
	dini_IntSet(file,"Jailed",gPlayerInfo[playerid][PLAYER_JAILED]);
	gPlayerInfo[playerid][PLAYER_NAME]   = 0;
	gPlayerInfo[playerid][PLAYER_IP]     = 0;
	gPlayerInfo[playerid][PLAYER_REGGED] = 0;
	gPlayerInfo[playerid][PLAYER_LOGGED] = 0;
	gPlayerInfo[playerid][PLAYER_PASS]   = 0;
	gPlayerInfo[playerid][PLAYER_LEVEL]  = 0;
	gPlayerInfo[playerid][PLAYER_WIRED]  = 0;
	gPlayerInfo[playerid][PLAYER_JAILED] = 0;
    	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(register, 8, cmdtext);
    dcmd(login, 5, cmdtext);
    dcmd(logout, 6, cmdtext);
    dcmd(password, 8, cmdtext);

    return 0;
}

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;
    if(gPlayerInfo[playerid][PLAYER_REGGED] == 1)
	return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You have already registered!");
	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);
    }
}

dcmd_login(playerid, params[])
{
    if(gPlayerInfo[playerid][PLAYER_REGGED] != 1)
	return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You must register first to do that! Use /register [password] to register and login.");
    else if(gPlayerInfo[playerid][PLAYER_LOGGED] == 1)
	return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You are already logged-in.");
    else if(!params[0])
	return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /login [password]");
    else
    {
	new password = num_hash(params);
	if(gPlayerInfo[playerid][PLAYER_PASS] == password)
	{
	    gPlayerInfo[playerid][PLAYER_LOGGED] = 1;
            GetPlayerIp(playerid, gPlayerInfo[playerid][PLAYER_IP], 16);
	    return SendClientMessage(playerid, COLOUR_LIGHTBLUE, "You have successfully logged in to your account.");
	}
	else
	    return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: Incorrect password.");
    }
}

dcmd_logout(playerid, params[])
{
    #pragma unused params
    if(gPlayerInfo[playerid][PLAYER_REGGED] != 1)
	return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You must register first to do that! Use /register [password] to register.");
    else if(gPlayerInfo[playerid][PLAYER_LOGGED] == 0)
	return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You are already logged-out.");
    else
    {
	gPlayerInfo[playerid][PLAYER_LOGGED] = 0;
	return SendClientMessage(playerid, COLOUR_LIGHTBLUE, "You have successfully logged out of your account.");
    }
}

dcmd_password(playerid, params[])
{
    if(gPlayerInfo[playerid][PLAYER_REGGED] != 1)
        return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You must register first to do that! Use /register [password] to register and login.");
    else if(gPlayerInfo[playerid][PLAYER_LOGGED] == 0)
	return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You must be logged-in to do that! Use /login [password] to login.");
    else
    {
	new tmp[30],
	    tmp2[30],
	    index;
	tmp = strtok(params, index);
	if(!strlen(tmp))
            return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /password [password] [new password]");
	tmp2 = strtok(params, index);
	if(!strlen(tmp2))
	    return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /password [password] [new password]");
        new oldpassword = num_hash(tmp), newpassword = num_hash(tmp2);
	if(gPlayerInfo[playerid][PLAYER_PASS] == oldpassword)
	{
	    if(oldpassword == newpassword)
	        return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: Your old password can not be the same as your new password.");
          else if(strlen(tmp2) < gSettings[PASS_MIN] || strlen(tmp2) > gSettings[PASS_MAX])
            {
                new string[100]; format(string, sizeof(string), "ERROR: Your new password must be between %d and %d characters long!", gSettings[PASS_MIN], gSettings[PASS_MAX]);
                return SendClientMessage(playerid, COLOUR_ORANGE, string);
            }
	    gPlayerInfo[playerid][PLAYER_PASS] = newpassword;
	    new string[128]; format(string, sizeof(string), "You have successfully changed your password from \'%s\' to \'%s\'.", tmp, tmp2);
	    return SendClientMessage(playerid, COLOUR_LIGHTBLUE, string);
	}
	else
	    return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: Incorrect password.");
    }
}

dcmd_akill(playerid, params[])
{
    if(gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[AKILL])
    {
        new string[100];
        format(string, sizeof(string), "You must be administrator level %d to use that command!", gCommands[AKILL]);
        return SendClientMessage(playerid, COLOUR_ORANGE, string);
    }
    else if(!strlen(params))
        return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /akill [id | name]");
    else
    {
	new id = (isNumeric(params)) ? strval(params) : GetPlayerId(params);
	if(IsPlayerConnected(id) && id != playerid)
	{
	    SetPlayerHealth(id, 0.0);
	    new string[128];
	    format(string, sizeof(string), "You have been admin-killed by administrator \'%s\'.", gPlayerInfo[playerid][PLAYER_NAME]);
	    SendClientMessage(id, COLOUR_ORANGE, string);
	    format(string, sizeof(string), "You have successfully admin-killed player \'%s\'.", gPlayerInfo[id][PLAYER_NAME]);
	    return SendClientMessage(playerid, COLOUR_LIGHTBLUE, string);
	}
	else
	    return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You can not admin-kill yourself or a disconnected player.");
    }
}

dcmd_announce(playerid, params[])
{
    if(gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[ANNOUNCE])
    {
        new string[100];
        format(string, sizeof(string), "You must be administrator level %d to use that command!", gCommands[ANNOUNCE]);
        return SendClientMessage(playerid, COLOUR_ORANGE, string);
    }
    else if(!strlen(params))
        return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /announce [message]");
    else
        return GameTextForAll(params, gSettings[ANNOUNCE_SECONDS] * 1000, 3);
}
Errors:

Code:
C:\Documents and Settings\Symone\Desktop\adm.pwn(59) : error 017: undefined symbol "gSettings"
C:\Documents and Settings\Symone\Desktop\adm.pwn(60) : error 017: undefined symbol "gSettings"
C:\Documents and Settings\Symone\Desktop\adm.pwn(61) : error 017: undefined symbol "gSettings"
C:\Documents and Settings\Symone\Desktop\adm.pwn(62) : error 017: undefined symbol "gSettings"
C:\Documents and Settings\Symone\Desktop\adm.pwn(63) : error 017: undefined symbol "gSettings"
C:\Documents and Settings\Symone\Desktop\adm.pwn(72) : error 017: undefined symbol "gCommands"
C:\Documents and Settings\Symone\Desktop\adm.pwn(73) : error 017: undefined symbol "gCommands"
C:\Documents and Settings\Symone\Desktop\adm.pwn(75) : warning 219: local variable "gCommands" shadows a variable at a preceding level
C:\Documents and Settings\Symone\Desktop\adm.pwn(75) : warning 204: symbol is assigned a value that is never used: "gCommands"
C:\Documents and Settings\Symone\Desktop\adm.pwn(103) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Symone\Desktop\adm.pwn(137) : warning 217: loose indentation
C:\Documents and Settings\Symone\Desktop\adm.pwn(159) : warning 217: loose indentation
C:\Documents and Settings\Symone\Desktop\adm.pwn(160) : warning 217: loose indentation
C:\Documents and Settings\Symone\Desktop\adm.pwn(190) : warning 217: loose indentation
C:\Documents and Settings\Symone\Desktop\adm.pwn(191) : warning 217: loose indentation
C:\Documents and Settings\Symone\Desktop\adm.pwn(229) : warning 217: loose indentation
C:\Documents and Settings\Symone\Desktop\adm.pwn(230) : warning 217: loose indentation
C:\Documents and Settings\Symone\Desktop\adm.pwn(288) : warning 203: symbol is never used: "dcmd_akill"
C:\Documents and Settings\Symone\Desktop\adm.pwn(288) : warning 203: symbol is never used: "dcmd_announce"
C:\Documents and Settings\Symone\Desktop\adm.pwn(288) : warning 203: symbol is never used: "ret_memcpy"
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


8 Errors.
Face9000 is offline  
Old 13/12/2010, 10:05 AM   #6
Scenario
Godfather
 
Scenario's Avatar
 
Join Date: Feb 2010
Location: Heaven
Posts: 7,801
Reputation: 701
Default Re: WTF lots errors?What i've done wrong?

You are using the variable "gSettings" but it doesn't exist until the end of the script - it needs to be underneath the enumerator it goes along with. Same with the other variables...
Scenario is offline  
Old 13/12/2010, 10:18 AM   #7
Face9000
Banned
 
Join Date: Jan 2010
Location: Pigland
Posts: 3,351
Reputation: 190
Default Re: WTF lots errors?What i've done wrong?

So,what i need to do?
Face9000 is offline  
Old 13/12/2010, 10:35 AM   #8
Scenario
Godfather
 
Scenario's Avatar
 
Join Date: Feb 2010
Location: Heaven
Posts: 7,801
Reputation: 701
Default Re: WTF lots errors?What i've done wrong?

Read.
Scenario is offline  
Old 13/12/2010, 10:38 AM   #9
Face9000
Banned
 
Join Date: Jan 2010
Location: Pigland
Posts: 3,351
Reputation: 190
Default Re: WTF lots errors?What i've done wrong?

Done all.

Code:
#include <a_samp>
#include <dini>
#include <dutils>
#define adm
#if defined adm
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#define COLOUR_GREEN           0x33AA33AA
#define COLOUR_RED             0xAA3333AA
#define COLOUR_YELLOW          0xFFFF00AA
#define COLOUR_LIGHTBLUE       0x33CCFFAA
#define COLOUR_ORANGE          0xFF9900AA

#define PlayerFile 	       "Accounts/%s.dudb.sav"
#define SettingFile            "Adm/settings.ini"
#define CommandFile            "Adm/commands.ini"

enum PLAYER_MAIN {
	PLAYER_NAME[MAX_PLAYER_NAME],
	PLAYER_IP[16],
	PLAYER_REGGED,
	PLAYER_PASS,
	PLAYER_LOGGED,
	PLAYER_LEVEL,
	PLAYER_WIRED,
	PLAYER_JAILED
}

enum SETTINGS_MAIN {
    POCKET_MONEY,
    JAIL_COMMANDS,
    ANNOUNCE_SECONDS,
    PASS_MIN,
    PASS_MAX
}

enum COMMANDS_MAIN {
    AKILL,
    ANNOUNCE
}

new gSettings[SETTINGS_MAIN];
new gCommands[COMMANDS_MAIN];
new gPlayerInfo[MAX_PLAYERS][PLAYER_MAIN];

public OnFilterScriptInit()
{
 	print("\n****************************************");
	print("* CrazyAdmin loaded. *");
	print("****************************************\n");

    if(!fexist(SettingFile))
	{
		dini_Create(SettingFile);
		dini_IntSet(SettingFile, "PocketMoney", 3000);
		dini_IntSet(SettingFile, "JailCommands", 0);
		dini_IntSet(SettingFile, "AnnounceSeconds", 3);
		dini_IntSet(SettingFile, "PassMin", 3);
		dini_IntSet(SettingFile, "PassMax", 15);
	}

	gSettings[POCKET_MONEY] 		= dini_Int(SettingFile, "PocketMoney");
	gSettings[JAIL_COMMANDS] 		= dini_Int(SettingFile, "JailCommands");
	gSettings[ANNOUNCE_SECONDS] 	= dini_Int(SettingFile, "AnnounceSeconds");
	gSettings[PASS_MIN] 			= dini_Int(SettingFile, "PassMin");
	gSettings[PASS_MAX] 			= dini_Int(SettingFile, "PassMax");

	if(!fexist(CommandFile))
	{
		dini_Create(CommandFile);
		dini_IntSet(CommandFile, "Akill", 6);
		dini_IntSet(CommandFile, "Announce", 5);
        }

	gCommands[AKILL] 			= dini_Int(CommandFile, "Akill");
	gCommands[ANNOUNCE] 		= dini_Int(CommandFile, "Announce");

 	return 1;
}

    #endif

public OnPlayerConnect(playerid)
{
 	new file[100],Name[MAX_PLAYER_NAME],Ip[16];
    GetPlayerName(playerid,Name,sizeof(Name));
    GetPlayerIp(playerid,Ip,sizeof(Ip));
    format(file,sizeof(file),PlayerFile,Name);

	if(!dini_Exists(file))
    {
    dini_Create(file);
    dini_Set(file,"Name",Name);
    dini_Set(file,"Ip",Ip);
	dini_IntSet(file,"Registered",-1);
	dini_IntSet(file,"Password",0);
	dini_IntSet(file,"Level",0);
	dini_IntSet(file,"Wired",0);
	dini_IntSet(file,"Jailed",0);
	else }
	strcat(gPlayerInfo[playerid][PLAYER_NAME],			    dini_Get(file,"Name"));
	strcat(gPlayerInfo[playerid][PLAYER_IP],			    dini_Get(file,"Ip"));
	gPlayerInfo[playerid][PLAYER_REGGED] 			      = dini_Int(file,"Registered");
	gPlayerInfo[playerid][PLAYER_PASS]                    = dini_Int(file,"Password");
	gPlayerInfo[playerid][PLAYER_LEVEL] 			      = dini_Int(file,"Level");
	gPlayerInfo[playerid][PLAYER_WIRED]                   = dini_Int(file,"Wired");
	gPlayerInfo[playerid][PLAYER_JAILED] 			      = dini_Int(file,"Jailed");
	if(gPlayerInfo[playerid][PLAYER_REGGED] == 0) 	        SendClientMessage(playerid,COLOUR_ORANGE,"You're username is recognised on this server, but you have not registered. Please /register to continue.");
	else if(gPlayerInfo[playerid][PLAYER_REGGED] == 1)      SendClientMessage(playerid,COLOUR_ORANGE,"You're username is recognised on this server. Please /login to continue.");
    gPlayerInfo[playerid][PLAYER_REGGED]                          = 0;
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	new file[100];
    format(file,sizeof(file),PlayerFile,gPlayerInfo[playerid][PLAYER_NAME]);
	dini_Set(file,"Name",gPlayerInfo[playerid][PLAYER_NAME]);
	dini_Set(file,"Ip",gPlayerInfo[playerid][PLAYER_IP]);
	dini_IntSet(file,"Registered",gPlayerInfo[playerid][PLAYER_REGGED]);
	dini_IntSet(file,"Password",gPlayerInfo[playerid][PLAYER_PASS]);
	dini_IntSet(file,"Level",gPlayerInfo[playerid][PLAYER_LEVEL]);
	dini_IntSet(file,"Wired",gPlayerInfo[playerid][PLAYER_WIRED]);
	dini_IntSet(file,"Jailed",gPlayerInfo[playerid][PLAYER_JAILED]);
	gPlayerInfo[playerid][PLAYER_NAME]   = 0;
	gPlayerInfo[playerid][PLAYER_IP]     = 0;
	gPlayerInfo[playerid][PLAYER_REGGED] = 0;
	gPlayerInfo[playerid][PLAYER_LOGGED] = 0;
	gPlayerInfo[playerid][PLAYER_PASS]   = 0;
	gPlayerInfo[playerid][PLAYER_LEVEL]  = 0;
	gPlayerInfo[playerid][PLAYER_WIRED]  = 0;
	gPlayerInfo[playerid][PLAYER_JAILED] = 0;
    	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(register, 8, cmdtext);
    dcmd(login, 5, cmdtext);
    dcmd(logout, 6, cmdtext);
    dcmd(password, 8, cmdtext);

    return 0;
}

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;
    if(gPlayerInfo[playerid][PLAYER_REGGED] == 1)
	return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You have already registered!");
    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);
    }
}

dcmd_login(playerid, params[])
{
    if(gPlayerInfo[playerid][PLAYER_REGGED] != 1)
	return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You must register first to do that! Use /register [password] to register and login.");
    else if(gPlayerInfo[playerid][PLAYER_LOGGED] == 1)
	return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You are already logged-in.");
    else if(!params[0])
	return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /login [password]");
    else
    {
	new password = num_hash(params);
	if(gPlayerInfo[playerid][PLAYER_PASS] == password)
	{
	    gPlayerInfo[playerid][PLAYER_LOGGED] = 1;
            GetPlayerIp(playerid, gPlayerInfo[playerid][PLAYER_IP], 16);
	    return SendClientMessage(playerid, COLOUR_LIGHTBLUE, "You have successfully logged in to your account.");
	}
	else
	    return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: Incorrect password.");
    }
}

dcmd_logout(playerid, params[])
{
    #pragma unused params
    if(gPlayerInfo[playerid][PLAYER_REGGED] != 1)
	return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You must register first to do that! Use /register [password] to register.");
    else if(gPlayerInfo[playerid][PLAYER_LOGGED] == 0)
	return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You are already logged-out.");
    else
    {
	gPlayerInfo[playerid][PLAYER_LOGGED] = 0;
	return SendClientMessage(playerid, COLOUR_LIGHTBLUE, "You have successfully logged out of your account.");
    }
}

dcmd_password(playerid, params[])
{
    if(gPlayerInfo[playerid][PLAYER_REGGED] != 1)
        return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You must register first to do that! Use /register [password] to register and login.");
    else if(gPlayerInfo[playerid][PLAYER_LOGGED] == 0)
	return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You must be logged-in to do that! Use /login [password] to login.");
    else
    {
	new tmp[30],
	    tmp2[30],
	    index;
	tmp = strtok(params, index);
	if(!strlen(tmp))
            return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /password [password] [new password]");
	tmp2 = strtok(params, index);
	if(!strlen(tmp2))
	    return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /password [password] [new password]");
        new oldpassword = num_hash(tmp), newpassword = num_hash(tmp2);
	if(gPlayerInfo[playerid][PLAYER_PASS] == oldpassword)
	{
	    if(oldpassword == newpassword)
	        return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: Your old password can not be the same as your new password.");
          else if(strlen(tmp2) < gSettings[PASS_MIN] || strlen(tmp2) > gSettings[PASS_MAX])
            {
                new string[100]; format(string, sizeof(string), "ERROR: Your new password must be between %d and %d characters long!", gSettings[PASS_MIN], gSettings[PASS_MAX]);
                return SendClientMessage(playerid, COLOUR_ORANGE, string);
            }
	    gPlayerInfo[playerid][PLAYER_PASS] = newpassword;
	    new string[128]; format(string, sizeof(string), "You have successfully changed your password from \'%s\' to \'%s\'.", tmp, tmp2);
	    return SendClientMessage(playerid, COLOUR_LIGHTBLUE, string);
	}
	else
	    return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: Incorrect password.");
    }
}

dcmd_akill(playerid, params[])
{
    if(gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[AKILL])
    {
        new string[100];
        format(string, sizeof(string), "You must be administrator level %d to use that command!", gCommands[AKILL]);
        return SendClientMessage(playerid, COLOUR_ORANGE, string);
    }
    else if(!strlen(params))
        return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /akill [id | name]");
    else
    {
	new id = (isNumeric(params)) ? strval(params) : GetPlayerId(params);
	if(IsPlayerConnected(id) && id != playerid)
	{
	    SetPlayerHealth(id, 0.0);
	    new string[128];
	    format(string, sizeof(string), "You have been admin-killed by administrator \'%s\'.", gPlayerInfo[playerid][PLAYER_NAME]);
	    SendClientMessage(id, COLOUR_ORANGE, string);
	    format(string, sizeof(string), "You have successfully admin-killed player \'%s\'.", gPlayerInfo[id][PLAYER_NAME]);
	    return SendClientMessage(playerid, COLOUR_LIGHTBLUE, string);
	}
	else
	    return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You can not admin-kill yourself or a disconnected player.");
    }
}

dcmd_announce(playerid, params[])
{
    if(gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[ANNOUNCE])
    {
        new string[100];
        format(string, sizeof(string), "You must be administrator level %d to use that command!", gCommands[ANNOUNCE]);
        return SendClientMessage(playerid, COLOUR_ORANGE, string);
    }
    else if(!strlen(params))
        return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /announce [message]");
    else
        return GameTextForAll(params, gSettings[ANNOUNCE_SECONDS] * 1000, 3);
}
1 error:

Code:
C:\Documents and Settings\Symone\Desktop\adm.pwn(99) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Symone\Desktop\adm.pwn(132) : warning 217: loose indentation
C:\Documents and Settings\Symone\Desktop\adm.pwn(154) : warning 217: loose indentation
C:\Documents and Settings\Symone\Desktop\adm.pwn(155) : warning 217: loose indentation
C:\Documents and Settings\Symone\Desktop\adm.pwn(184) : warning 217: loose indentation
C:\Documents and Settings\Symone\Desktop\adm.pwn(185) : warning 217: loose indentation
C:\Documents and Settings\Symone\Desktop\adm.pwn(223) : warning 217: loose indentation
C:\Documents and Settings\Symone\Desktop\adm.pwn(224) : warning 217: loose indentation
C:\Documents and Settings\Symone\Desktop\adm.pwn(282) : warning 203: symbol is never used: "dcmd_akill"
C:\Documents and Settings\Symone\Desktop\adm.pwn(282) : warning 203: symbol is never used: "dcmd_announce"
C:\Documents and Settings\Symone\Desktop\adm.pwn(282) : warning 203: symbol is never used: "ret_memcpy"
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Face9000 is offline  
Old 13/12/2010, 10:48 AM   #10
Scenario
Godfather
 
Scenario's Avatar
 
Join Date: Feb 2010
Location: Heaven
Posts: 7,801
Reputation: 701
Default Re: WTF lots errors?What i've done wrong?

Code:
C:\Documents and Settings\Symone\Desktop\adm.pwn(132) : warning 217: loose indentation
C:\Documents and Settings\Symone\Desktop\adm.pwn(154) : warning 217: loose indentation
C:\Documents and Settings\Symone\Desktop\adm.pwn(155) : warning 217: loose indentation
C:\Documents and Settings\Symone\Desktop\adm.pwn(184) : warning 217: loose indentation
C:\Documents and Settings\Symone\Desktop\adm.pwn(185) : warning 217: loose indentation
C:\Documents and Settings\Symone\Desktop\adm.pwn(223) : warning 217: loose indentation
C:\Documents and Settings\Symone\Desktop\adm.pwn(224) : warning 217: loose indentation
Those simply mean you don't know how to indent correctly.

Code:
C:\Documents and Settings\Symone\Desktop\adm.pwn(282) : warning 203: symbol is never used: "dcmd_akill"
C:\Documents and Settings\Symone\Desktop\adm.pwn(282) : warning 203: symbol is never used: "dcmd_announce"
You should review your "OnPlayerCommandText" callback and see where it has DCMD things - you should be able to see what is missing.

Code:
C:\Documents and Settings\Symone\Desktop\adm.pwn(99) : error 029: invalid expression, assumed zero
Which line is line 99?

Code:
C:\Documents and Settings\Symone\Desktop\adm.pwn(282) : warning 203: symbol is never used: "ret_memcpy"
I take it you are using dini which is always a bad idea. You need this:

pawn Code:
#pragma unused ret_memcpy
Scenario is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Lots Of Errors John_Cooper Help Archive 4 29/07/2010 09:00 AM
Making a weapon command, lots of errors biltong Help Archive 8 03/03/2010 07:02 PM
Out of the Blue,Lots of errors . Piiilu Help Archive 2 16/10/2009 06:43 PM
Lots of crappy errors XxJoexX Help Archive 6 06/09/2009 12:33 AM
Lots of errors Klutty Help Archive 7 31/05/2009 09:47 PM


All times are GMT. The time now is 01:17 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.