15.02.2012, 18:35
(
Последний раз редактировалось DarkyTheAngel; 19.02.2012 в 11:27.
)
Informations :
Hey guys ! I just maked a new filterscript and i wanna show you this script.Is a Mafia Minigame.Is just like Counter-Strike but is with Mafia and Police.If you are in Mafia Team , you need to plant the bomb.If you are in Police Team , you need to defuse the bomb.This is an open-source project and you can edit and redistribute the script.This script was released by DarKy.
__________________________________________________ __________________________________________________ _______________
Commands:
__________________________________________________ __________________________________________________ _______________
Necessary Things:
SSCanf : You need to click here to download!
Streamer : You need to click here to download !
__________________________________________________ __________________________________________________ _______________
Credits:
Download:
__________________________________________________ __________________________________________________ _______________
Copyright © <2012> <DarKy>.
All rights reserved.
Editing and Redistribution are allowed
considering that script was created by <DarKy>.
This script can be edited by anyone
and can be redistributed but and upgrades
to script are allowed.If you edit this script
don't present all the work as yours.The name Mafia Minigame
may not be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
Hey guys ! I just maked a new filterscript and i wanna show you this script.Is a Mafia Minigame.Is just like Counter-Strike but is with Mafia and Police.If you are in Mafia Team , you need to plant the bomb.If you are in Police Team , you need to defuse the bomb.This is an open-source project and you can edit and redistribute the script.This script was released by DarKy.
__________________________________________________ __________________________________________________ _______________
Commands:
Код:
/mafia - Join mafia team. /police - Join police team. /bomb - Plant the bomb.
Necessary Things:
SSCanf : You need to click here to download!
Streamer : You need to click here to download !
__________________________________________________ __________________________________________________ _______________
Credits:
- DarKy (Thanks for script)
- ****** (Thanks for sscanf)
- Incognito (Thanks for streamer)
Download:
pawn Код:
#define FILTERSCRIPT
#if defined Credits
________________________________________________________________________________
Hey hey ! I'm DarKy and this is my script (my minigame) , "Mafia Minigame".This
script si something like Counter Strike.Is a minigame with Mafia vs. Police !
Thanks for using Mafia Minigame !
_______________________________________________________________________________
#endif
/* ========================================================================== */
#include <a_samp>
#include <streamer>
#include <sscanf>
/* ========================================================================== */
#define TEAM_MAFIA 1
#define TEAM_POLICE 2
/* ========================================================================== */
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_ULTRARED 0xE60000FF
#define COLOR_BLUE 0x0000BBAA
#define COLOR_LIGHTGREEN 0x9ACD32AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_RED 0xAA3333AA
#define COLOR_LIME 0x10F441AA
#define COLOR_MAGENTA 0xFF00FFFF
#define COLOR_PURPLE 0x9900FFAA
#define COLOR_ALIEN 0x90FF87FF
#define COLOR_NAVY 0x000080AA
#define COLOR_AQUA 0xF0F8FFAA
#define COLOR_CRIMSON 0xDC143CAA
#define COLOR_FLBLUE 0x6495EDAA
#define COLOR_BISQUE 0xFFE4C4AA
#define COLOR_BLACK 0x000000AA
#define COLOR_CHARTREUSE 0x7FFF00AA
#define COLOR_BROWN 0XA52A2AAA
#define COLOR_CORAL 0xFF7F50AA
#define COLOR_GOLD 0xB8860BAA
#define COLOR_GREENYELLOW 0xADFF2FAA
#define COLOR_INDIGO 0x4B00B0AA
#define COLOR_IVORY 0xFFFF82AA
#define COLOR_LAWNGREEN 0x7CFC00AA
#define COLOR_SEAGREEN 0x20B2AAAA
#define COLOR_LIMEGREEN 0x32CD32AA
#define COLOR_MIDNIGHTBLUE 0x191970AA
#define COLOR_MAROON 0x800000AA
#define COLOR_OLIVE 0x808000AA
#define COLOR_ORANGERED 0xFF4500AA
#define COLOR_PINK 0xFFC0CBAA
#define COLOR_SPRINGGREEN 0x00FF7FAA
#define COLOR_TOMATO 0xFF6347AA
#define COLOR_YELLOWGREEN 0x9ACD32AA
#define COLOR_MEDIUMAQUA 0x83BFBFAA
#define COLOR_MEDIUMMAGENTA 0x8B008BAA
/* ========================================================================== */
new gTeam[MAX_PLAYERS];
new IsPlanted[MAX_PLAYERS];
new BombTimer;
new DefuseTimer;
new BombC;
/* ========================================================================== */
public OnFilterScriptInit()
{
print(" , ,");
print(" /( )`");
print(" | |___ / ||");
print(" /- _ `-/ '");
print(" (/|/ | | /|");
print(" / / | ` |");
print(" O O ) / |");
print(" `-^--'`< '");
print(" (_.) _ ) /");
print(" `.___/` /");
print(" `-----' /");
print(" <----. __ / __ |");
print(" <----|====O)))==) |) /====");
print(" <----' `--' `.__,' |");
print(" | |");
print(" | /");
print(" ______( (_ / |______");
print(" ,' ,-----' | |");
print(" `--{__________) //");
print("+----------------------------+");
print("| Mafia Minigame |");
print("| Copyright @ 2012 DarKy |");
print("+----------------------------+");
print("| SCRIPT WAS LOADED ! |");
print("+----------------------------+");
/* ========================================================================== */
CreateDynamicObject(4843, 3788.556640625, -1007, 22.800483703613, 2.4224853515625, 14.26025390625, 359.37927246094);
CreateDynamicObject(18450, 3788.0417480469, -1074.3570556641, 28.603553771973, 271.82019042969, 105.94512939453, 105.95275878906);
CreateDynamicObject(18450, 3752.2565917969, -1034.466796875, 30.965980529785, 271.81823730469, 105.94110107422, 9.951904296875);
CreateDynamicObject(18450, 3795.3010253906, -994.7861328125, 30.988925933838, 87.696228027344, 130.62664794922, 229.35363769531);
CreateDynamicObject(18450, 3829.0361328125, -1033.736328125, 28.466419219971, 87.698364257813, 40.512084960938, 223.51135253906);
CreateDynamicObject(5836, 3762.46875, -1060.9654541016, 33.749580383301, 0, 0, 0);
CreateDynamicObject(3244, 3817.2033691406, -1006.7029418945, 23.351663589478, 0, 0, 0);
CreateDynamicObject(11426, 3763.2980957031, -1048.7274169922, 22.138051986694, 0, 0, 0);
CreateDynamicObject(11440, 3763.1037597656, -1040.1733398438, 22.192417144775, 0, 0, 0);
CreateDynamicObject(11444, 3761.8654785156, -1023.9291381836, 23.29563331604, 0, 0, 87);
CreateDynamicObject(11447, 3763.8076171875, -1014.5645751953, 23.725009918213, 0.25, 0, 83.5);
CreateDynamicObject(11459, 3809.7502441406, -1006.7024536133, 22.369380950928, 0, 0, 0);
CreateDynamicObject(11425, 3788.8916015625, -1063.1005859375, 23.222801208496, 0, 0, 0);
CreateDynamicObject(2892, 3763.8696289063, -1039.8968505859, 25.301792144775, 0, 0, 0);
CreateDynamicObject(3277, 3814.0671386719, -1065.7998046875, 20.544910430908, 0, 0, 0);
CreateDynamicObject(3279, 3762.6506347656, -1003.1516723633, 24.117984771729, 0, 0, 0);
CreateDynamicObject(16093, 3787.5080566406, -1004.9901733398, 24.341495513916, 0, 0, 0);
CreateDynamicObject(3884, 3813.9548339844, -1065.9423828125, 20.519918441772, 0, 0, 0);
CreateDynamicObject(2977, 3788.9877929688, -1066.1768798828, 21.319984436035, 0, 0, 0);
CreateDynamicObject(4882, 3796.8549804688, -1037.2819824219, 26.579437255859, 0, 0, 0);
CreateDynamicObject(1637, 3770.4956054688, -1067.5883789063, 22.887557983398, 0, 0, 0);
CreateDynamicObject(13637, 3816.90234375, -1040.4141845703, 21.758207321167, 0, 0, 0);
CreateDynamicObject(1454, 3800.2314453125, -1005.2055053711, 24.239179611206, 0, 0, 0);
CreateDynamicObject(1457, 3778.3935546875, -1004.3561401367, 25.944948196411, 0, 0, 0);
CreateDynamicObject(1458, 3771.2314453125, -1033.5455322266, 23.3118724823, 0, 0, 0);
CreateDynamicObject(1483, 3788.2023925781, -1066.6140136719, 23.287937164307, 0, 0, 0);
CreateDynamicObject(3252, 3797.9787597656, -1058.7006835938, 21.185646057129, 0, 0, 0);
CreateDynamicObject(14875, 3780.8703613281, -1051.8704833984, 22.676380157471, 0, 0, 0);
CreateDynamicObject(16405, 3782.0483398438, -1067.8461914063, 23.358337402344, 0, 0, 0);
CreateDynamicObject(16406, 3826.7817382813, -1021.5054931641, 26.651744842529, 0, 0, 0);
CreateDynamicObject(1452, 3791.9660644531, -1000.9810791016, 25.533332824707, 0, 0, 0);
CreateDynamicObject(1463, 3770.9719238281, -1052.3360595703, 22.586893081665, 0, 0, 0);
CreateDynamicObject(615, 3776.9450683594, -1056.181640625, 21.17707824707, 0, 0, 0);
CreateDynamicObject(654, 3788.8693847656, -1031.6385498047, 22.414892196655, 0, 0, 0);
CreateDynamicObject(654, 3798.4265136719, -1001.9503173828, 23.328159332275, 0, 0, 0);
CreateDynamicObject(660, 3820.4982910156, -1064.2631835938, 20.781923294067, 0, 0, 0);
CreateDynamicObject(671, 3774.3537597656, -1013.5877075195, 23.751955032349, 0, 0, 0);
CreateDynamicObject(672, 3770.8112792969, -997.68231201172, 24.484878540039, 0, 0, 0);
CreateDynamicObject(700, 3769.8898925781, -1025.9455566406, 23.43603515625, 0, 0, 0);
CreateDynamicObject(703, 3779.4379882813, -1019.9229736328, 23.190059661865, 0, 0, 0);
CreateDynamicObject(706, 3805.1826171875, -1018.3567504883, 22.39249420166, 0, 0, 0);
CreateDynamicObject(726, 3813.5812988281, -1057.4226074219, 20.876085281372, 0, 0, 0);
CreateDynamicObject(729, 3758.0971679688, -1049.3806152344, 22.193546295166, 0, 0, 0);
CreateDynamicObject(763, 3782.6611328125, -1027.328125, 23.002702713013, 0, 0, 0);
CreateDynamicObject(744, 3783.7329101563, -1038.345703125, 22.306625366211, 0, 0, 0);
CreateDynamicObject(749, 3803.3459472656, -1055.2156982422, 20.71215057373, 0, 0, 0);
CreateDynamicObject(748, 3782.2346191406, -1040.9794921875, 23.45666885376, 0, 0, 0);
CreateDynamicObject(750, 3808.3913574219, -1032.6060791016, 21.548503875732, 0, 0, 0);
CreateDynamicObject(744, 3802.9118652344, -1048.4647216797, 21.382221221924, 0, 0, 0);
return 1;
}
/* ========================================================================== */
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerTeamFromClass(playerid);
return 1;
}
/* ========================================================================== */
SetPlayerTeamFromClass(playerid)
{
gTeam[playerid] = TEAM_MAFIA;
gTeam[playerid] = TEAM_POLICE;
}
/* ========================================================================== */
public OnPlayerSpawn(playerid)
{
SetPlayerTeam(playerid, 0);
TogglePlayerControllable(playerid,1);
SetPlayerArmour(playerid, 0);
SetPlayerHealth(playerid, 100);
return 1;
}
/* ========================================================================== */
public OnPlayerCommandText(playerid, cmdtext[])
{
new id;
if (strcmp(cmdtext, "/Mafia", true) == 0)
{
new name[MAX_PLAYER_NAME], string[44];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s has joined to Mafia.",name);
SendClientMessageToAll(0xFFFF00AA, string);
SetPlayerPos(playerid, 3811.0046,-1040.1082,22.4528);
SetPlayerTeam(playerid, TEAM_MAFIA);
SetPlayerColor(playerid, COLOR_RED);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
SetPlayerSkin(playerid, 179);
GivePlayerWeapon(playerid, 24, 10000);
GivePlayerWeapon(playerid, 25, 10000);
GivePlayerWeapon(playerid, 32, 10000);
GivePlayerWeapon(playerid, 33, 10000);
GivePlayerWeapon(playerid, 30, 10000);
GivePlayerMoney(playerid, -100);
return 1;
}
if (strcmp(cmdtext, "/Police", true) == 0)
{
new name[MAX_PLAYER_NAME], string[44];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s has joined Police.",name);
SendClientMessageToAll(0xFFFF00AA, string);
SetPlayerPos(playerid, 3756.1958,-1022.8865,24.7479);
SetPlayerTeam(playerid, TEAM_POLICE);
SetPlayerColor(playerid, COLOR_BLUE);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
SetPlayerSkin(playerid, 285);
GivePlayerWeapon(playerid, 22, 10000);
GivePlayerWeapon(playerid, 27, 10000);
GivePlayerWeapon(playerid, 29, 10000);
GivePlayerWeapon(playerid, 31, 10000);
GivePlayerWeapon(playerid, 34, 10000);
GivePlayerMoney(playerid, -100);
return 1;
}
if (strcmp(cmdtext, "/bomb", true) == 0)
{
if(IsPlanted[id] == 0)
{
if(GetPlayerTeam(playerid) == TEAM_MAFIA)
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, 3787.4651,-1002.8569,25.4665))
{
IsPlanted[id] = 1;
BombTimer = SetTimer("Bomb",30000,false);
SendClientMessageToAll(COLOR_BLUE, "The Bomb has been planted !");
BombC = CreateDynamicCP(3787.4651,-1002.8569,25.4665, 1.5, -1, -1, -1, 100.0);
return 1;
}
else return SendClientMessage(playerid, COLOR_RED, "(ERROR) You must be in POLICE Generator Room");
}
else return SendClientMessage(playerid, COLOR_RED, "(ERROR) Only MAFIA can use this command");
}
else return SendClientMessage(playerid, COLOR_RED, "(ERROR) Bomb has been planted !");
}
return 0;
}
/* ========================================================================== */
forward Bomb();
public Bomb()
{
new playerid, id;
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
for(new i = 0; i < MAX_PLAYERS; i++)
{
PlayAudioStreamForPlayer(i, "http://darkydownload.netau.net/explosion.mp3");
}
CreateExplosion(3787.4651,-1002.8569,25.4665, 6, 150.0);
CreateExplosion(3787.4651,-1002.8569,25.4665, 6, 150.0);
CreateExplosion(3787.4651,-1002.8569,25.4665, 6, 150.0);
CreateExplosion(3787.4651,-1002.8569,25.4665, 6, 150.0);
CreateExplosion(3787.4651,-1002.8569,25.4665, 6, 150.0);
CreateExplosion(3787.4651,-1002.8569,25.4665, 6, 150.0);
CreateExplosion(3787.4651,-1002.8569,25.4665, 6, 150.0);
CreateExplosion(3787.4651,-1002.8569,25.4665, 6, 150.0);
CreateExplosion(3787.4651,-1002.8569,25.4665, 6, 150.0);
CreateExplosion(3787.4651,-1002.8569,25.4665, 6, 150.0);
CreateExplosion(3787.4651,-1002.8569,25.4665, 6, 150.0);
CreateExplosion(3787.4651,-1002.8569,25.4665, 6, 150.0);
CreateExplosion(3787.4651,-1002.8569,25.4665, 6, 150.0);
CreateExplosion(3787.4651,-1002.8569,25.4665, 6, 150.0);
CreateExplosion(3787.4651,-1002.8569,25.4665, 6, 150.0);
CreateExplosion(3787.4651,-1002.8569,25.4665, 6, 150.0);
CreateExplosion(3787.4651,-1002.8569,25.4665, 6, 150.0);
IsPlanted[id] = 0;
GameTextForPlayer(playerid,"~r~Mafia Win",3000,6);
TogglePlayerControllable(playerid,0);
KillTimer(DefuseTimer);
SetTimer("Spawn",3000,false);
if(GetPlayerTeam(playerid) == TEAM_MAFIA)
{
GivePlayerMoney(playerid, 5000);
}
if(GetPlayerTeam(playerid) == TEAM_POLICE)
{
GivePlayerMoney(playerid, 2500);
}
DestroyDynamicCP(BombC);
}
/* ========================================================================== */
forward Spawn();
public Spawn()
{
new playerid;
for(new i = 0; i < MAX_PLAYERS; i++) {
if(GetPlayerTeam(playerid) == TEAM_MAFIA)
{
SpawnPlayer(i);
}
if(GetPlayerTeam(playerid) == TEAM_POLICE)
{
SpawnPlayer(i);
}
}
}
/* ========================================================================== */
forward Defuse();
public Defuse()
{
new playerid;
new id;
GameTextForPlayer(playerid,"~b~Police Win",3000,6);
TogglePlayerControllable(playerid,0);
KillTimer(BombTimer);
SetTimer("Spawn",3000,false);
IsPlanted[id] = 0;
if(GetPlayerTeam(playerid) == TEAM_MAFIA)
{
GivePlayerMoney(playerid, 2500);
}
if(GetPlayerTeam(playerid) == TEAM_POLICE)
{
GivePlayerMoney(playerid, 5000);
}
DestroyDynamicCP(BombC);
}
/* ========================================================================== */
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == BombC)
{
if(GetPlayerTeam(playerid) == TEAM_POLICE)
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, 3787.4651,-1002.8569,25.4665))
{
if(IsPlanted[playerid] == 1)
{
SendClientMessage(playerid, COLOR_RED, "Bomb being defused !");
DefuseTimer = SetTimer("Defuse",10000,false);
if(IsPlanted[playerid] == 0)
{
SendClientMessageToAll(COLOR_RED, "Defused failed !");
}
return 1;
}
else return SendClientMessage(playerid, COLOR_RED, "(ERROR) Bomb has not been planted !");
}
else return SendClientMessage(playerid, COLOR_RED, "(ERROR) You must be in Generator !");
}
else return SendClientMessage(playerid, COLOR_RED, "(ERROR) Only POLICE can defuse the bomb !");
}
return 1;
}
/* ========================================================================== */
public OnPlayerLeaveDynamicCP(playerid, checkpointid)
{
if(GetPlayerTeam(playerid) == TEAM_POLICE)
{
KillTimer(DefuseTimer);
SendClientMessage(playerid, COLOR_RED, "(ERROR) Defuse failed, you must be in checkpoint to defuse bomb !");
}
}
/* ========================================================================== */
__________________________________________________ __________________________________________________ _______________
Copyright © <2012> <DarKy>.
All rights reserved.
Editing and Redistribution are allowed
considering that script was created by <DarKy>.
This script can be edited by anyone
and can be redistributed but and upgrades
to script are allowed.If you edit this script
don't present all the work as yours.The name Mafia Minigame
may not be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.