Szerző Téma: TDM  (Megtekintve 1409 alkalommal)

Nem elérhető instant

  • 2778
  • ZzzzzZ
    • Profil megtekintése
TDM
« Dátum: 2012. július 20. - 13:10:33 »
+2 Show voters
Üdv
Bemutatom egy nagyon régebbi Játékmódomat az alapját még márciusban írtam , de a mai napokban újra elõvettem és elkesztem fejleszteni és most egy kicsit jobb lett.
Információk:
Külön Teamchat a csapatoknak
Területbe korlátozva a harctérre
Tiltott fegyverek betiltva ,(Sramm által készített függvény könyvtára segítségével)
JármûRespawn
Ping Kicker
Anti Team Kill
Szabályzat
Ölés és halál számláló menti az öléseket
Kód:
 
#include <a_samp>
#include zcmd
#include sscanf2
#include streamer
#include dini
#pragma unused ret_memcpy
#include fixchars
forward AntiPing(playerid);
forward CarRespawn( );
#undef MAX_PLAYERS
#define MAX_PLAYERS 30
#define ReGiStEr 8
#define LoGiN 9
//===========[szinek]======================|
#define COLOR_GRAD1 0xB4B5B7FF//           |
#define COLOR_GRAD2 0xBFC0C2FF//           |
#define COLOR_RED 0xFF0000FF//             |
#define COLOR_ORANGE 0xFFA500FF//            |
#define COLOR_WHITE 0xFFFFFFFF//           |
#define COLOR_GREEN 0x008000FF//           |
#define COLOR_YELLOW 0xFFFF00FF//          |
#define achat 0x00d5ffAA//               |
#define COLOR_BLUE 0x0009ffAA//            |
#define COLOR_LIGHTBLUE 0x0BBF6AA//        |
#define COLOR_LIGHTGREEN 0x90EE90FF//      |
#define COLOR_LIGHTBLUE1 0x0BBF6AA//       |
//============[HEXA Színek]================|
#define COL_LILA       \"{A000FA}\"//      |
#define COL_PIROS       \"{F81414}\"//      |
#define COL_VKEK       \"{00C0FF}\"//      |
#define COL_VZOLD       \"{6EF83C}\"//      |
#define COL_FEHER       \"{FFFFFF}\"//      |
#define COL_NARANCS    \"{FA9600}\"//      |
#define COL_CITROM       \"{FAE600}\"//      |
#define COL_PINK       \"{F814E6}\"//      |
#define COL_SKEK       \"{1466F8}\"//      |
#define COL_SZURKE       \"{757167}\"//      |
#define COL_VPINK       \"{FF3E98}\"//      |
#define COL_NZOLD       \"{22F710}\"//      |
#define COL_FEKETE      \"{000000}\"//      |
//-----------------------------------------|
#define asay 0x8aff70AA
#define MAX_PING 250
new gTeam[MAX_PLAYERS];
#define TEAM_Maffia 0
#define TEAM_POLICE 1
new Warns[MAX_PLAYERS];
new zone;
new pickup;
new
Text:Olesek[MAX_PLAYERS],
Text:Halalok[MAX_PLAYERS];
enum Stats
{
Kill,
Death
};
new PlayerInfo[MAX_PLAYERS][stats];
main()
{
print(\"\\n----------------------------------\");
print(\" Rendõrvs Maffia\");
print(\"----------------------------------\\n\");
}
public OnGameModeInit()
{
//textdrawok --->
for(new i = 0; i < MAX_PLAYERS; i++)
{
Olesek = TextDrawCreate(247.000000,10.000000,\"~r~Ölések : %d\");
TextDrawTextSize(Olesek,460.000000,51.000000);
TextDrawColor(Olesek,-1);
TextDrawBackgroundColor(Olesek,255);
Halalok  = TextDrawCreate(352.000000,10.000000,\"~r~Halálok: %d\");
TextDrawTextSize(Halalok,460.000000,51.000000);
TextDrawColor(Halalok,-1);
TextDrawBackgroundColor(Halalok,255);
}
//<---Textdrawok End
AddIllegalWeapon(38);
AddIllegalWeapon(37);
AddIllegalWeapon(39);
AddIllegalWeapon(40);
AddIllegalWeapon(36);
AddIllegalWeapon(35);
pickup=CreatePickup(1242,23,207.6507,-62.2565,1.7914,0);
AddPlayerClass(111,2075.7737,1668.5237,10.6719,1.2298,0,0,0,0,0,0); // //maffia1
AddPlayerClass(280,2076.0833,1668.7789,10.6719,271.2299,0,0,0,0,0,0); // //rendor1
DisableInteriorEnterExits();
AddStaticVehicle(415,200.1472,-66.5532,1.2707,89.7260,72,78); //
AddStaticVehicle(411,219.4686,-66.3731,1.2285,92.7395,16,62); //
AddStaticVehicle(560,215.9868,-76.4542,1.2064,89.0822,68,0); //
AddStaticVehicle(597,199.9622,-77.1671,1.2663,87.7944,0,1); //
AddStaticVehicle(411,166.4758,-55.0504,1.3052,269.4739,38,66); //
AddStaticVehicle(560,166.0343,-45.0168,1.2833,268.1713,116,0); //
AddStaticVehicle(426,165.2016,-36.6506,1.3207,267.1553,103,83); //
AddStaticVehicle(421,165.4751,-15.2269,1.4606,273.7128,65,10); //
AddStaticVehicle(402,175.9867,-7.1715,1.4097,177.2646,13,10); //
//maffia
AddStaticVehicle(402,12.0341,-261.8622,5.2612,89.4663,121,95); //
AddStaticVehicle(411,12.8779,-257.5403,5.1568,89.9455,88,107); //
AddStaticVehicle(560,11.8154,-252.9381,5.1352,90.1047,71,16); //
AddStaticVehicle(603,12.0607,-249.1846,5.2684,91.3005,102,26); //
AddStaticVehicle(551,14.0379,-245.0655,5.2304,88.4869,105,95); //
zone = GangZoneCreate(-270,-462,462,108);
UsePlayerPedAnims();
SendRconCommand(\"hostname Teszt\");
SetGameModeText(\"Teszt TDM\");
return 1;
}
public OnGameModeExit()
{
GangZoneDestroy(zone);
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
switch(classid)
{
case 0:
{
gTeam[playerid] = TEAM_Maffia;
GameTextForPlayer(playerid,\"~r~~h~Maffia\",2500,6);
SetPlayerPos(playerid,0.4886,-239.3074,5.4297);
SetPlayerCameraPos(playerid,0.3394,-243.8046,5.4297);
SetPlayerCameraLookAt(playerid,0.4886,-239.3074,5.4297);
SetPlayerInterior(playerid,0);
SetPlayerFacingAngle(playerid,166.6908);
}
case 1:
{
SetPlayerInterior(playerid,6);
gTeam[playerid] = TEAM_POLICE;
GameTextForPlayer(playerid,\"~b~~h~Police\",2500,6);
SetPlayerPos(playerid,246.5480,84.6529,1003.6406);
SetPlayerCameraPos(playerid,246.5294,82.2114,1003.6406);
SetPlayerCameraLookAt(playerid,246.5480,84.6529,1003.6406);
SetPlayerFacingAngle(playerid,180.9055);
}
}
return 1;
}
new Jatekosok;
public OnPlayerConnect(playerid)
{
Jatekosok++;
new string[160];
format(string,160,\"\"COL_LILA\"%s \"COL_PINK\"csatlakozott a szerverre!\"COL_PIROS\"Játékosok : %i \",sname(playerid),Jatekosok);
SendClientMessageToAll(-8,string);
new file[256];
format(file, sizeof(file), \"%s.dat\", sname(playerid));
if (!dini_Exists(file))
{
dini_Create(file);
dini_IntSet(file,\"Kill\",PlayerInfo[playerid][Kill] = 0);
dini_IntSet(file,\"Death\",PlayerInfo[playerid][Death] = 0);
}
if(fexist(file))
{
PlayerInfo[playerid][Kill] = dini_Int(file, \"Kills\");
PlayerInfo[playerid][Death] = dini_Int(file, \"Deaths\");
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
Jatekosok--;
new str[270];
if(reason == 0) {
format(str, sizeof(str), \"\"COL_LILA\"%s kilépett \"COL_PIROS\"(Idõtúllépés)\"COL_NZOLD\"Játékosok:%i\", sname(playerid),Jatekosok);
SendClientMessageToAll(COLOR_ORANGE, str);
}
if(reason == 1) {
format(str, sizeof(str), \"\"COL_LILA\"%s kilépett\"COL_PIROS\"(Kilépés)\"COL_NZOLD\" Játékosok:%i\", sname(playerid),Jatekosok);
SendClientMessageToAll(COLOR_ORANGE, str);
}
if(reason == 2) {
format(str, sizeof(str), \"\"COL_LILA\"%s kilépett\"COL_PIROS\"(Kick/Ban)\"COL_NZOLD\"Játékosok:%i\", sname(playerid),Jatekosok);
SendClientMessageToAll(COLOR_ORANGE, str);
}
new file[256];
format(file, sizeof(file), \"%s.txt\", sname(playerid));
dini_IntSet(file, \"Kill\",PlayerInfo[playerid][Kill]);
dini_IntSet(file, \"Death\",PlayerInfo[playerid][Death]);
TextDrawHideForPlayer(playerid,Olesek[playerid]);
TextDrawHideForPlayer(playerid,Halalok[playerid]);
return 1;
}
public OnPlayerSpawn(playerid)
{
TextDrawShowForPlayer(playerid,Olesek[playerid]);
TextDrawShowForPlayer(playerid,Halalok[playerid]);
if(gTeam[playerid] == TEAM_Maffia)
{
SetPlayerColor(playerid,COLOR_RED);
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,-4.0994,-223.3703,5.4297);
GivePlayerWeapon(playerid,31,5000);
GivePlayerWeapon(playerid,24,5000);
GivePlayerWeapon(playerid,4,2);
GivePlayerWeapon(playerid,32,5000);
}
if(gTeam[playerid] == TEAM_POLICE)
{
SetPlayerColor(playerid,COLOR_BLUE);
SetPlayerInterior(playerid,6);
SetPlayerCheckpoint(playerid,247.3893,62.9942,1003.6406,2.0);
SetPlayerPos(playerid,246.4177,83.1093,1003.6406);
GivePlayerWeapon(playerid,31,5000);
GivePlayerWeapon(playerid,24,500);
GivePlayerWeapon(playerid,2,5);
SetPlayerArmour(playerid,100);
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
PlayerInfo[killerid][Kill]++;
PlayerInfo[playerid][Death]++;
TextDrawHideForPlayer(playerid,Olesek[playerid]);
TextDrawHideForPlayer(playerid,Halalok[playerid]);
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
SendDeathMessage(killerid,playerid,reason);
if (gTeam [killerid] == gTeam [playerid]) {
new str[120];
format(str,120,\"%s kickelve lett TK miatt!\",sname(killerid));
SendClientMessageToAll(COLOR_ORANGE,str);
Kick(killerid);
}
return 1;
}
public OnPlayerText(playerid, text[])
{
new str[300];
if(text[0] == \'*\')
{
if(gTeam[playerid] == TEAM_POLICE)
{
format(str, sizeof(str),\"[Rendõr Chat] %s: %s\", sname(playerid), text[1]);
}
for(new i; i < MAX_PLAYERS; i++)
{
if(gTeam == TEAM_POLICE)
{
SendClientMessage(i,0x00ff09AA, str);
}
}
return 0;
}
if(text[0] == \'!\')
{
if(gTeam[playerid] == TEAM_Maffia)
{
format(str, sizeof(str),\"[Maffia Chat] %s: %s\", sname(playerid), text[1]);
}
for(new i; i < MAX_PLAYERS; i++)
{
if(gTeam == TEAM_Maffia)
{
SendClientMessage(i,0x00ff09AA, str);
}
}
return 0;
}
return 1;
}
public AntiPing(playerid)
{
new string[128], string2[256];
new PlayerName[16];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
if(GetPlayerPing(playerid) >= MAX_PING)
{
Warns[playerid] ++;
SendClientMessage(playerid, COLOR_RED, \"Figyelmeztetés! Magas a pinged, csökkentsd, különben kickelve leszel!. Max Ping: 500\");
if(Warns[playerid] >= 3)
{
format(string, sizeof(string), \"%s kickelve lett. Ok: Magas Ping [%d]\", PlayerName, MAX_PING);
SendClientMessageToAll(COLOR_RED, string);
format(string2, sizeof(string2), \"Kickelve lettél a szerver által. Ok: Magas Ping [%d]\", MAX_PING);
SendClientMessage(playerid, COLOR_GREEN, string2);
Kick(playerid);
}
}
return 1;
}
CMD:help(playerid,params[])
{
ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,\"-Help-\",\"{FF0000}Banda Chat : !(MAffiáké) *(Rendõrõké)\\n{DC143C}Szabályzat: /rules\\n{808000}\",\"Cancel\",\"\");
return 1;
}
CMD:rules(playerid)
{
SendClientMessage(playerid,COLOR_LIGHTBLUE,\"\"COL_PIROS\",_]SZABÁLYZAT[_!!!!\");
SendClientMessage(playerid,COLOR_LIGHTBLUE,\"|{ff0000}Tilos \"COL_VKEK\"a TK!|\");
SendClientMessage(playerid,COLOR_LIGHTBLUE,\"|{ff0000}Tilos \"COL_VKEK\"az SK!|\");
SendClientMessage(playerid,COLOR_LIGHTBLUE,\"|{ff0000}Tilos \"COL_VKEK\"a DB!|\");
SendClientMessage(playerid,COLOR_LIGHTBLUE,\"|{ff0000}Tilos \"COL_VKEK\"a flood!|\");
SendClientMessage(playerid,COLOR_LIGHTBLUE,\"|{ff0000}Tilos \"COL_VKEK\"a káromkodás!|\");
SendClientMessage(playerid,COLOR_LIGHTBLUE,\"|{ff0000}Tilos \"COL_VKEK\"Hirdetni!|\");
SendClientMessage(playerid,COLOR_LIGHTBLUE,\"|{ff0000}Tilos \"COL_VKEK\"a Cheat|\");
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
SetPlayerPos(playerid,207.4764,-65.3840,1.5781);
SetPlayerInterior(playerid,0);
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerPickUpPickup ( playerid, pickupid )
{
if(pickupid == pickup)
{
SetPlayerInterior(playerid,6);
SetPlayerPos(playerid,247.5843,65.6881,1003.6406);
}
return 1;
}
public OnPlayerUpdate(playerid)
{
    Antiweap_ON(playerid);
    new string[127];
    format(string,sizeof(string),\"~r~Halálok: ~w~%d\",PlayerInfo[playerid][Death]);
    TextDrawSetString(Halalok[playerid],string);
format(string,sizeof(string),\"~G~Ölések:  ~w~%d\",PlayerInfo[playerid][Kill]);
TextDrawSetString(Olesek[playerid],string);
return 1;
}
public CarRespawn()
{
for(new vid = 0; vid < MAX_VEHICLES; vid ++)
if(!IsVehicleOccupied(vid))SetVehicleToRespawn(vid); return SendClientMessageToAll(0x33CCFFAA, \"* Minden használaton kívüli jármû helyreállítva!\");
}
stock IsVehicleOccupied(vehicleid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerInVehicle(i, vehicleid))
return 1;
return 0;
}
stock sname(playerid)
{
new sname[24];
GetPlayerName(playerid,sname,sizeof(sname));
return sname;
}
/*
native AddIllegalWeapon(weaponid);
native RemoveIllegalWeapon(weaponid);
native AddIllegalWeaponForPlayer(playerid,weaponid);
native RemoveIllegalWeaponFromPlayer(weaponid);
native RemovePlayerWeaponEx(playerid,weaponid);
*/
new Weapon[47];
new PWeapon[MAX_PLAYERS][47];
forward OnWeaponHack(playerid,weaponid);
forward Antiweap_ON(playerid);
stock AddIllegalWeapon(weaponid)
{
if(weaponid != 0)
{
if(Weapon[weaponid] == 1) return 1;
Weapon[weaponid] = 1;
}
return 1;
}
stock RemoveIllegalWeapon(weaponid)
{
    if(weaponid != 0)
{
if(Weapon[weaponid] == 0) return 1;
Weapon[weaponid] = 0;
}
return 1;
}
stock AddIllegalWeaponForPlayer(playerid,weaponid)
{
if(PWeapon[playerid][weaponid] == 1) return 1;
PWeapon[playerid][weaponid] = 1;
return 1;
}
stock RemoveIllegalWeaponFromPlayer(playerid,weaponid)
{
if(PWeapon[playerid][weaponid] == 0) return 1;
PWeapon[playerid][weaponid] = 0;
return 1;
}
 
stock RemovePlayerWeaponEx(playerid, weaponid)
{
new plyWeapons[12];
new plyAmmo[12];
for(new slot=0; slot != 12; slot++)
{
       new wep, ammo;
       GetPlayerWeaponData(playerid, slot, wep, ammo);
       if(wep != weaponid)
       {
           GetPlayerWeaponData(playerid, slot, plyWeapons[slot], plyAmmo[slot]);
       }
}
SetPlayerAmmo(playerid,weaponid,0);
ResetPlayerWeapons(playerid);
for(new slot = 0; slot != 12; slot++)
{
       GivePlayerWeapon(playerid, plyWeapons[slot], plyAmmo[slot]);
}
}
public OnPlayerRequestSpawn(playerid)
{
    GangZoneShowForPlayer(playerid, zone, 0xFF0F0F80);
SetPlayerWorldBounds(playerid, 462,-270,108,-462);
    return 1;
}
public Antiweap_ON(playerid)
{
if(Weapon[GetPlayerWeapon(playerid)] == 1 || PWeapon[playerid][GetPlayerWeapon(playerid)] == 1)
{
    CallLocalFunction(\"OnWeaponHack\", \"dd\",playerid,GetPlayerWeapon(playerid));
    RemovePlayerWeaponEx(playerid,GetPlayerWeapon(playerid));
    return 1;
}
return 1;
}

 
Készitõ : Blade.
Készitési idõ : Párnap
Képek :
\"T8cvb.jpg\"
\"JSsTj.png\"
\"MTOhp.jpg\"
(Régi Maffia vs Rendõrök GM)
« Utoljára szerkesztve: 2012. július 20. - 13:45:39 írta ZzzzzZ »

Nem elérhető D4N13L

  • 348
    • Profil megtekintése
TDM
« Válasz #1 Dátum: 2012. július 20. - 23:36:48 »
0 Show voters
Hali!
Tetszik a mód, jólett.
Szerintem felfogom használni.

Nem elérhető DrAkE

  • 2078
    • Profil megtekintése
TDM
« Válasz #2 Dátum: 2012. július 21. - 10:48:04 »
+2 Show voters
Nem értem, hogy nem szúrja a szemeteket ez a tagoltság, így átláthatatlan a kód.

TDM
« Válasz #3 Dátum: 2012. július 22. - 21:32:03 »
0 Show voters
Jó lett grat :D ++

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal