[FilterScript] [FS] Bomber script / MapAndreas usage example
#27

Hi, i like very your FS and i have make it with your ideas to understand how this work, but i have a problem when i press the FIRE_KEY this make nothing 0_0 and make lag the map but not the computer, the map bug and after few time this stop bug but nothing please can you help me ?


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

#define MAX_ROCKET 150
new Rocket[MAX_PLAYERS][MAX_ROCKET];
new Bomb[MAX_PLAYERS];


#define RELEASED(%0) \
	(((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))

#define PRESSED(%0) \
	(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))


public OnFilterScriptInit()
{
	MapAndreas_Init(2);

	print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}


public OnPlayerRequestClass(playerid, classid)
{
	return 1;
}

public OnPlayerConnect(playerid)
{
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/mycmd", cmdtext, true, 10) == 0)
	{
		return 1;
	}
	return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if(RELEASED(KEY_FIRE))
	{
		KillTimer(Bomb[playerid]);
		return 1;
	}
	else if(PRESSED(KEY_FIRE))
	{
		if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 592 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 553 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 476)
		{
			new Float:X,Float:Y,Float:Z,Float:FZ;
			GetPlayerPos(playerid, X, Y, Z);
			MapAndreas_FindZ_For2DCoord(X, Y, FZ);
	 		if(FZ < (Z - 2.0))
	 		{
				Bomb[playerid] = SetTimerEx("Bombing", 100, true, "i", playerid);
			}
			else
			{
	 			SendClientMessage(playerid, 0xFFFFFFFF, "Your current Z co-ord is lower than the ground Z co-ordinate - offset!");
	 			SendClientMessage(playerid, 0xFFFFFFFF, "Make sure you're not landed nor below bridges/inside buildings");
			}
			return 1;
		}
	}

	return 1;
}


forward Bombing(playerid);
public Bombing(playerid)
{
	for(new RocketID=0;RocketID<MAX_ROCKET;RocketID++)
	{
		new Float:X,Float:Y,Float:Z,Float:FZ;
		GetPlayerPos(playerid, X, Y, Z);
		Rocket[playerid][RocketID] = CreateObject(3790, X, Y, Z-2.0, 0.0, 0.0, 0.0);
		MapAndreas_FindZ_For2DCoord(X, Y, FZ);
		MoveObject(Rocket[playerid][RocketID], X, Y, FZ, 5.0);
	}
	return 1;
}


public OnObjectMoved(objectid)
{
	for(new pid=0;pid<MAX_PLAYERS;pid++)
	{
 		for(new RocketID=0;RocketID<MAX_ROCKET;RocketID++)
 		{
  			if(Rocket[pid][RocketID] == objectid)
  			{
   			new Float:X, Float:Y, Float:Z;
				GetObjectPos(objectid, X, Y, Z);
				WhenBombTuchGround(X, Y, Z);
				DestroyObject(objectid);
				Rocket[pid][RocketID] = 0;
	    }
	  }
	}
}

forward WhenBombTuchGround(Float:X, Float:Y, Float:Z);
public WhenBombTuchGround(Float:X, Float:Y, Float:Z)
{
  CreateExplosion(X, Y, Z, 7, 2.0);
  return 1;
}
Reply


Messages In This Thread
[FS] Bomber script / MapAndreas usage example - by krisk - 12.01.2010, 21:20
Re: [FS] Bomber script / MapAndreas usage example - by Jese - 12.01.2010, 21:29
Re: [FS] Bomber script / MapAndreas usage example - by Guedes747 - 12.01.2010, 22:38
Re: [FS] Bomber script / MapAndreas usage example - by Retardedwolf - 13.01.2010, 08:05
Re: [FS] Bomber script / MapAndreas usage example - by dugi - 13.01.2010, 09:20
Re: [FS] Bomber script / MapAndreas usage example - by Correlli - 13.01.2010, 09:22
Re: [FS] Bomber script / MapAndreas usage example - by krisk - 13.01.2010, 09:33
Re: [FS] Bomber script / MapAndreas usage example - by _MaX_PaYnE_ - 13.01.2010, 09:41
Re: [FS] Bomber script / MapAndreas usage example - by NeRoSiS - 13.01.2010, 09:59
Re: [FS] Bomber script / MapAndreas usage example - by Giacomand - 13.01.2010, 10:36
Re: [FS] Bomber script / MapAndreas usage example - by _Gangster_ - 13.01.2010, 10:51
Re: [FS] Bomber script / MapAndreas usage example - by killerx100 - 13.01.2010, 11:05
Re: [FS] Bomber script / MapAndreas usage example - by Sayaron - 13.01.2010, 13:01
Re: [FS] Bomber script / MapAndreas usage example - by Karlip - 13.01.2010, 13:53
Re: [FS] Bomber script / MapAndreas usage example - by Kurence - 13.01.2010, 13:56
Re: [FS] Bomber script / MapAndreas usage example - by [03]Garsino - 13.01.2010, 13:57
Re: [FS] Bomber script / MapAndreas usage example - by [KMA]Lord_Deji - 13.01.2010, 14:18
Re: [FS] Bomber script / MapAndreas usage example - by braduz - 16.01.2010, 10:33
Re: [FS] Bomber script / MapAndreas usage example - by [03]Garsino - 16.01.2010, 10:36
Re: [FS] Bomber script / MapAndreas usage example - by braduz - 16.01.2010, 10:41
Re: [FS] Bomber script / MapAndreas usage example - by [03]Garsino - 16.01.2010, 10:42
Re: [FS] Bomber script / MapAndreas usage example - by DiddyBop - 17.01.2010, 04:40
Re: [FS] Bomber script / MapAndreas usage example - by ^Woozie^ - 19.01.2010, 11:51
Re: [FS] Bomber script / MapAndreas usage example - by MenaceX^ - 19.01.2010, 12:00
Re: [FS] Bomber script / MapAndreas usage example - by John Rockie - 26.01.2010, 00:16
Re: [FS] Bomber script / MapAndreas usage example - by Flake. - 26.01.2010, 00:45
Re: [FS] Bomber script / MapAndreas usage example - by TheDarkWolf18 - 29.01.2010, 17:02
Re: [FS] Bomber script / MapAndreas usage example - by -John- - 29.01.2010, 17:05
Re: [FS] Bomber script / MapAndreas usage example - by The_Moddler - 26.11.2010, 22:50
Re: [FS] Bomber script / MapAndreas usage example - by Emirt - 10.07.2011, 12:12
Re: [FS] Bomber script / MapAndreas usage example - by yaniv4560 - 10.07.2011, 20:48
Re: [FS] Bomber script / MapAndreas usage example - by yaniv4560 - 11.07.2011, 10:54
Re: [FS] Bomber script / MapAndreas usage example - by FANEX - 11.07.2011, 11:02

Forum Jump:


Users browsing this thread: 8 Guest(s)