ZCMD Script
#1

Hi, I have been trying to figure out this problem I currently have.

Code:
// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT

#include <a_samp>
#include <zcmd>
#include <sscanf2>
#if defined FILTERSCRIPT
#define ORANGE 		0xF97804FF
#define RED 		0xE60000FF
#define YELLOW 		0xFFFF00FF
#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 invalidcmd SendClientMessage(playerid,RED,"Invalid Command, Use /commands to see all commands");
public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Script Loaded");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" Test");
	print("----------------------------------\n");
}

#endif


public OnGameModeExit()
{
    print("\n--------------------------------------");
	print(" Incinirate");
	print("--------------------------------------\n");
	return 1;
}


 	CMD:incinerate(playerid,params[])
	{
	new id, string[128], aname[MAX_PLAYER_NAME], pname[MAX_PLAYER_NAME];
 	if(IsPlayerAdmin(playerid)) return invalidcmd
	if(sscanf(params,"u",id)) return SendClientMessage(playerid,ORANGE,"Usage: /incinerate [id]");
  	if(!IsPlayerConnected(id)) return SendClientMessage(playerid,RED,"invalid user");
  	ApplyAnimation(playerid, "shop", "ROB_Loop_Threat", 6.0, 0, 0, 0, 0, 0);
	new Float:x, Float:y, Float:z;
	GetPlayerPos(id,x,y,z);
	CreateExplosion(x,y,z,12,1);
	GetPlayerName(playerid,aname,sizeof(aname));
	GetPlayerName(id,pname,sizeof(pname));
	format(string,sizeof(string),"%s(%d) exploded %s(%d)",aname,playerid,pname,id);
 	SendClientMessage(playerid,RED,string);
	return 1;
	}
The problem here is that the server doesn't recognize the filterscript, whenever I type /incinerate it says "Server: Unknown Command". I already logged-in as a rcon admin but still doesn't work. I could really use some help over here fellas.
Reply
#2

Bump
Reply
#3

You have put the filterscript into the server config?
Reply
#4

Login to rcon and try this:

/rcon loadfs "filterscript name"
Reply
#5

also get rid of
Code:
public OnGameModeExit()
{
    print("\n--------------------------------------");
	print(" Incinirate");
	print("--------------------------------------\n");
	return 1;
}
as its a filterscript not a game mode
Reply
#6

Im not sure but i dont think ur meant to use dcmd and zcmd in the same FS (im no expert i may be wrong) dcmd uses OnPlayerCommandText and zcmd does not. You probably have the OnPlayerCommandText callback in your script. So when u do a command it will call OnPlayerCommandText and not zcmd.
Reply
#7

Quote:
Originally Posted by iggy1
Im not sure but i dont think ur meant to use dcmd and zcmd in the same FS (im no expert i may be wrong) dcmd uses OnPlayerCommandText and zcmd does not. You probably have OnPlayerCommandText in your script.
ah yeah I didn't notice that, I think zcmd just uses it in a different way so you don't use the OnPlayerCommandText
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)