Szerző Téma: Checkpoint  (Megtekintve 674 alkalommal)

Checkpoint
« Dátum: 2010. április 06. - 14:18:30 »
0 Show voters
Üdv all!!!
Nos,az lenne a gondon,hogy átszerkesztettem egy modot(Bomb Da Base II) és amikor bemegyek a checkpoint-ba támadóként,
akkor nem jelez senkinek se semmit,h a bomba ellet helyezve,meg nem robban semmi 10 mp után..
A PAWN nem jelez hibátse,meg semmi..
1szeruen nem tom ki szúrni h mi a hiba :/
Pls csináljátok meg nkm,me nkm vmé nem megy :\'(
Itt a mod:
 
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#define TEAM_ATTACK 1
#define TEAM_DEFEND 2
#define OBJECTIVE_COLOR 0x0000FFAA
#define TEAM_DEFEND_COLOR 0x009FFFFF
#define TEAM_ATTACK_COLOR 0x0000FFAA
#define COLOR_AQUA 0x00FFFFAA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_BEIGE 0xFFF8DCAA
#define COLOR_BLACK 0x000000AA
#define COLOR_BLUE 0x0000FFAA
#define COLOR_BLUELIGHTER 0x00BFFFAA
#define COLOR_BLUELIGHT 0x1E90FFAA
#define COLOR_BLUEMEDIUM 0x0000CDAA
#define COLOR_BLUEDARK 0x00008BAA
#define COLOR_PINKLIGHT 0xFF1493AA
#define COLOR_PINKDARK 0xFF00FFAA
#define COLOR_GREEN 0x008000AA
#define COLOR_GREENLIGHT 0x00FF00AA
#define COLOR_GREENDARK 0x006400AA
#define COLOR_MAROON 0x800000AA
#define COLOR_OKER 0x808000AA
#define COLOR_ORANGEDARK 0xFF4500AA
#define COLOR_ORANGELIGHT 0xFF8C00AA
#define COLOR_PURPLE 0x800080AA
#define COLOR_VIOLETDARK 0x9400D3AA
#define COLOR_INDIGO 0xAB0082AA
#define COLOR_RED 0xFF0000AA
#define COLOR_SAND 0xFFDEADAA
#define COLOR_SILVER 0xC0C0C0AA
#define COLOR_TEAL 0x008080AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_GOLD 0xFFD700AA
#define COLOR_BROWN 0x8B4513AA
#define COLOR_BROWNLIGHT 0xA0522DAA
#define COLOR_GRAY 0xA9A9A9AA
#define COLOR_GRAYDARK 0x696969AA
#define COLOR_INVISIBLE 0xFFFFFF00
forward SetPlayerToTeamColor(playerid);
forward SetPlayerTeamFromClass(playerid,classid);
forward Robbanas();
forward ExitTheGameMode();
forward Viszaszam(playerid);
forward Finish();
static gTeam[MAX_PLAYERS];
new player[MAX_PLAYER_NAME];
new killer[MAX_PLAYER_NAME];
new str[128];
new gObjectiveReached=0;
main()
{
print(\"\\n--------------------------\");
print(\"NightHawk Mode By Volum3\");
print(\"MAP: NightHawk, By: Volum3\");
print(\"--------------------------\\n\");
}
public Finish()
{
SetTimer(\"ExitTheGameMode\", 10000, 0);
GameTextForAll(\"~w~a ~b~vedekezok ~w~nyertek\",10000,0);
SendClientMessageToAll(COLOR_BLUELIGHT,\"10 MÁSODPERC MÚLVA MAP VÁLTÁS\");
return 1;
}
public OnGameModeInit()
{
SetGameModeText(\"NightHawk\");
SendRconCommand(\"mapname NightHawk\");
   SetTimer(\"Finish\", 600000, 0);
//Egyéb
UsePlayerPedAnims();
ShowPlayerMarkers(0);
ShowNameTags(2);
SetWorldTime(22);
SetWeather(20);
//ATTACK
AddPlayerClass(48,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(60,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(73,0,0,0,0,0,0,0,0,0,0);
//DEFEND
AddPlayerClass(114,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(115,0,0,0,0,0,0,0,0,0,0);
AddPlayerClass(116,0,0,0,0,0,0,0,0,0,0);
//Health Pickupok
AddStaticPickup(1240,2,1786.280,-1797.617,3.403,-1);
AddStaticPickup(1240,2,1736.972,-1798.084,3.288,-1);
//Map
CreateObject(6969,1890.326,-1814.487,4.279,0.0,0.0,-192.969);
CreateObject(6969,1621.818,-1778.480,4.248,0.0,0.0,-9.454);
CreateObject(7379,1638.796,-1760.318,2.958,0.0,0.0,-102.969);
CreateObject(7379,1615.558,-1767.166,2.953,0.0,0.0,-11.250);
CreateObject(3616,1635.885,-1771.772,5.911,0.0,0.0,-191.250);
CreateObject(3616,1873.671,-1829.074,5.942,0.0,0.0,-15.625);
CreateObject(987,1892.578,-1824.851,2.984,0.0,-0.859,-104.688);
CreateObject(987,1893.966,-1818.936,3.059,0.0,0.0,-103.828);
CreateObject(1228,1837.178,-1809.431,3.406,0.0,0.0,-11.250);
CreateObject(1228,1828.951,-1814.176,3.406,0.0,0.0,-11.250);
CreateObject(925,1838.455,-1813.251,4.046,0.0,0.0,-101.250);
CreateObject(944,1818.327,-1804.468,3.869,0.0,0.0,-101.250);
CreateObject(1685,1803.680,-1813.067,3.734,0.0,0.0,-11.250);
CreateObject(2567,1797.319,-1806.261,4.912,0.0,0.0,-101.250);
CreateObject(2669,1786.133,-1798.185,4.325,0.0,0.0,-11.250);
CreateObject(3565,1759.001,-1796.870,4.332,0.0,0.0,-123.750);
CreateObject(3571,1747.972,-1794.378,4.332,0.0,0.0,-56.250);
CreateObject(3577,1741.915,-1787.270,3.767,0.0,0.0,0.0);
CreateObject(3576,1771.132,-1794.889,4.477,0.0,0.0,0.0);
CreateObject(3576,1735.051,-1796.107,4.484,0.0,0.0,-33.750);
CreateObject(3633,1737.352,-1789.862,3.459,0.0,0.0,-22.500);
CreateObject(3761,1725.033,-1791.670,4.990,0.0,0.0,-33.750);
CreateObject(925,1666.190,-1768.609,4.032,0.0,0.0,-90.000);
CreateObject(931,1672.666,-1782.074,4.024,0.0,0.0,-112.500);
CreateObject(849,1678.640,-1782.384,3.276,0.0,0.0,-67.500);
CreateObject(912,1695.593,-1787.645,3.552,0.0,0.0,-78.750);
CreateObject(923,1706.557,-1789.162,3.867,0.0,0.0,-90.000);
CreateObject(922,1712.635,-1781.500,3.870,0.0,0.0,-112.500);
CreateObject(939,1699.765,-1781.616,5.423,0.0,0.0,-90.000);
CreateObject(1299,1681.778,-1776.286,3.427,0.0,0.0,-33.750);
CreateObject(1358,1673.878,-1772.129,4.177,0.0,0.0,56.250);
CreateObject(1438,1688.445,-1783.379,3.008,0.0,0.0,-56.250);
CreateObject(1441,1735.167,-1786.203,3.636,0.0,0.0,-101.250);
CreateObject(3594,1719.788,-1783.624,3.616,0.0,0.0,-56.250);
CreateObject(12957,1783.527,-1807.301,3.863,0.0,0.0,90.000);
CreateObject(849,1830.994,-1816.635,3.284,0.0,0.0,-67.500);
CreateObject(925,1851.062,-1823.656,4.046,0.0,0.0,78.750);
CreateObject(944,1858.772,-1815.500,3.869,0.0,0.0,-112.500);
CreateObject(1685,1843.284,-1818.836,3.734,0.0,0.0,-11.250);
CreateObject(2567,1851.059,-1817.018,4.912,0.0,0.0,67.500);
return 1;
}
public Robbanas()
{
SetTimer(\"ExitTheGameMode\", 10000, 0);
CreateExplosion( 1863.340,-1826.092,3.179, 6, 10.0);
CreateExplosion( 1865.813,-1816.759,3.179, 6, 10.0);
CreateExplosion( 1873.361,-1822.802,3.179, 6, 10.0);
CreateExplosion( 1883.602,-1822.041,3.179, 6, 10.0);
CreateExplosion( 1887.575,-1831.111,3.179, 6, 10.0);
GameTextForAll(\"~w~a ~r~t€madok ~w~felrobbantott€k~n~a ~b~b€zist~w~...\",10000,0);
SendClientMessageToAll(COLOR_BLUELIGHT,\"10 MÁSODPERC MÚLVA MAP VÁLTÁS\");
return 1;
}
public OnGameModeExit()
{
for(new o = 0; o < MAX_OBJECTS; o++)
{
DestroyObject(o);
}
return 1;
}
public SetPlayerTeamFromClass(playerid,classid)
{
if(classid == 0 || classid == 1 || classid == 2) {
gTeam[playerid] = TEAM_ATTACK;
} else if(classid == 3 || classid == 4 || classid == 5) {
    gTeam[playerid] = TEAM_DEFEND;
}
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
SetPlayerFacingAngle(playerid, 270.0);
SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
   new Float:x,Float:z,Float:y;
   PlayerPlaySound(playerid, 1183, x,y,z);
   
SetPlayerTeamFromClass(playerid,classid);
if(classid == 0 || classid == 1 || classid == 2) {
GameTextForPlayer(playerid,\"~r~Attacker\",1000,6);
} else if(classid == 3 || classid == 4 || classid == 5) {
    GameTextForPlayer(playerid,\"~b~Defender\",1000,6);
}
return 1;
}
public OnPlayerConnect(playerid)
{
SetPlayerScore(playerid,0);
GetPlayerName(playerid,player,100);
format(str,128,\"%s csatlakozott a szeróra. [Connect]\",player);
SendClientMessageToAll(0x626160FF,str);
SendClientMessage(playerid,0x0093FFFF,\"Üdvözöllek a NightHawk modban!\");
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
   GetPlayerName(playerid,player,100);
   switch(reason)
   {
   case 0: {format(str, sizeof(str), \"%s kifagyott. [Crash] \",player);SendClientMessageToAll(0xFEE401FF, str);}
case 1: {format(str, sizeof(str), \"%s lecsatlakozott. [Disconnect] \",player);SendClientMessageToAll(0x626160FF, str);}
case 2: {format(str, sizeof(str), \"%s ki lett rúgva. [Kick] \",player);SendClientMessageToAll(0xFB0B04FF, str);}
}
return 1;
}
public OnPlayerSpawn(playerid)
{
if(gTeam[playerid] == TEAM_ATTACK)
{
ResetPlayerWeapons(playerid);
new Float:x,Float:z,Float:y;
PlayerPlaySound(playerid, 1068, x,y,z);
SetPlayerPos(playerid, 1625.058,-1770.666,5.008);
SetPlayerCheckpoint(playerid,1863.170,-1826.388,4.040, 2.0);
SetPlayerColor(playerid,0xFF0606AA);
GivePlayerWeapon(playerid, 4, 500);
GivePlayerWeapon(playerid, 24, 500);
    GivePlayerWeapon(playerid, 30, 300);
    SendClientMessage(playerid, COLOR_RED, \"**A küldetésed: Támadd meg az ellenségeid,és robbantsd fel a bázisukat.\");
    SendClientMessage(playerid, COLOR_RED, \">>>>>>>>>> 10 perced van rá <<<<<<<<<<\");
}
else
{
if(gTeam[playerid] == TEAM_DEFEND)
{
    ResetPlayerWeapons(playerid);
new Float:x,Float:z,Float:y;
PlayerPlaySound(playerid, 1068, x,y,z);
SetPlayerPos(playerid, 1884.172,-1832.657,5.033);
SetPlayerCheckpoint(playerid,1863.170,-1826.388,4.040, 2.0);
SetPlayerColor(playerid,0x009FFFFF);
GivePlayerWeapon(playerid, 4, 500);
GivePlayerWeapon(playerid, 24, 500);
    GivePlayerWeapon(playerid, 31, 500);
    SendClientMessage(playerid, COLOR_BLUE, \"**A küldetésed: Védd meg a bázist az ellenségeidtol. (Mert fel akarják robbantani)\");
    SendClientMessage(playerid, COLOR_BLUE, \">>>>>>>>>> 10 perced van rá <<<<<<<<<<\");
}
}
return 1;
}
public ExitTheGameMode()
{
   SendRconCommand(\"gmx\");
}
public Viszaszam(playerid)
{
format(str, sizeof(str), \"~w~a ~r~t€madok ~w~le ~n~rakt€k a bomb€t\",killer,player);
      GameTextForAll(str,6000,0);
new Float:X, Float:Y, Float:Z;
       GetPlayerPos(playerid, X, Y, Z);
       CreatePickup(1252, 1, X, Y, Z);
TogglePlayerControllable(playerid,1);
       SendClientMessageToAll(COLOR_RED,\"10 MÁSODPERC A ROBBANÁSIG..\");
       SetTimer(\"Robbanas\", 10000, 0);
}
public OnPlayerEnterCheckpoint(playerid)
{
if(gObjectiveReached) return;
if(gTeam[playerid] == TEAM_ATTACK)
{
SendClientMessage(playerid,0x00A4F299,\"Várj 5 másodpercet,míg elhelyezed a bombát..\");
TogglePlayerControllable(playerid,0);
       ApplyAnimation(playerid, \"BOMBER\", \"BOM_Plant\", 4.0, 0, 0, 0, 0, 0);
SetTimer(\"Visszaszam\",5000,0);
    return;
}
else if(gTeam[playerid] == TEAM_DEFEND)
{
       GameTextForPlayer(playerid,\"~b~Vedd ~w~ezt a helyet\",5000,3);
       return;
}
}
public SetPlayerToTeamColor(playerid)
{
if(gTeam[playerid] == TEAM_ATTACK) {
SetPlayerColor(playerid,TEAM_ATTACK_COLOR);
} else if(gTeam[playerid] == TEAM_DEFEND) {
    SetPlayerColor(playerid,TEAM_DEFEND_COLOR);
}
}
public OnPlayerRequestSpawn(playerid)
{
   new Float:x,Float:z,Float:y;
   PlayerPlaySound(playerid, 1068, x,y,z);
   SetPlayerInterior(playerid,0);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
GetPlayerName(playerid,player,100);
GetPlayerName(killerid,killer,100);
if(killerid == INVALID_PLAYER_ID)
{
       SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
}
else
{
if(gTeam[killerid] != gTeam[playerid])
{
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
}
else
{
       SetPlayerScore(killerid,GetPlayerScore(killerid)-1);
       SendClientMessage(killerid, COLOR_RED, \"NE ÖLJ CSAPAT TÁRSAT\");
}
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext,\"/help\",true)==0)
{
return 1;
}
return 0;
}
stock IsPlayerAiming(playerid, aimid)
{
// Luby\'s function.
new Float:X1, Float:Y1, Float:Z1, Float:X2, Float:Y2, Float:Z2;
GetPlayerPos(playerid, X1, Y1, Z1);
GetPlayerPos(aimid, X2, Y2, Z2);
new Float:Distance = floatsqroot(floatpower(floatabs(X1-X2), 2) + floatpower(floatabs(Y1-Y2), 2));
if(Distance < 100)
{
new Float:A;
    GetPlayerFacingAngle(playerid, A);
    X1 += (Distance * floatsin(-A, degrees));
    Y1 += (Distance * floatcos(-A, degrees));
    Distance = floatsqroot(floatpower(floatabs(X1-X2), 2) + floatpower(floatabs(Y1-Y2), 2));
if(Distance < 0.5)
{
    return true;
}
}
return false;
}

 
Elore is THX!
« Utoljára szerkesztve: 2010. április 06. - 14:20:37 írta Volum3 »

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal