SA-MP Forums Archive
[FilterScript] DeathMatch Event [Friendly, Funny, Controllable] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] DeathMatch Event [Friendly, Funny, Controllable] (/showthread.php?tid=634360)

Pages: 1 2


DeathMatch Event [Friendly, Funny, Controllable] - RxErT - 17.05.2017

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 Updates 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



Re: DeathMatch Event [Friendly, Funny, Controllable] - Infinity - 17.05.2017

Could you please fix the indentation?


Re: DeathMatch Event [Friendly, Funny, Controllable] - RxErT - 17.05.2017

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


Re: DeathMatch Event [Friendly, Funny, Controllable] - coool - 17.05.2017

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;
}
}



Re: DeathMatch Event [Friendly, Funny, Controllable] - RxErT - 17.05.2017

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.


Re: DeathMatch Event [Friendly, Funny, Controllable] - Infinity - 17.05.2017

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.


Re: DeathMatch Event [Friendly, Funny, Controllable] - coool - 17.05.2017

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


Re: DeathMatch Event [Friendly, Funny, Controllable] - RxErT - 17.05.2017

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!


Re: DeathMatch Event [Friendly, Funny, Controllable] - Dayrion - 17.05.2017

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



Re: DeathMatch Event [Friendly, Funny, Controllable] - JustMe.77 - 17.05.2017

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)


Re: DeathMatch Event [Friendly, Funny, Controllable] - RxErT - 17.05.2017

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


Re: DeathMatch Event [Friendly, Funny, Controllable] - RxErT - 18.05.2017

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!


Re: DeathMatch Event [Friendly, Funny, Controllable] - Infinity - 18.05.2017

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


Re: DeathMatch Event [Friendly, Funny, Controllable] - SyS - 18.05.2017

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


Re: DeathMatch Event [Friendly, Funny, Controllable] - RxErT - 18.05.2017

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!


Re: DeathMatch Event [Friendly, Funny, Controllable] - Dayrion - 18.05.2017

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



Re: DeathMatch Event [Friendly, Funny, Controllable] - RxErT - 18.05.2017

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) ?


Re: DeathMatch Event [Friendly, Funny, Controllable] - Dayrion - 18.05.2017

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.


Re: DeathMatch Event [Friendly, Funny, Controllable] - RxErT - 19.05.2017

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


Re: DeathMatch Event [Friendly, Funny, Controllable] - XxMadmanxX - 21.05.2017

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