Hello
Az angol fórumról lemagyarositottam egy SWAT -os játékmódot.
Eredeti készítõ: Kitten
Magyarosította: Én Yakuza™
Eredeti link:
http://forum.sa-mp.com/showthread.php?t=177710[pawn]// SWAT Játékmód
// Készítõ: Kitten
// Magyarosította: Yakuza™
#include <a_samp>
#include <streamer>
new gTeam[MAX_PLAYERS];
#define TEAM_TERRIOST 0
#define TEAM_SWAT 1
new Text:Textdraw0;
new Text:Textdraw11;
new Text:Textdraw00[MAX_PLAYERS];
new Text:Textdraw1[MAX_PLAYERS];
new Text:Textdraw2;
new Text:Textdraw3;
new Text:Textdraw4;
new Text:Textdraw5[MAX_PLAYERS];
new TerriostZone;
new SwatZone2;
new SwatZone;
new TerriostZone2;
new kill[MAX_PLAYERS];
new str[256];
new Deaths[MAX_PLAYERS];
new Bomb1[MAX_PLAYERS];
new Bomb2[MAX_PLAYERS];
new Bomb3[MAX_PLAYERS];
new Bomb4[MAX_PLAYERS];
new Bomb5[MAX_PLAYERS];
new Bomb6[MAX_PLAYERS];
new Bomb7[MAX_PLAYERS];
new Bomb8[MAX_PLAYERS];
new Bomb9[MAX_PLAYERS];
new BombDefuse[2];
forward TerriostTD(playerid);
forward SwatTD(playerid);
forward KillsInfo();
forward DeathInfo();
forward BombCP1(playerid);
forward BombCP2(playerid);
forward BombCP3(playerid);
forward BombCP4(playerid);
forward BombCP5(playerid);
forward BombCP6(playerid);
forward NewBombb1(playerid);
forward NewBombb2(playerid);
forward NewBombb3(playerid);
forward NewMap(playerid);
forward NewMapBound(playerid);
main()
{
print(\"\\n----------------------------------\");
print(\" Swat GM By Kitten\");
print(\" Magyarositotta: Yakuza™\");
print(\"----------------------------------\\n\");
}
public OnGameModeInit()
{
SetGameModeText(\"[HUN] _.SWAT._\");
AddPlayerClass(285,1681.7203,1099.9380,10.8203,87.5332,24, 50, 31, 300, 17, 5); // SwatSpawn
AddPlayerClass(211,1681.7203,1099.9380,10.8203,87.5332,24, 50, 31, 300, 17, 5); // SwatSpawn 2
AddPlayerClass(179,1663.2716,904.9013,10.7951,334.4422,24, 50, 30, 300, 17, 5); // Terrorista spawn
AddPlayerClass(191,1663.2716,904.9013,10.7951,334.4422,24, 50, 30, 300, 17, 5); // Terrorista spawn 2
TerriostZone = GangZoneCreate(1564.303, 893.0443, 1740.021, 997.4821);
SwatZone = GangZoneCreate(1552.589, 993.614, 1736.117, 1128.996);
SwatZone2 = GangZoneCreate(2489.752, 1774.963, 2665.47, 1945.158);
TerriostZone2 = GangZoneCreate(2497.562, 1624.109, 2665.47, 1782.699);
Textdraw0 = TextDrawCreate(81.000000, 325.000000, \"SWAT: Hatastalanitani kell a bombakat a terrorista oldalon. Osszesen 6 bombat!\");
TextDrawBackgroundColor(Textdraw0, 255);
TextDrawFont(Textdraw0, 1);
TextDrawLetterSize(Textdraw0, 0.400000, 1.000000);
TextDrawColor(Textdraw0, 65535);
TextDrawSetOutline(Textdraw0, 0);
TextDrawSetProportional(Textdraw0, 1);
TextDrawSetShadow(Textdraw0, 1);
Textdraw11 = TextDrawCreate(128.000000, 344.000000, \"Terrorista: Megkell vedeni a bombakat, hogy a SWAT ne hatastalanitsa.\");
TextDrawBackgroundColor(Textdraw11, 255);
TextDrawFont(Textdraw11, 1);
TextDrawLetterSize(Textdraw11, 0.429999, 1.000000);
TextDrawColor(Textdraw11, -16776961);
TextDrawSetOutline(Textdraw11, 0);
TextDrawSetProportional(Textdraw11, 1);
TextDrawSetShadow(Textdraw11, 1);
SetTimer(\"KillsInfo\",300 , 1);
SetTimer(\"DeathInfo\",300 , 1);
for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
{
Textdraw1[playerid] = TextDrawCreate(495.000000, 112.000000, \"~n~\");
TextDrawBackgroundColor(Textdraw1[playerid], 255);
TextDrawFont(Textdraw1[playerid], 1);
TextDrawLetterSize(Textdraw1[playerid], 0.529999, 0.899999);
TextDrawColor(Textdraw1[playerid], -1);
TextDrawSetOutline(Textdraw1[playerid], 0);
TextDrawSetProportional(Textdraw1[playerid], 1);
TextDrawSetShadow(Textdraw1[playerid], 1);
Textdraw5[playerid] = TextDrawCreate(495.000000, 119.000000, \"Halalok:\");
TextDrawBackgroundColor(Textdraw5[playerid], 255);
TextDrawFont(Textdraw5[playerid], 1);
TextDrawLetterSize(Textdraw5[playerid], 0.490000, 1.000000);
TextDrawColor(Textdraw5[playerid], -1);
TextDrawSetOutline(Textdraw5[playerid], 0);
TextDrawSetProportional(Textdraw5[playerid], 1);
TextDrawSetShadow(Textdraw5[playerid], 1);
Textdraw00[playerid] = TextDrawCreate(22.000000, 320.000000, \"~n~\");
TextDrawBackgroundColor(Textdraw00[playerid], 255);
TextDrawFont(Textdraw00[playerid], 1);
TextDrawLetterSize(Textdraw00[playerid], 0.500000, 1.400000);
TextDrawColor(Textdraw00[playerid], 65535);
TextDrawSetOutline(Textdraw00[playerid], 0);
TextDrawSetProportional(Textdraw00[playerid], 1);
Bomb1[playerid] = CreateDynamicCP(1596.7633,885.2949,10.8203,5,0,0,0,100.0);
Bomb2[playerid] = CreateDynamicCP(1679.5154,889.6320,10.8129,5,0,0,0,100.0);
Bomb3[playerid] = CreateDynamicCP(1727.7621,893.7756,10.8129,5,0,0,0,100.0);
Bomb4[playerid] = CreateDynamicCP(1720.4718,932.5308,10.8129,5,0,0,0,100.0);
Bomb5[playerid] = CreateDynamicCP(1605.1661,916.0939,10.8129,5,0,0,0,100.0);
Bomb6[playerid] = CreateDynamicCP(1652.7689,901.3668,10.8129,5,0,0,0,100.0);
Bomb7[playerid] = CreateDynamicCP(2622.3879,1717.6305,11.0234,5,0,0,0,100.0);
Bomb8[playerid] = CreateDynamicCP(2621.6570,1824.6542,11.0234,5,0,0,0,100.0);
Bomb9[playerid] = CreateDynamicCP(2558.7576,1750.7294,11.0234,5,0,0,0,100.0);
}
Textdraw2 = TextDrawCreate(496.000000, 101.000000, \"Rang:\");
TextDrawBackgroundColor(Textdraw2, 255);
TextDrawFont(Textdraw2, 1);
TextDrawLetterSize(Textdraw2, 0.370000, 1.200000);
TextDrawColor(Textdraw2, -16776961);
TextDrawSetOutline(Textdraw2, 0);
TextDrawSetProportional(Textdraw2, 1);
TextDrawSetShadow(Textdraw2, 1);
Textdraw3 = TextDrawCreate(180.000000, 426.000000, \"Kitten, Yakuza\");
TextDrawBackgroundColor(Textdraw3, 255);
TextDrawFont(Textdraw3, 1);
TextDrawLetterSize(Textdraw3, 0.860000, 1.000000);
TextDrawColor(Textdraw3, 65535);
TextDrawSetOutline(Textdraw3, 0);
TextDrawSetProportional(Textdraw3, 1);
TextDrawSetShadow(Textdraw3, 1);
Textdraw4 = TextDrawCreate(180.000000, 421.000000, \"~n~\");
TextDrawBackgroundColor(Textdraw4, 255);
TextDrawFont(Textdraw4, 1);
TextDrawLetterSize(Textdraw4, 0.500000, 1.500000);
TextDrawColor(Textdraw4, -1);
TextDrawSetOutline(Textdraw4, 0);
TextDrawSetProportional(Textdraw4, 1);
TextDrawSetShadow(Textdraw4, 1);
TextDrawUseBox(Textdraw4, 1);
TextDrawBoxColor(Textdraw4, -1);
TextDrawTextSize(Textdraw4, 478.000000, 10.000000);
return 1;
}
public OnGameModeExit()
{
TextDrawHideForAll(Textdraw2);
TextDrawDestroy(Textdraw2);
TextDrawHideForAll(Textdraw3);
TextDrawDestroy(Textdraw3);
TextDrawHideForAll(Textdraw4);
TextDrawDestroy(Textdraw4);
for(new i = 0;i < MAX_PLAYERS; i++)
{
TextDrawHideForPlayer(i,Textdraw1
);
TextDrawHideForPlayer(i,Textdraw5);
TextDrawHideForPlayer(i,Textdraw00);
}
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1644.4078,-1133.8214,58.2172);
SetPlayerCameraPos(playerid, 1647.6301,-1134.5725,58.2489);
SetPlayerCameraLookAt(playerid, 1644.4078,-1133.8214,58.2172);
SetPlayerFacingAngle(playerid,258.5584);
if(classid == 0)
{
GameTextForPlayer(playerid,\"~b~Swat 1\",5000,3);
gTeam[playerid] = TEAM_SWAT;
}
else if(classid == 1)
{
GameTextForPlayer(playerid,\"~b~Swat 2\",5000,3);
gTeam[playerid] = TEAM_SWAT;
}
else if(classid == 2)
{
GameTextForPlayer(playerid,\"~r~Terrorista 1\",5000,3);
gTeam[playerid] = TEAM_TERRIOST;
}
else if(classid == 3)
{
GameTextForPlayer(playerid,\"~r~Terrorista 2\",5000,3);
gTeam[playerid] = TEAM_TERRIOST;
}
return 1;
}
public OnPlayerConnect(playerid)
{
KillsInfo();
TextDrawShowForPlayer(playerid,Textdraw1[playerid]);
Deaths[playerid] = 0;
DeathInfo();
TextDrawShowForPlayer(playerid,Textdraw5[playerid]);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
if(gTeam[playerid] == TEAM_TERRIOST)
{
TextDrawShowForPlayer(playerid,Textdraw11);
SetTimer(\"TerriostTD\",8000,true);
SetPlayerTeam(playerid,0);
SetPlayerWorldBounds(playerid, 1775.165, 1536.969, 1152.205, 881.4401);
}
else if(gTeam[playerid] == TEAM_SWAT)
{
TextDrawShowForPlayer(playerid,Textdraw0);
SetTimer(\"SwatTD\",8000,true);
SetPlayerTeam(playerid,1);
SetPlayerWorldBounds(playerid, 1775.165, 1536.969, 1152.205, 881.4401);
}
GangZoneShowForPlayer(playerid, TerriostZone, 0xFF000096);
GangZoneShowForPlayer(playerid, SwatZone, 0x0000FF96);
GangZoneShowForPlayer(playerid, SwatZone2, 0x0000FF96);
GangZoneShowForPlayer(playerid, TerriostZone2, 0xFF000096);
TextDrawShowForPlayer(playerid, Textdraw00[playerid]);
TextDrawShowForPlayer(playerid, Textdraw2);
TextDrawShowForPlayer(playerid, Textdraw3);
TextDrawShowForPlayer(playerid, Textdraw4);
return 1;
}
public TerriostTD(playerid)
{
TextDrawHideForPlayer(playerid,Textdraw11);
return 1;
}
public SwatTD(playerid)
{
TextDrawHideForPlayer(playerid,Textdraw0);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
kill[playerid]++;
Deaths[killerid]++;
SendDeathMessage(killerid, playerid, reason);
SetTimer(\"NewMapBound\",100,false);
return 1;
}
public KillsInfo()
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if (IsPlayerConnected(i))
{
TextDrawHideForPlayer(i,Textdraw1);
format(str, sizeof(str), \"Halal: %d\" , Deaths[0]);
TextDrawSetString(Textdraw1,str);
TextDrawShowForPlayer(i,Textdraw1);
}
}
return 1;
}
public DeathInfo()
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if (IsPlayerConnected(i))
{
TextDrawHideForPlayer(i,Textdraw5);
format(str, sizeof(str), \"Halalok: %d\" , kill[0]);
TextDrawSetString(Textdraw5,str);
TextDrawShowForPlayer(i,Textdraw5);
}
}
return 1;
}
public NewMap(playerid)
{
if(gTeam[playerid] == TEAM_SWAT)
for(new i;i<=MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i))continue;
SetPlayerWorldBounds(i,20000.0000, -20000.0000, 20000.0000, -20000.0000);
SetPlayerPos(playerid,2605.8599,1891.0757,11.0234);
SetSpawnInfo(playerid,TEAM_SWAT,285,2605.8599,1891.0757,11.0234,270.8472,24, 50, 31, 300, 17, 5);
}
else if(gTeam[playerid] == TEAM_TERRIOST)
for(new i;i<=MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i))continue;
SetPlayerWorldBounds(i,20000.0000, -20000.0000, 20000.0000, -20000.0000);
SetPlayerPos(playerid,2583.1155,1728.6307,11.0234);
SetSpawnInfo(playerid,TEAM_TERRIOST,179,2583.1155,1728.6307,11.0234,264.5337,24, 50, 30, 300, 17, 5);
}
TextDrawHideForPlayer(playerid,Textdraw00[playerid]);
for(new i=0;i<MAX_PLAYERS;i++)
{
if (IsPlayerConnected(i))
{
TextDrawHideForPlayer(i,Textdraw00);
format(str, sizeof(str), \"Hatastalanitott bombak: 0/3\" , BombDefuse[1]);
TextDrawSetString(Textdraw00,str);
TextDrawShowForPlayer(i,Textdraw00);
}
}
SetTimer(\"NewMapBound\",1000,false);
return 1;
}
public NewMapBound(playerid)
{
SetPlayerWorldBounds(playerid, 2673.28, 2493.657, 1937.422, 1616.373);
return 1;
}
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(BombDefuse[1] == 6) {
SetTimerEx(\"NewMap\",5000,false,\"i\",playerid);
}
if(gTeam[playerid] == TEAM_SWAT)
{
if(checkpointid == Bomb1[playerid])
{
GameTextForPlayer(playerid,\"~r~Bomba robbanásig ~b~10 ~r~másodperc van hátra\",5000,3);
SetTimerEx(\"BombCP1\",10000,false,\"i\",playerid);
BombDefuse[1]++;
}
if(checkpointid == Bomb2[playerid])
{
GameTextForPlayer(playerid,\"~r~Bomba robbanásig ~b~10 ~r~másodperc van hátra\",5000,3);
SetTimerEx(\"BombCP2\",10000,false,\"i\",playerid);
BombDefuse[1]++;
}
if(checkpointid == Bomb3[playerid])
{
GameTextForPlayer(playerid,\"~r~Bomba robbanásig ~b~10 ~r~másodperc van hátra\",5000,3);
SetTimerEx(\"BombCP3\",10000,false,\"i\",playerid);
BombDefuse[1]++;
}
if(checkpointid == Bomb4[playerid])
{
GameTextForPlayer(playerid,\"~r~Bomba robbanásig ~b~10 ~r~másodperc van hátra\",5000,3);
SetTimerEx(\"BombCP4\",10000,false,\"i\",playerid);
BombDefuse[1]++;
}
if(checkpointid == Bomb5[playerid])
{
GameTextForPlayer(playerid,\"~r~Bomba robbanásig ~b~10 ~r~másodperc van hátra\",5000,3);
SetTimerEx(\"BombCP5\",10000,false,\"i\",playerid);
BombDefuse[1]++;
}
if(checkpointid == Bomb6[playerid])
{
GameTextForPlayer(playerid,\"~r~Bomba robbanásig ~b~10 ~r~másodperc van hátra\",5000,3);
SetTimerEx(\"BombCP6\",10000,false,\"i\",playerid);
BombDefuse[1]++;
}
if(checkpointid == Bomb7[playerid])
{
GameTextForPlayer(playerid,\"~r~Bomba robbanásig ~b~10 ~r~másodperc van hátra\",5000,3);
SetTimerEx(\"NewBombb1\",10000,false,\"i\",playerid);
BombDefuse[1]++;
}
if(checkpointid == Bomb8[playerid])
{
GameTextForPlayer(playerid,\"~r~Bomba robbanásig ~b~10 ~r~másodperc van hátra\",5000,3);
SetTimerEx(\"NewBombb2\",10000,false,\"i\",playerid);
BombDefuse[1]++;
}
if(checkpointid == Bomb9[playerid])
{
GameTextForPlayer(playerid,\"~r~Bomba robbanásig ~b~10 ~r~másodperc van hátra\",5000,3);
SetTimerEx(\"NewBombb3\",10000,false,\"i\",playerid);
BombDefuse[1]++;
}
}
else if(gTeam[playerid] == TEAM_TERRIOST)
{
if(checkpointid == Bomb1[playerid])
{
GameTextForPlayer(playerid,\"~r~HIBA: Ezt a bombát hatástalanitották!\",5000,3);
}
if(checkpointid == Bomb2[playerid])
{
GameTextForPlayer(playerid,\"~r~HIBA: Ezt a bombát hatástalanitották!\",5000,3);
}
if(checkpointid == Bomb3[playerid])
{
GameTextForPlayer(playerid,\"~r~HIBA: Ezt a bombát hatástalanitották!\",5000,3);
}
if(checkpointid == Bomb4[playerid])
{
GameTextForPlayer(playerid,\"~r~HIBA: Ezt a bombát hatástalanitották!\",5000,3);
}
if(checkpointid == Bomb5[playerid])
{
GameTextForPlayer(playerid,\"~r~HIBA: Ezt a bombát hatástalanitották!\",5000,3);
}
if(checkpointid == Bomb6[playerid])
{
GameTextForPlayer(playerid,\"~r~HIBA: Ezt a bombát hatástalanitották!\",5000,3);
}
if(checkpointid == Bomb7[playerid])
{
GameTextForPlayer(playerid,\"~r~HIBA: Ezt a bombát hatástalanitották!\",5000,3);
}
if(checkpointid == Bomb8[playerid])
{
GameTextForPlayer(playerid,\"~r~HIBA: Ezt a bombát hatástalanitották!\",5000,3);
}
if(checkpointid == Bomb9[playerid])
{
GameTextForPlayer(playerid,\"~r~HIBA: Ezt a bombát hatástalanitották!\",5000,3);
}
}
return 0;
}
public BombCP1(playerid)
{
GameTextForPlayer(playerid,\"~w~ A bombát sikeresen hatástalanitották!\",5000,3);
DestroyDynamicCP(Bomb1[playerid]);
for(new i=0;i<MAX_PLAYERS;i++)
{
if (IsPlayerConnected(i))
{
TextDrawHideForPlayer(i,Textdraw00);
format(str, sizeof(str), \"Hatastalanitott bombak: %d/6\" , BombDefuse[1]);
TextDrawSetString(Textdraw00,str);
TextDrawShowForPlayer(i,Textdraw00);
}
}
return 1;
}
public BombCP2(playerid)
{
GameTextForPlayer(playerid,\"~w~ A bombát sikeresen hatástalanitották!\",5000,3);
DestroyDynamicCP(Bomb2[playerid]);
for(new i=0;i<MAX_PLAYERS;i++)
{
if (IsPlayerConnected(i))
{
TextDrawHideForPlayer(i,Textdraw00);
format(str, sizeof(str), \"Hatastalanitott bombak: %d/6\" ,BombDefuse[1]);
TextDrawSetString(Textdraw00,str);
TextDrawShowForPlayer(i,Textdraw00);
}
}
return 1;
}
public BombCP3(playerid)
{
GameTextForPlayer(playerid,\"~w~ A bombát sikeresen hatástalanitották!\",5000,3);
DestroyDynamicCP(Bomb3[playerid]);
for(new i=0;i<MAX_PLAYERS;i++)
{
if (IsPlayerConnected(i))
{
TextDrawHideForPlayer(i,Textdraw00);
format(str, sizeof(str), \"Hatastalanitott bombak: %d/6\" , BombDefuse[1]);
TextDrawSetString(Textdraw00,str);
TextDrawShowForPlayer(i,Textdraw00);
}
}
return 1;
}
public BombCP4(playerid)
{
GameTextForPlayer(playerid,\"~w~ A bombát sikeresen hatástalanitották!\",5000,3);
DestroyDynamicCP(Bomb4[playerid]);
for(new i=0;i<MAX_PLAYERS;i++)
{
if (IsPlayerConnected(i))
{
TextDrawHideForPlayer(i,Textdraw00);
format(str, sizeof(str), \"Hatastalanitott bombak: %d/6\" , BombDefuse[1]);
TextDrawSetString(Textdraw00,str);
TextDrawShowForPlayer(i,Textdraw00);
}
}
return 1;
}
public BombCP5(playerid)
{
GameTextForPlayer(playerid,\"~w~ A bombát sikeresen hatástalanitották!\",5000,3);
DestroyDynamicCP(Bomb5[playerid]);
for(new i=0;i<MAX_PLAYERS;i++)
{
if (IsPlayerConnected(i))
{
TextDrawHideForPlayer(i,Textdraw00);
format(str, sizeof(str), \"Hatastalanitott bombak: %d/6\" , BombDefuse[1]);
TextDrawSetString(Textdraw00,str);
TextDrawShowForPlayer(i,Textdraw00);
}
}
return 1;
}
public BombCP6(playerid)
{
GameTextForPlayer(playerid,\"~w~ A bombát sikeresen hatástalanitották!\",5000,3);
DestroyDynamicCP(Bomb6[playerid]);
for(new i=0;i<MAX_PLAYERS;i++)
{
if (IsPlayerConnected(i))
{
TextDrawHideForPlayer(i,Textdraw00);
format(str, sizeof(str), \"Hatastalanitott bombak: %d/6\" , BombDefuse[1]);
TextDrawSetString(Textdraw00,str);
TextDrawShowForPlayer(i,Textdraw00);
}
}
return 1;
}
public NewBombb1(playerid)
{
GameTextForPlayer(playerid,\"~w~ A bombát sikeresen hatástalanitották!\",5000,3);
DestroyDynamicCP(Bomb7[playerid]);
for(new i=0;i<MAX_PLAYERS;i++)
{
if (IsPlayerConnected(i))
{
TextDrawHideForPlayer(i,Textdraw00);
format(str, sizeof(str), \"Hatastalanitott bombak: %d/3\" , BombDefuse[1]);
TextDrawSetString(Textdraw00,str);
TextDrawShowForPlayer(i,Textdraw00);
}
}