16.01.2010, 10:42
Quote:
Originally Posted by braduz
there was only 1 file included
|
http://forum.sa-mp.com/index.php?topic=145196.0
Originally Posted by braduz
there was only 1 file included
|
#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; }