Raised This Month: $51 Target: $400
 12% 

AMXX Minigames


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 07-05-2015 , 13:22   AMXX Minigames
Reply With Quote #1

AMXX Minigames
v1.3


Minigames is a way to spend time as a dead player,
you will be able to play games against other players while your dead.
Orginally created for 'Jailbreak'-mod, beacause of the long roundtimes,
but it should be possible in most mods.

Games there are two different game-types, one of them is 'Open-world',
this means that you don't have to create a private game, and there are no player limits,
everyone can join / leave when they want, an example of this is Deathmatch.
Then you can also create a private party, invite friends and even play for cash (if Addon_Gamble installed).

System contains a dimension-system, were players from other games will be separated,
they cannot hear and see each-other. Also players in a minigame are 'spectator', and alive.

Before private-minigame can be created, first job is creating a fighting-zone.
This can be done by opening the menu with /areamaker, the first zone you make must be the ground (This will be used to spawn players = unsolid zone).
All the next zones are solid walls, to make sure they cant leave the area (football field for example). Credits Alka's areamaker.
When your creating a zone, you need to aim to a spot with your knife and slash it.



Commands
  • /mg

Minigames - Main
v1.3
  • Public release

Minigame_Map_Laserrace
This minigame is specially made for the map jail_aj_bananamuffin.

Minigame_Defaults
This file contains knife battle and scoutzknivez battle.


Pictures
Attached Files
File Type: sma Get Plugin or Get Source (Minigame_Addon_Gamble.sma - 1080 views - 1.1 KB)
File Type: sma Get Plugin or Get Source (Minigame_Shot4Shot.sma - 1042 views - 1.5 KB)
File Type: sma Get Plugin or Get Source (Minigame_Defaults.sma - 1082 views - 1.4 KB)
File Type: sma Get Plugin or Get Source (Minigame_Deathmatch.sma - 1026 views - 2.8 KB)
File Type: sma Get Plugin or Get Source (Minigame_Map_Laserrace.sma - 1055 views - 4.0 KB)
File Type: sma Get Plugin or Get Source (Menu_Popup.sma - 1120 views - 4.7 KB)
File Type: inc minigames.inc (1.3 KB, 433 views)
File Type: sma Get Plugin or Get Source (Minigames.sma - 1110 views - 63.9 KB)
File Type: inc minigame_spawns.inc (4.8 KB, 341 views)
__________________
Retired.

Last edited by Xalus; 08-01-2015 at 10:01.
Xalus is offline
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 07-05-2015 , 15:09   Re: AMXX Minigames
Reply With Quote #2

I will definitely use it, thanks man.
AND GJ .

EDIT :

[Minigames.sma]
  • Is there a reason to use a global var? its used in one function. g_flOriginarea, why not just calling it in the callback.
  • Don't hardcode string size you can use charsmax() to get it i'm talking about get_msg_arg_string(4, weapon, 31) .
  • new weapon[32] can be new weapon[11]
  • A small sugges, to not confuse the others you can change the new id in Message_DeathMsg() to killerid because the id can be for the victim and killer ( I KNOW THAT YOU DECLARE THE VICTIMID , ITS JUST JUST FOR READABILITY )

  • PHP Code:
    for(new 0intPlayersi++)
            {
                if(
    is_user_connected(arrayPlayers[i])
                && 
    g_arrayPlayer[victim][PLAYER_GAME] == g_arrayPlayer[arrayPlayers[i]][PLAYER_GAME])
                {            
                    
    message_begin(MSG_ONEintDeathMsg, {0,0,0}, arrayPlayers[i])
                    
    write_byte(id);
                    
    write_byte(victim);
                    
    write_byte(headshot);
                    
    write_string(weapon);
                    
    message_end();
                }

  • Sorry, why do you check is_user_connected()? isn't get_players() retrieve the list of connected players?
  • set_task(0.1, "Task_RemoveGuns", id); are u using it for a reason? why not just Task_RemoveGuns(id)
    EDIT, After doing a small test, i just figure out 0.1 is little faster than calling it directly.
    Code:
    set_task , 0.1 run in  : 0:00:026 | Calling it directly, run in : 0:00:078  
    set_task , 0.1 run in  : 0:00:024 | Calling it directly, run in : 0:00:082
    set_task , 0.1 run in  : 0:00:025 | Calling it directly, run in : 0:00:084
    set_task , 0.1 run in  : 0:00:029 | Calling it directly, run in : 0:00:074
  • Task_RemoveGuns() remove the check is_user_alive() u already check it in the spawn.
    -
    PHP Code:
            if(is_user_connected(g_arrayGame[iGame][GAME_PLAYERS i]))
            {
                if(
    is_user_alive(g_arrayGame[iGame][GAME_PLAYERS i])) 
  • charsmax() should be used instead of sizeof x - 1 when you are refering to size of a string array, its just for readability.


[ Laser race ]
  • You can reduce buffer for get_mapname, 32 enough.

Correct me if i'm wrong, if i'm wrong sorry lol .

Last edited by Freezo Begin; 08-31-2015 at 22:10.
Freezo Begin is offline
tousif
AlliedModders Donor
Join Date: Nov 2014
Location: India
Old 07-06-2015 , 04:04   Re: AMXX Minigames
Reply With Quote #3

Nice Will Test it
tousif is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-06-2015 , 08:09   Re: AMXX Minigames
Reply With Quote #4

This is what I was waiting for to use in a JailBreak server. I'm testing it right now. So far I only noticed that you misspelled the library name (minigame_spawns), it should be minigames_spawns, compiling it wouldn't work with that name. Also, I suggest changing the "/mg" command, because many JB servers use a shop plugin which has the same command for giving/taking JBPacks. I also have a question - would removing the code that makes the players spectators affect the entire game?

//Edit: For some reason players aren't able to damage each other in deathmatch mode, when they are spectators. I can only see my self being a spectator, while the other players are being displayed in their previous team, sometimes with a different model, for example a CT model when they are on the terrorists team. I tried to start a knife battle, but it crashed my server as soon as I chose the "start game" option. Am I the only one having these problems?

Last edited by OciXCrom; 07-06-2015 at 09:08.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 07-06-2015 , 11:47   Re: AMXX Minigames
Reply With Quote #5

Quote:
Originally Posted by OciXCrom View Post
This is what I was waiting for to use in a JailBreak server. I'm testing it right now. So far I only noticed that you misspelled the library name (minigame_spawns), it should be minigames_spawns, compiling it wouldn't work with that name. Also, I suggest changing the "/mg" command, because many JB servers use a shop plugin which has the same command for giving/taking JBPacks. I also have a question - would removing the code that makes the players spectators affect the entire game?

//Edit: For some reason players aren't able to damage each other in deathmatch mode, when they are spectators. I can only see my self being a spectator, while the other players are being displayed in their previous team, sometimes with a different model, for example a CT model when they are on the terrorists team. I tried to start a knife battle, but it crashed my server as soon as I chose the "start game" option. Am I the only one having these problems?
mp_friendlyfire must be on, most servers got it, and block teamdamage for Terrorists.
__________________
Retired.
Xalus is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 07-06-2015 , 12:56   Re: AMXX Minigames
Reply With Quote #6

@Freezo Begin
- The task is for start weapons, I need a little delay, so Map doesnt give the player the guns.
- is_user_alive check is security if spawnkilled or wathever, never bad to have some extra security.
- I do need to check if user connected because is_user_alive(). (If you check the function atleast).
- And the other things are small mistakes, that I can fix later.

@OciXCrom
- I make them spectator because thats the easyest way. I included a Roundend_Pre,
that predicts roundending, so minigames ends before the actually roundend.
So there shouldnt be any problem with teambalance, ..

-EDIT-
I will make some edits so its easyer for everyone to use. (Friendlyfire included and all)
__________________
Retired.

Last edited by Xalus; 07-06-2015 at 14:13.
Xalus is offline
asur
Member
Join Date: Dec 2014
Old 08-17-2015 , 00:46   Re: AMXX Minigames
Reply With Quote #7

Quote:
Originally Posted by Xalus View Post
mp_friendlyfire must be on, most servers got it, and block teamdamage for Terrorists.
I didnt get u o.O ........friendlyfire is on but how to block team damage ts o.O ????
Somehow ham_takedamage func is not working as after dying and entering into minigame ghost plrys cant do damage on other ghost plrys !!!!

Last edited by asur; 08-17-2015 at 10:29.
asur is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 08-17-2015 , 11:08   Re: AMXX Minigames
Reply With Quote #8

Code:
//// Minigames.sma
// F:\SteamCMD\steamapps\common\Half-Life\cstrike\addons\amxmodx\scripting\Minigames.sma(15) : fatal error 100: cannot read from file: "minigames_spawns"
//
// Compilation aborted.
// 1 Error.
// Could not locate output file compiled\Minigames.amx (compile failed).
//
// Compilation Time: 0,14 sec
// ----------------------------------------
Please change the line:
PHP Code:
#include <minigames_spawns> 
to
PHP Code:
#include <minigame_spawns> 
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective

Last edited by addons_zz; 08-17-2015 at 11:19. Reason: Change from tag QUOTE to CODE the error message
addons_zz is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 09-09-2015 , 18:50   Re: AMXX Minigames
Reply With Quote #9

Any updates soon?
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 09-10-2015 , 11:52   Re: AMXX Minigames
Reply With Quote #10

Quote:
Originally Posted by OciXCrom View Post
Any updates soon?
I actually wanted to delete this thread.
But I will take some time free, soon to fix it a bit.
__________________
Retired.
Xalus is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:02.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode