[GameMode] <•> [TDM] Police vs Mafia [UNFINISHED] <•>
#1

POLICE VS MAFIA |TDM|

ADVANCED






INTRODUCTION

Hi there, so yeah i stopped working on it 6-7 months ago, gamemode is unfinished and script and requires more work There is no #pragma tabsize 0. There are 2 team(Police & Mafia).I was planing to update to SQL but yea i have no time for it maybe soon.I am currently based on Call Of Duty Gamemode! I will keep trying to update this Wonderful Gamemode! If you found any Bug contact me via Private Message!


FEATURES

• Basic Admin system!
• Saving sytsem Y_INI!
• Team Selection & Team Balancer!
• AntiSpawn Kill Protection!
• Unique textdraws!
• Teams(Police & Mafia)!
• Joining/Leaving Messaging!
• Ask/Answer System!
• Random Messages!
• Briefcases!
• Random spawns!
• Spawn Labels!
• Basic Player/Admin Commands!
• Time Left Countdown!
• Anti TeamKill!
• 3 Capturable Zones(Hotel,Town,Hospital)!
• Bank Robbing(BUGGED-EASY FIX)!
• KillingSpree System + Rewards with Unique textdraw!
• Anti Spam
• AntiCommand Spam
• Objects around + Bases Maps(NEW)
• Ammo Packs(3)(Basic)
• Avaiable to report bug(/reportbug) will be saved into Scriptfiles(Bugs.txt)
• Reaction System
• Anims
• Gangzones
• Weapons on Body
• Ping Kick
• Health Pickup at Hospital Zone
• and more.....


PICTURES

http://imgur.com/9OqtjjC
http://imgur.com/kKhFPAh
http://imgur.com/F4cVc6B
http://imgur.com/T8DbEEf
http://imgur.com/CoVYdP9
http://imgur.com/5rlZ2w3
http://imgur.com/beUYiml
http://imgur.com/fLCABDu
http://imgur.com/DSzbg2g
http://imgur.com/qmOguC0
http://imgur.com/3GMpJn1

LINK

http://www.mediafire.com/file/6jk2yxjq66927s8/PvM.pwn
http://www.megafileupload.com/829d/Police_vs_Mafia.rar
https://www.sendspace.com/file/ozq0pv
• *[UPDATED]*http://pastebin.com/Ry2jFX4s



CREDITS

• streamer - Incognito
• ZCMD - Zeex
• Y_INI, sscanf - ******
• Me - for this gamemode
• Thanks to everyone who helped me!
• and thanks to anyone else with their Includes etc..
• If i forget something contact me via Private messaging!
Reply
#2

Will check out the code in a few minutes, what bout anti spawn?

EDIT: Pastebin?
Reply
#3

Nice work..
try to added more cmds :v
+2 Reps :v
Reply
#4

noice
Reply
#5

Good Job! going use it
Reply
#6

GOOD JOB +rep
Reply
#7

PHP код:
CMD:givemoney(playeridparams[])
{
    new 
idmoneystring[128], string2[128],plName[24],aName[24];
    
GetPlayerName(playerid,aName,sizeof(aName));
    
GetPlayerName(id,plName,sizeof(plName));
    if(
pInfo[playerid][Adminlevel] < 4) return SCM(playeridred"[ERROR]: You are not allowed to use this command!");
    {
        if(
sscanf(params,"ii",id,money)) return SCM(playeridred,"[USAGE]: /givemoney (ID) (amount)");
        else
        
GivePlayerMoney(id,money);
        
format(stringsizeof(string),"You have give player %s %d$!"plNamemoney);
        
SCM(playerid0xFF6347AAstring);
        
format(string2 ,sizeof(string2),"{E10000}[CASH]: {FFFFFF}Administrator %s has given you %d$!"aNamemoney);
        
SCM(id0xFF6347AAstring2);
    }
    return 
1;

What? why two strings with 128 cells? It isn't even close to 128, aswell as you could have used only one. Withouting mentioning, this isn't the only command like that.

Also, why did you define all those colors in the gamemode, if you are not even using half of them?

You should try SQLite or MySQL, in my opinion.
Reply
#8

Quote:
Originally Posted by ALiScripter
Посмотреть сообщение
Will check out the code in a few minutes, what bout anti spawn?

EDIT: Pastebin?
AntiSpawn Kill by(You) will be on my another script!

+ Pastebin added


Quote:
Originally Posted by Younes44
Посмотреть сообщение
Nice work..
try to added more cmds :v
+2 Reps :v
Thank You! Going to add it soon!


Quote:
Originally Posted by Eoussama
Посмотреть сообщение
noice
Thanks

Quote:
Originally Posted by Hunud
Посмотреть сообщение
Good Job! going use it
Thanks, enjoy

Quote:
Originally Posted by adrianlouise
Посмотреть сообщение
GOOD JOB +rep
Thanks



Quote:
Originally Posted by Jelly23
Посмотреть сообщение
PHP код:
CMD:givemoney(playeridparams[])
{
    new 
idmoneystring[128], string2[128],plName[24],aName[24];
    
GetPlayerName(playerid,aName,sizeof(aName));
    
GetPlayerName(id,plName,sizeof(plName));
    if(
pInfo[playerid][Adminlevel] < 4) return SCM(playeridred"[ERROR]: You are not allowed to use this command!");
    {
        if(
sscanf(params,"ii",id,money)) return SCM(playeridred,"[USAGE]: /givemoney (ID) (amount)");
        else
        
GivePlayerMoney(id,money);
        
format(stringsizeof(string),"You have give player %s %d$!"plNamemoney);
        
SCM(playerid0xFF6347AAstring);
        
format(string2 ,sizeof(string2),"{E10000}[CASH]: {FFFFFF}Administrator %s has given you %d$!"aNamemoney);
        
SCM(id0xFF6347AAstring2);
    }
    return 
1;

What? why two strings with 128 cells? It isn't even close to 128, aswell as you could have used only one. Withouting mentioning, this isn't the only command like that.

Also, why did you define all those colors in the gamemode, if you are not even using half of them?
Thank you for taking the time to look at the script! I will look into script and fix all while im going to update it soon!
Reply
#9

NOTE: You may find this post offensive, while i want you to improve.

Line number 139 till 155:
PHP код:
//=============================//
//========[TEAMS ZONES]========//
//=============================//
#define TEAM_ZONE_POLICE_COLOR 0x0065E196
#define TEAM_ZONE_MAFIA_COLOR  0xC90E5496
//===========================//
//===========================//
//===========================//
 
//==============================//
//========[TEAMS COLORS]========//
//==============================//
#define TEAM_POLICE_COLOR 0x0065E196
#define TEAM_MAFIA_COLOR  0xC90E5496
//===========================//
//===========================//
//===========================// 
What the heck is this? -_-

Line number 164 till 170 and other lines as well:
PHP код:
new Text:Kill1;
new 
Text:Kill2;
new 
Text:Countdown;
new 
PoliceKills 0;
new 
MafiaKills 0;
new 
CountDownTime 1800;
new 
CDChange
Can be optimized as
PHP код:
new Text:Kill1Text:Kill2Text:CountdownPoliceKillsMafiaKillsCountDownTimeCDChange
Looks like a copy-paste from a script:
PHP код:
new tCP[30]; // why 30 here
new UnderAttack[30] = 0// why 30 here and by default, a variable value is zero
new CP[30]; // why 30 here
new Zone[30]; // why 30 here
new Captured[MAX_PLAYERS][30]; // why 30 here
new UpdateTimer[MAX_PLAYERS];
new 
timer[MAX_PLAYERS][30]; // why 30 here
new CountVar[MAX_PLAYERS][30]; // why 30 here
new Text:CountText[MAX_PLAYERS];
new 
Text:BLine;
new 
IsPlayerCapturing[MAX_PLAYERS][30]; // why 30 here?
new CP_EnterBankCP_ExitBankCP_RobBank;
new 
// what's with the lines from now?
    
IsPossible,
    
general_timer[MAX_PLAYERS],
    
bool:gPlayerRobbing[MAX_PLAYERS]



PHP код:
CreateObject(................) 
Use streamer as you've already included it.

Line number 997 and onwards:
PHP код:
    for(new playerid 0playerid MAX_PLAYERSplayerid++)
    {
    
CountText[playerid] = TextDrawCreate(31.666643321.481628"~r~0/25 ~w~seconds left to capture");
    
TextDrawLetterSize(CountText[playerid], 0.2005551.091853);
    
TextDrawAlignment(CountText[playerid], 1);
    
TextDrawColor(CountText[playerid], -1);
    
TextDrawSetShadow(CountText[playerid], 0);
    
TextDrawSetOutline(CountText[playerid], 1);
    
TextDrawBackgroundColor(CountText[playerid], 51);
    
TextDrawFont(CountText[playerid], 3);
    
TextDrawSetProportional(CountText[playerid], 1);
    }
    for(new 
playerid 0playerid MAX_PLAYERSplayerid++)
    {
    
TDown4[playerid] = TextDrawCreate(41.000000432.600097"NAME: ~r~Zero");
    
TextDrawLetterSize(TDown4[playerid], 0.1749991.053999);
    
TextDrawAlignment(TDown4[playerid], 1);
    
TextDrawColor(TDown4[playerid], -1);
    
TextDrawSetShadow(TDown4[playerid], 0);
    
TextDrawSetOutline(TDown4[playerid], 0);
    
TextDrawBackgroundColor(TDown4[playerid], 51);
    
TextDrawFont(TDown4[playerid], 2);
    
TextDrawSetProportional(TDown4[playerid], 1);
 
    
TDown6[playerid] = TextDrawCreate(200.000000432.862579"CASH: ~r~0~g~$");
    
TextDrawLetterSize(TDown6[playerid], 0.1890001.063332);
    
TextDrawAlignment(TDown6[playerid], 1);
    
TextDrawColor(TDown6[playerid], -1);
    
TextDrawSetShadow(TDown6[playerid], 0);
    
TextDrawSetOutline(TDown6[playerid], 0);
    
TextDrawBackgroundColor(TDown6[playerid], 51);
    
TextDrawFont(TDown6[playerid], 2);
    
TextDrawSetProportional(TDown6[playerid], 1);
.... 
Much more copy-paste work... and indentation is poor, PasteBin fuckery is visible as it adds extra tabs

OnPlayerDeath callback:
PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
... 
No invalid player check...

PHP код:
 SetPlayerHealth(playerid99999.0); 
This isn't infinite...

No proper use of Streamer
No use of switch in OnDialogResponse, also use EasyDialog it's bug-proof.
No need to use Whirlpool it's 2016 and almost 2017, use SHA256 with a salt.
Extremely poor indentation
Some functions are with 'stock' keyword and some are not.
no proper use of functions.
Using the same capture zone code from COD gamemode without credits to the author, Jarnu.
Capture zone is exploitable, either fix it or move towards Gammix' code.
So much large bullshit under OnPlayerUpdate

PHP код:
CMD:dayplayeridparams[ ] )          return SetPlayerTimeplayerid13);
CMD:nightplayeridparams[ ] )        return SetPlayerTimeplayerid0); 
No need to use params[] here, simply use CMD:day(playerid)

How can you fix the following errors and what you learned
  1. Use gammix' code for capture zone
  2. Use player textdraws where necessary and needed, else use global
  3. Remove useless code from OPU, learn why you shouldn't use it, it's called at a minimum rate of 30 times per second.
  4. Use GetPlayerPoolSize for looping, it get's the highest player id that's playing.
  5. params parameter isn't necessary as you aren't using it
  6. Move towards EasyDialog and EasyDB
Reply
#10

Quote:
Originally Posted by ALiScripter
Посмотреть сообщение
NOTE: You may find this post offensive, while i want you to improve.

Line number 139 till 155:
PHP код:
//=============================//
//========[TEAMS ZONES]========//
//=============================//
#define TEAM_ZONE_POLICE_COLOR 0x0065E196
#define TEAM_ZONE_MAFIA_COLOR  0xC90E5496
//===========================//
//===========================//
//===========================//
 
//==============================//
//========[TEAMS COLORS]========//
//==============================//
#define TEAM_POLICE_COLOR 0x0065E196
#define TEAM_MAFIA_COLOR  0xC90E5496
//===========================//
//===========================//
//===========================// 
What the heck is this? -_-

Line number 164 till 170 and other lines as well:
PHP код:
new Text:Kill1;
new 
Text:Kill2;
new 
Text:Countdown;
new 
PoliceKills 0;
new 
MafiaKills 0;
new 
CountDownTime 1800;
new 
CDChange
Can be optimized as

PHP код:
new Text:Kill1Text:Kill2Text:CountdownPoliceKillsMafiaKillsCountDownTimeCDChange
Looks like a copy-paste from a script:
PHP код:
new tCP[30];
new 
UnderAttack[30] = 0;
new 
CP[30];
new 
Zone[30];
new 
Captured[MAX_PLAYERS][30];
new 
UpdateTimer[MAX_PLAYERS];
new 
timer[MAX_PLAYERS][30];
new 
CountVar[MAX_PLAYERS][30];
new 
Text:CountText[MAX_PLAYERS];
new 
Text:BLine;
new 
IsPlayerCapturing[MAX_PLAYERS][30];
new 
CP_EnterBankCP_ExitBankCP_RobBank;
new
    
IsPossible,
    
general_timer[MAX_PLAYERS],
    
bool:gPlayerRobbing[MAX_PLAYERS]



PHP код:
CreateObject(................) 
Use streamer as you've already included it.

Line number 997 and onwards:
PHP код:
    for(new playerid 0playerid MAX_PLAYERSplayerid++)
    {
    
CountText[playerid] = TextDrawCreate(31.666643321.481628"~r~0/25 ~w~seconds left to capture");
    
TextDrawLetterSize(CountText[playerid], 0.2005551.091853);
    
TextDrawAlignment(CountText[playerid], 1);
    
TextDrawColor(CountText[playerid], -1);
    
TextDrawSetShadow(CountText[playerid], 0);
    
TextDrawSetOutline(CountText[playerid], 1);
    
TextDrawBackgroundColor(CountText[playerid], 51);
    
TextDrawFont(CountText[playerid], 3);
    
TextDrawSetProportional(CountText[playerid], 1);
    }
    for(new 
playerid 0playerid MAX_PLAYERSplayerid++)
    {
    
TDown4[playerid] = TextDrawCreate(41.000000432.600097"NAME: ~r~Zero");
    
TextDrawLetterSize(TDown4[playerid], 0.1749991.053999);
    
TextDrawAlignment(TDown4[playerid], 1);
    
TextDrawColor(TDown4[playerid], -1);
    
TextDrawSetShadow(TDown4[playerid], 0);
    
TextDrawSetOutline(TDown4[playerid], 0);
    
TextDrawBackgroundColor(TDown4[playerid], 51);
    
TextDrawFont(TDown4[playerid], 2);
    
TextDrawSetProportional(TDown4[playerid], 1);
 
    
TDown6[playerid] = TextDrawCreate(200.000000432.862579"CASH: ~r~0~g~$");
    
TextDrawLetterSize(TDown6[playerid], 0.1890001.063332);
    
TextDrawAlignment(TDown6[playerid], 1);
    
TextDrawColor(TDown6[playerid], -1);
    
TextDrawSetShadow(TDown6[playerid], 0);
    
TextDrawSetOutline(TDown6[playerid], 0);
    
TextDrawBackgroundColor(TDown6[playerid], 51);
    
TextDrawFont(TDown6[playerid], 2);
    
TextDrawSetProportional(TDown6[playerid], 1);
.... 
Much more copy-paste work... and indentation is poor, PasteBin fuckery is visible as it adds extra tabs

OnPlayerDeath callback:
PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
... 
No invalid player check...

PHP код:
 SetPlayerHealth(playerid99999.0); 
This isn't infinite...

No proper use of Streamer
No use of switch in OnDialogResponse, also use EasyDialog it's bug-proof.
No need to use Whirlpool it's 2016 and almost 2017, use SHA256 with a salt.
Extremely poor indentation
Some functions are with 'stock' keyword and some are not.
no proper use of functions.
Using the same capture zone code from COD gamemode without credits to the author, Jarnu.
Capture zone is exploitable, either fix it or move towards Gammix' code.
So much large bullshit under OnPlayerUpdate

PHP код:
CMD:dayplayeridparams[ ] )          return SetPlayerTimeplayerid13);
CMD:nightplayeridparams[ ] )        return SetPlayerTimeplayerid0); 
No need to use params[] here, simply use CMD:day(playerid)

How can you fix these
  1. Use gammix' code for capture zone
  2. Use player textdraws where necessary
  3. Remove useless code from OPU, learn why you shouldn't use it, it's called at a minimum rate of 30 times per second.
  4. Use GetPlayerPoolSize for looping
Well yea thanks , I'll probably work on that! Anyone can expect shits even i As i said above

Quote:

Hi there, so yeah i stopped working on it 6-7 months ago, gamemode is unfinished and script and requires more work There is no #pragma tabsize 0. There are 2 team(Police & Mafia).I was planing to update to SQL but yea i have no time for it maybe soon.I am currently based on Call Of Duty Gamemode! I will keep trying to update this Wonderful Gamemode! If you found any Bug contact me via Private Message!

and thanks to anyone else with their Includes etc..

Reply
#11

Keep up the good work bro
Reply
#12

Quote:
Originally Posted by RyderX
Посмотреть сообщение
Keep up the good work bro
Thanks
Reply
#13

Nice waiting for update! :d
Reply
#14

Quote:
Originally Posted by Hunud
Посмотреть сообщение
Nice waiting for update! :d
You'll have to wait a bit
Reply
#15

nice work man keep up to good work
Reply
#16

Please tell me that it's advanced... re-check my previous reply. I guess you simply ignored by previous message with a story.
Reply
#17

Reply
#18

Thanks guys


Quote:
Originally Posted by ALiScripter
Посмотреть сообщение
Please tell me that it's advanced... re-check my previous reply. I guess you simply ignored by previous message with a story.
Obviously I'm working on that thank you very much for taking time for this, the correct what was a mistake and improve this code! Thanks
Reply
#19

Quote:
Originally Posted by Scripter18
Посмотреть сообщение
Thanks guys




Obviously I'm working on that thank you very much for taking time for this, the correct what was a mistake and improve this code! Thanks
Good to see you are making an effort Will rate the thread once I find this fixed from errors and bugs.
Reply
#20

Please kindly upload in solidfiles or mediafire, Thank you!

BTW +Rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)