SA-MP Forums Archive
ZCMD Script - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: ZCMD Script (/showthread.php?tid=153868)



ZCMD Script - Gette - 11.06.2010

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.


Re: ZCMD Script - Gette - 12.06.2010

Bump


Re: ZCMD Script - Carvos - 12.06.2010

You have put the filterscript into the server config?


Re: ZCMD Script - wEstSidЂ - 12.06.2010

Login to rcon and try this:

/rcon loadfs "filterscript name"


Re: ZCMD Script - cessil - 12.06.2010

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


Re: ZCMD Script - iggy1 - 12.06.2010

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.


Re: ZCMD Script - cessil - 12.06.2010

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