Admin help
#1

Код:
#include <a_samp>
#include <dini>




#define FILTERSCRIPT
#if defined FILTERSCRIPT
#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 	    "AdminScript/Users/%s.ini"
#define SettingFile      "AdminScript/Settings/MainSettings.ini"
#define CommandFile      "AdminScript/Settings/Commands.ini"

public OnFilterScriptInit()
  {
 	print("\n****************************************");
	print("* Admin Script *");
	print("****************************************\n");
 	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
}

new gPlayerInfo[MAX_PLAYERS][PLAYER_MAIN];


public OnPlayerConnect(playerid)
{

	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.");

	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);
		SendClientMessage(playerid,COLOUR_ORANGE,"Please /register to continue.");
	}
	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;
}
Код:
C:\Documents and Settings\Administrator\Desktop\Admin.pwn(99) : error 017: undefined symbol "dcmd_register"
C:\Documents and Settings\Administrator\Desktop\Admin.pwn(100) : error 017: undefined symbol "dcmd_login"
C:\Documents and Settings\Administrator\Desktop\Admin.pwn(101) : error 017: undefined symbol "dcmd_logout"
C:\Documents and Settings\Administrator\Desktop\Admin.pwn(102) : error 017: undefined symbol "dcmd_password"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Please help
Reply
#2

You don't have those commands in your script. You will have to make them like:
pawn Код:
dcmd_register(playerid, params[])
{
  // code here
  return 1;
}
Reply
#3

I can see you're fallowing wiki. If you read ahead, then you'll notice that they give you the commands you need to have thoes commands.
Reply
#4

Oh i see it thx
Reply
#5

http://pastebin.com/f53e4a925
Sory for dobule post and i didnt want to make another topic so i made it in this topic...
Can you please help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)