[FilterScript] DeathMatch Event [Friendly, Funny, Controllable]
#1

Death Match Event System


Introduction
Hello there, so i'm releasing today my first new system, it's a DM Event, i recommend you to use it in your server!
it's great for Roleplay,Freeroam,TDM,CnR, And whatever because it has a very nice content as i am enjoying scripting it and playing it haha

Features
  • This DM Event is much Controllable because it has a gold command and it's /fire, so an admin could kick players from the Event if they abused or if they was using hack or whatever.
  • Random Event Spawns.
  • Event Timer to start.
  • A Little DM Map.
  • Added /dmcmds to see DM Events available commands.
  • FOR MORE READ UPDATES PARAGRAPH.
Updates
  • Optimized some little messy codes, and the language.
  • Combined /startdm with /dmevent, because it was facing a little annoying problem, so now when you start a DM event by typing /dmevent, you will have to type it again to CLOSE the DM event and START it. (Just once).
  • Added /updates commands, so you'll not lose any news feed.
  • Added a `Text` for the reason of the firing, so you are now be able to kick/fire a cheater from the DM event with a reason.
  • Added a Message to a player when he join/leave the DM event, so players will be notified when someone joins the DM Event.
  • Added /leavedm command, so if player got bored waiting the event to start he can simply type /leavedm and leave.
  • Added a new variable new EventStarted[MAX_PLAYERS]; to facilitate the work .
How to Install it
Just download the .pwn file below in the Downloads Category and Copy all the content or download it, then paste the codes which it's in it into Pawno.exe and compile it then use the .amx copy to Load the filterscript.
and then go to your server.cfg and then open it and go the filterscripts line and write behind it Event the close the server.cfg and save allthings and start your server and enjoy playing the event system!

Pictures
Outdated:
http://imgur.com/2Pm33GS
http://imgur.com/0XLLGgQ
http://imgur.com/54tX7b3
http://imgur.com/bLSbvQ1 (ain't updating it... sorry)

Requirements
You'll need to run the script correctly these .inc files:

zcmd.inc - https://sampforum.blast.hk/showthread.php?tid=91354
sscanf2.inc - https://sampforum.blast.hk/showthread.php?tid=602923
foreach.inc - https://sampforum.blast.hk/showthread.php?tid=570868

Downloads
| Pastebin | [Version 1.0]
| Pastebin | [Version 1.1]
| Pastebin | [Version 1.2 + Recommended]
| GitHub | [Version 1.2 + Recommended + plugins and includes]
• Suggestions are welcome!
• If you find anything strange, let me know then, by a PM or discord (in my Signature)!
• Thanks for reading my thread
Reply
#2

Could you please fix the indentation?
Reply
#3

Quote:
Originally Posted by Infinity
Посмотреть сообщение
Could you please fix the indentation?
Hello Infinity, i can't see any poor indentation can you mark them if you could please
Reply
#4

Bad because no dm leave cmd, and many other things, What is the point of this:
Код:
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
TogglePlayerControllable(i, 1);
SCMTA(-1,"{800080}[EVENT STARTED] {fef65b}An Administrator has Started the DM Event!");
GameTextForPlayer(i, "~W~EVENT ~Y~HAS ~G~BEEN ~B~STARTED!",3000,3);
if(!IsPlayerAdmin(playerid)) return SCM(playerid, -1, "{f00f00}[ERROR]: {FFFFFF}You are not authorized to use this command!");
EventOpened[playerid] = 0;
InEvent[playerid] = 1;
}
}
Reply
#5

Quote:
Originally Posted by coool
Посмотреть сообщение
Bad because no dm leave cmd, and many other things, What is the point of this:
Код:
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
TogglePlayerControllable(i, 1);
SCMTA(-1,"{800080}[EVENT STARTED] {fef65b}An Administrator has Started the DM Event!");
GameTextForPlayer(i, "~W~EVENT ~Y~HAS ~G~BEEN ~B~STARTED!",3000,3);
if(!IsPlayerAdmin(playerid)) return SCM(playerid, -1, "{f00f00}[ERROR]: {FFFFFF}You are not authorized to use this command!");
EventOpened[playerid] = 0;
InEvent[playerid] = 1;
}
}
It's meant to unfreeze all Players whom in the dm event.

EDIT: and if you would i'll add /leavedm command.
Reply
#6

Quote:
Originally Posted by RxErT
Посмотреть сообщение
Hello Infinity, i can't see any poor indentation can you mark them if you could please
Any time you, for example, notice multiple brackets under eachother like this:
Код:
}
}
you know it's badly indented. The basic rule is to always indent one 'step' when you use an opening bracket, and to go back one step when using a closing bracket.
Reply
#7

PHP код:
for(new 0i<MAX_PLAYERSi++) //Use GetPlayerPoolSize
{
if(
IsPlayerConnected(i))
{
TogglePlayerControllable(i1);
SCMTA(-1,"{800080}[EVENT STARTED] {fef65b}An Administrator has Started the DM Event!");//This will send every
 
one a message multiple time forexample if 50 players are connected it will show message to everyone 50 time.
GameTextForPlayer(i"~W~EVENT ~Y~HAS ~G~BEEN ~B~STARTED!",3000,3); //Use GameTextForAll (outside the loop
if(!IsPlayerAdmin(playerid)) return SCM(playerid, -1"{f00f00}[ERROR]: {FFFFFF}You are not authorized to use this command!"); //Why are you checking admin in a `for` loop
EventOpened[playerid] = 0//This must be out side from the `for` loop.
InEvent[playerid] = 1//This too
}

Will become good if you fix many things
Reply
#8

Thanks Infinity and coool for teaching me!
i'll work on them in the up coming version!

by the way, i didn't know that if you like it or not i'd hear!
Reply
#9

PHP код:
if(weapon || weapon 46) return SCM(playerid,-1,"{f00f00}[ERROR]: {F00f00}Invalid WeaponID"); 
Also id between 19 & 21 are invalid:
PHP код:
IsValidWeapon(weaponid)
    return (
<= weaponid <= 46) && !(19 <= weaponid <= 21) ? true false
PHP код:
      SetPlayerArmour(playerid100);
       
SetPlayerHealth(playerid100); 
It's better to write 100.0 since the parameter is a float. I know it's not very important but it's better to take a good habit.

PHP код:
new InEvent[MAX_PLAYERS]; //Checking player if he is in/out event.
new EventOpened[MAX_PLAYERS]; //Checking if Event is opened to join it. 
This can be declared as a boolean and used as such.
Also declaring variables like this is more clear (it's my own opinion)
PHP код:
new
    
FirstVariable,
    
SecondVariable,
    
LastVariable
Reply
#10

Everytime you start an event, you create the Mappings.
Start a few Events and you'll have FPS Lags / reach the maximum create objects (1000)
Reply
#11

Quote:
Originally Posted by JustMe.77
Посмотреть сообщение
Everytime you start an event, you create the Mappings.
Start a few Events and you'll have FPS Lags / reach the maximum create objects (1000)
Any suggestions to improve?

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
PHP код:
if(weapon || weapon 46) return SCM(playerid,-1,"{f00f00}[ERROR]: {F00f00}Invalid WeaponID"); 
Also id between 19 & 21 are invalid:
PHP код:
IsValidWeapon(weaponid)
    return (
<= weaponid <= 46) && !(19 <= weaponid <= 21) ? true false
PHP код:
      SetPlayerArmour(playerid100);
       
SetPlayerHealth(playerid100); 
It's better to write 100.0 since the parameter is a float. I know it's not very important but it's better to take a good habit.

PHP код:
new InEvent[MAX_PLAYERS]; //Checking player if he is in/out event.
new EventOpened[MAX_PLAYERS]; //Checking if Event is opened to join it. 
This can be declared as a boolean and used as such.
Also declaring variables like this is more clear (it's my own opinion)
PHP код:
new
    
FirstVariable,
    
SecondVariable,
    
LastVariable
Thanks very much! i'd improve it in up coming version!


Thanks for rating it
Reply
#12

Quote:
DM Event has been updated to v1.1

~Added People improving things~
~Fixed a lot of bugs/indentation~ [Thanks to coool and Infinity]
~Optimized some things~ [Thanks to cool]
~Any suggestions/improvements are welcome!
Reply
#13

It doesn't seem like you did anything to fix the indentation.
Reply
#14

use foreach
and use this to fix the indentation http://courses.cs.washington.edu/cou...au/indent.html
Reply
#15

Quote:
DM Event has been updated to v1.1

~Added People improving things~
~Fixed a lot of bugs/indentation~ [Thanks to coool and Infinity]
~Optimized some things~ [Thanks to cool]
~Added Foreach! [Thanks to SyS]
~Fixed Indentation [Thanks to SyS]
~Any suggestions/improvements are welcome!
Reply
#16

Intendation still not fix. Also, you foreach version is deprecate.
Take this one (some fixe of the foreach standalone version), from Ziggi a great scripter ; https://github.com/Open-GTO/foreach/...er/foreach.inc
PHP код:
foreach(Playeri) -> foreach(new Player
Reply
#17

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
Intendation still not fix. Also, you foreach version is deprecate.
Take this one (some fixe of the foreach standalone version), from Ziggi a great scripter ; https://github.com/Open-GTO/foreach/...er/foreach.inc
PHP код:
foreach(Playeri) -> foreach(new Player
Mate, i used the site which SyS's sent, it's for fixing indentation and it's fixed,
Btw, what's is the different between foreach(Player, i) and foreach(new i : Player) ?
Reply
#18

Quote:
Originally Posted by RxErT
Посмотреть сообщение
Mate, i used the site which SyS's sent, it's for fixing indentation and it's fixed,
Btw, what's is the different between foreach(Player, i) and foreach(new i : Player) ?
Yep, my bad. Pastebin make some things weird on your script. Also, you should intend the beginning
PHP код:
new
InEvent[MAX_PLAYERS],  //Checking player if he is in/out event
EventOpened[MAX_PLAYERS], //Checking if Event is opened to join it.
weapon//Weapon variable.
->
new
    InEvent
[MAX_PLAYERS],  //Checking player if he is in/out event
    
EventOpened[MAX_PLAYERS], //Checking if Event is opened to join it.
    
weapon//Weapon variable. 
It looks like better. If you don't know, learn (not for this case) to intend your code. The website should just help you to understand how to do it.
The last one is the most recent version. The other one is deprecate.
Reply
#19

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
Yep, my bad. Pastebin make some things weird on your script. Also, you should intend the beginning
PHP код:
new
InEvent[MAX_PLAYERS],  //Checking player if he is in/out event
EventOpened[MAX_PLAYERS], //Checking if Event is opened to join it.
weapon//Weapon variable.
->
new
    InEvent
[MAX_PLAYERS],  //Checking player if he is in/out event
    
EventOpened[MAX_PLAYERS], //Checking if Event is opened to join it.
    
weapon//Weapon variable. 
It looks like better. If you don't know, learn (not for this case) to intend your code. The website should just help you to understand how to do it.
The last one is the most recent version. The other one is deprecate.
Well, ye i'm trying to learn mate thanks for all your helps
Reply
#20

i can't use /dmcmds
it says
you are not authorized to use this command help me please !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)