Help in FS WeaponLicense
#1

Hey I've made a Weapon License system will be good to my script and I dont find any Defines I should to add and the COmmand doesnt work in server check it please :


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

#include <a_samp>
#include <zcmd>

#if defined FILTERSCRIPT



public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" By Yarin0600 - WeaponLicenseSystem");
	print("--------------------------------------\n");
	return 1;
}


CMD:giveweaponlicense(playerid, params[])
{
	if(IsACop(playerid)
	{
		new string[128], giveplayerid, type;
		if(sscanf(params, "ud", giveplayerid, type))
		{
			SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /givelicense [playerid] [type]");
			SendClientMessageEx(playerid, COLOR_GRAD2, "Types: 1 = Weapon
			return 1;
		}

		if(!IsPlayerConnected(giveplayerid))
		{
			SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid player specified.");
			return 1;
		}
		new year, month, day, hour, minute, second;

		switch(type)
		{

			case 1:
			{
				if(PlayerInfo[giveplayerid][pWeaponLicense] == 1)
				{
					SendClientMessageEx(playerid, COLOR_GRAD2, "This player already has a weapon license.");
					return 1;
				}
				format(string, sizeof(string), "You have given a weapon license to %s.",GetPlayerNameEx(giveplayerid));
				SendClientMessageEx(playerid, COLOR_WHITE, string);
				format(string, sizeof(string), "The Officer %s has given you a weapon license.",GetPlayerNameEx(playerid));
				SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
				gettime(hour,minute,second);
				getdate(year,month,day);
				format(string, sizeof(string), "[%d/%d/%d][%d:%d:%d] Officer %s has given a weapon license to %s.",day,month,year,hour,minute,second,GetPlayerNameEx(playerid),GetPlayerNameEx(giveplayerid));
				Log("logs/licenses.log", string);
				PlayerInfo[giveplayerid][pWeaponLicense] = 1;
				return 1;
			}

public OnFilterScriptExit()
{
	return 1;
}


#endif
Reply
#2

I saw your script, I compiled it and I got 7 errors. Send me your whole script via PM.

+: Maybe you need to uncomment //#define FILTERSCRIPT . ['//#define FILTERSCRIPT' to '#define FILTERSCRIPT']
Reply
#3

Uncomment

pawn Код:
#define FILTERSCRIPT
Reply
#4

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


#include <a_samp>
#include <streamer>
#include <a_zones>
#include <yom_buttons>
#include <foreach>
#include <djson>
#include <progress>
#include <YSI\y_timers>
#include <ZCMD>
#include <sscanf2>
#include <audio>
#include <YSI\y_ini>


IsACop(playerid)
{
	if(IsPlayerConnected(playerid))
	{
		new leader = PlayerInfo[playerid][pLeader];
		new member = PlayerInfo[playerid][pMember];
		if(member==1 || member==2 || member== 3 || member==5 || member==3 || member==6 || member==7 || member==11 || member==13)
		{
			return 1;
		}
		else if(leader==1 || leader==2 || leader == 3 || leader==5 || leader==3 || leader==6 || leader==7 || leader==11 || leader==13)
		{
			return 1;
		}
	}



#if defined FILTERSCRIPT

new IsACop;


public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" By Yarin0600 - WeaponLicenseSystem");
	print("--------------------------------------\n");
	return 1;
}


CMD:giveweaponlicense(playerid, params[])
{
	if(IsACop(playerid)
	{
		new string[128], giveplayerid, type;
		if(sscanf(params, "ud", giveplayerid, type))
		{
			SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /givelicense [playerid] [type]");
			SendClientMessageEx(playerid, COLOR_GRAD2, "Types: 1 = Weapon
			return 1;
		}

		if(!IsPlayerConnected(giveplayerid))
		{
			SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid player specified.");
			return 1;
		}
		new year, month, day, hour, minute, second;

		switch(type)
		{

			case 1:
			{
				if(PlayerInfo[giveplayerid][pWeaponLicense] == 1)
				{
					SendClientMessageEx(playerid, COLOR_GRAD2, "This player already has a weapon license.");
					return 1;
				}
				format(string, sizeof(string), "You have given a weapon license to %s.",GetPlayerNameEx(giveplayerid));
				SendClientMessageEx(playerid, COLOR_WHITE, string);
				format(string, sizeof(string), "The Officer %s has given you a weapon license.",GetPlayerNameEx(playerid));
				SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
				gettime(hour,minute,second);
				getdate(year,month,day);
				format(string, sizeof(string), "[%d/%d/%d][%d:%d:%d] Officer %s has given a weapon license to %s.",day,month,year,hour,minute,second,GetPlayerNameEx(playerid),GetPlayerNameEx(giveplayerid));
				Log("logs/licenses.log", string);
				PlayerInfo[giveplayerid][pWeaponLicense] = 1;
				return 1;
			}

public OnFilterScriptExit()
{
	return 1;
}


#endif
This is works but the CMD doesnt work inside the server...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)