admin include problem
#1

i want to test if my admin.inc is functioning...

this is my admin.inc
Код:
Admin Include v0.10
©Armageddon@Rexz
-------------------------------------------------
================================================================================
*/

//==============================================================================
// Administration
//==============================================================================


stock PlayerInfo(playerid, pAdmin)
{
	new tmp;
	new string[128],playername[MAX_PLAYER_NAME];
	GetPlayerName(playerid,playername,sizeof(playername));
	format( string, sizeof(string),PATH,playername);
	INI_Int("Admin", tmp;);
	if((IsPlayerConnected(playerid)) && (tmp >= 1) && (tmp!= 0))
	return string;
	else return false;
}
i create a new command to test if it work..
Код:
CMD:test(playerid, params[])
{
	if(PlayerInfo(playerid, 1)
	{
	    SendClientMessage(playerid, 0x0, "tax purposes");
	}
	return 1;
}
but i got this error
Код:
C:\Users\Armageddon\Desktop\Samp Server RC6\pawno\include\Aadmin.inc(35) : error 017: undefined symbol "name"
C:\Users\Armageddon\Desktop\Samp Server RC6\pawno\include\Aadmin.inc(35) : error 079: inconsistent return types (array & non-array)
C:\Users\Armageddon\Desktop\Samp Server RC6\pawno\include\Aadmin.inc(35) : error 029: invalid expression, assumed zero
C:\Users\Armageddon\Desktop\Samp Server RC6\pawno\include\Aadmin.inc(35) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#2

Your include problem. goto your include then defind name( Name ) thats it
Reply
#3

like this ??

Код:
 #if defined _Aadmin_included
  #endinput
#endif
#define _Aadmin_included
#pragma library ladmin

#include <a_samp>
#include <YSI\y_ini>
#define name

#define PATH "/Users/%s.ini"



/*
================================================================================
-------------------------------------------------

Admin Include v0.10
©Armageddon@Rexz
-------------------------------------------------
================================================================================
*/

//==============================================================================
// Administration
//==============================================================================


stock PlayerInfo(playerid, pAdmin)
{
	new tmp;
	new string[128],playername[MAX_PLAYER_NAME];
	GetPlayerName(playerid,playername,sizeof(playername));
	format( string, sizeof(string),PATH,playername);
	INI_Int("Admin", tmp;);
	if((IsPlayerConnected(playerid)) && (tmp >= 1) && (tmp!= 0))
	return string;
	else return false;
}
Reply
#4

Why are you using a stock? You should make an enum instead
Reply
#5

Ye. is it work? if not try with
Код:
new name
Reply
#6

now i got this error

Код:
C:\Users\Armageddon\Desktop\Samp Server RC6\pawno\include\Aadmin.inc(36) : error 029: invalid expression, assumed zero
C:\Users\Armageddon\Desktop\Samp Server RC6\pawno\include\Aadmin.inc(36) : warning 215: expression has no effect
C:\Users\Armageddon\Desktop\Samp Server RC6\pawno\include\Aadmin.inc(36) : error 001: expected token: ";", but found ")"
C:\Users\Armageddon\Desktop\Samp Server RC6\pawno\include\Aadmin.inc(36) : error 029: invalid expression, assumed zero
C:\Users\Armageddon\Desktop\Samp Server RC6\pawno\include\Aadmin.inc(36) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#7

can someone compile me a working code..
Reply
#8

Your errors in the first post make more sense. Except for the 'name' variable since it doesn't even get called.

The inconsistent types are:
variable 'string': which is an array of chars
variable 'false': which is a boolean

So you should either return true on the string, or return an empty string on the false.

Since you are using it in an 'if'-statement, I'd recommend replacing the 'string' return with a 'true' boolean.

The 'define name' and 'new name' don't make sense in this case and does not address the real issue.
Reply
#9

and the problem still persist..i think i just make all in one gamemode .I need to change the admin system to another filterscript so the server can run efficiently..
Reply
#10

Код:
stock PlayerInfo(playerid, pAdmin)
{
	new tmp;
	new string[128],playername[MAX_PLAYER_NAME];
	GetPlayerName(playerid,playername,sizeof(playername));
	format( string, sizeof(string),PATH,playername);
	INI_Int("Admin", tmp);
	if((IsPlayerConnected(playerid)) && (tmp >= 1)) {
            return true;
	} else { 
            return false;
        }
}
This should work. I have removed an extra semi-colon at the INI_Int line, and removed the tmp != 0, since the tmp >=1 takes care of it already.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)