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

Duels help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 12-28-2015 , 04:41   Duels help
Reply With Quote #1

fixed

Last edited by raizo11; 11-06-2017 at 22:46.
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
Visinescu
Senior Member
Join Date: Dec 2015
Location: England now,Home Romania
Old 12-28-2015 , 04:49   Re: Duels help
Reply With Quote #2

Edited

Last edited by Visinescu; 11-15-2017 at 00:14.
Visinescu is offline
Kazalu
Senior Member
Join Date: Dec 2013
Location: Romania
Old 12-28-2015 , 04:52   Re: Duels help
Reply With Quote #3

Hey!

This is more of a request, not a Scripting Help post, but still.

I'm Tattoo's scripter from the knife server. Might've heared about me, mr. Raizo. I know I am not supposed to help you, because of our relationship, but here we go.

I think it would be easier if you'd rewrite the code from the scratch, as it would be a pain in the ass to modify a code that big.

If though you don't want to take this into consideration, I'm gonna give you this information :
In order to respawn a player you're gonna have to use the << spawn( id ) >> function. Sometimes the client gets bugged, so you'll have to use the spawn( id ) func twice. How?

Quote:
set_task( 0.5, "SpawnHim", id );
set_task( 0.7, "SpawnHim", id );
The SpawnHim function should look like that :

Quote:
public SpawnHim( id )
spawn( id );
You will also have to change the players' positions after you move them. How?

Quote:
new Float:Origin[ 3 ];
Origin[ 0 ] = blabla;
Origin[ 1 ] = blabla2;
Origin[ 2 ] = blabla3;

set_pev( id, pev_origin, Origin );
blabla, blabla2, blabla3 are 3 floats which set the x, y and z coordinates of the spawn.

After that, you're gonna have to give players the needed weapons using give_item( id, "weapon_blabla" ).
Check out the weapon codes in order to use give_item.

That's about it.

Last edited by Kazalu; 12-28-2015 at 04:55.
Kazalu is offline
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 01-13-2016 , 14:02   Re: Duels help
Reply With Quote #4

Bump!
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 01-13-2016 , 19:15   Re: Duels help
Reply With Quote #5

Quote:
Originally Posted by raizo11
Can u look my thried and can u say me is possible what I want?

https://forums.alliedmods.net/showthread.php?t=276777
Sure it is possible, the right question is: How much time/Knowledge would take to accomplish it? i.e., to write/modify your code to get it done?

Now, to me get this done, I do not know how much time would take. But my first step would be to get to know that code and learn if it is working correctly. After that, and as I already know the code, I would think about some strategy/algorithm to get it done.

One thing that help me is to debug the code as a way to get to know it. Here I made a tutorial explaining a debugging system I used to build my plugins, see if it helps you.
__________________
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; 01-13-2016 at 19:17. Reason: spelling fix
addons_zz is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 01-23-2016 , 01:02   Re: Duels help
Reply With Quote #6

Quote:
Originally Posted by raizo11
Can you explain more how to make more rounds please
Look at these highlighted code lines. Using these, you can count the wins and rounds, then to create a logic/algorithm to your plugin and force/allow it to control the plugin as you want to: duel ends after one player win with 10-0 or 10-4 or 10-6 variable score ... But 9-0 of 9-4 or 9-9 round not end ... after duel ends respawn players normal. After duel ends get to all message ... Winner name win with [10-9,10-2,10-5] Losser name lose with [9-10 , 2-10, 5-10]

To know how to control your plugin, you must to know how it starts and ends the duel, then you can block it and only allow it to end, when your rules are fit. See these highlighted code lines to have an example about how to block/allow some behavior. To acquire such Knowledge, you can read/debug your code.
__________________
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; 01-23-2016 at 09:20. Reason: spelling fix
addons_zz is offline
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 01-23-2016 , 09:16   Re: Duels help
Reply With Quote #7

is difficult for me thank you anyway
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 01-26-2016 , 16:14   Re: Duels help
Reply With Quote #8

Here you can see what I changed:
https://gist.github.com/addonszz/e2831dd591d6deb4d710/revisions?diff=split

It is done, but last some things to do.

TODO list:
  • block round end, when there is only 2 players.
  • Improve the stop system, beyond 'say /stopduel'
  • Fix the save and read origins system, which is not working.
  • Create a built-in revive system, instead of just use the 'amx_revive' from "amx super" plugin.
  • Remove player weapons after revive.
To finish would take more time, but it already has took one hour, but it should take half, so i stopped.
Attached Files
File Type: sma Get Plugin or Get Source (knife_duel.sma - 446 views - 17.4 KB)
__________________
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; 01-26-2016 at 18:12. Reason: spelling fix
addons_zz is offline
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 02-24-2016 , 01:20   Re: Duels help
Reply With Quote #9

Thanks for you work but
I want to respawn challenger + challenged

Can you make for example :

Code:
public plugin_init() 
{
    register_plugin( "duel" , "0.1" , "x" );
    
    RegisterHam( Ham_Killed , "player" , "fw_PlayerKilled_Post" , true ); // Define player (player = challenger + challenged)
}


public fw_PlayerKilled_Post( g_iChallenged  , g_iChallenger )  
{
    if ( g_iChallenged  == g_iChallenger || !is_user_alive( g_iChallenger) ) 
        return;
Code:
public duel(id)
{
	switch(challenge[id])
	{
	    	case 0:
	    	{
                        ExecuteHamB(Ham_CS_RoundRespawn, g_iChallenged) 
                        set_pev( g_iChallenged , pev_origin , { 300.0 , -150.0 , -650.0 } );
                        ExecuteHamB(Ham_CS_RoundRespawn, g_iChallenger) 
                        set_pev( g_iChallenger , pev_origin , { 50.0 , -150.0 , -650.0 } );
		}
		case 1:
		{
                        ExecuteHamB(Ham_CS_RoundRespawn, g_iChallenged) 
                        set_pev( g_iChallenged , pev_origin , { 300.0 , -150.0 , -650.0 } );
                        ExecuteHamB(Ham_CS_RoundRespawn, g_iChallenger) 
                        set_pev( g_iChallenger , pev_origin , { 50.0 , -150.0 , -650.0 } );
		}
		case 2:
		{
                        ExecuteHamB(Ham_CS_RoundRespawn, g_iChallenged) 
                        set_pev( g_iChallenged , pev_origin , { 300.0 , -150.0 , -650.0 } );
                        ExecuteHamB(Ham_CS_RoundRespawn, g_iChallenger) 
                        set_pev( g_iChallenger , pev_origin , { 50.0 , -150.0 , -650.0 } );
		}
		case 3:
		{
                        ExecuteHamB(Ham_CS_RoundRespawn, g_iChallenged) 
                        set_pev( g_iChallenged , pev_origin , { 300.0 , -150.0 , -650.0 } );
                        ExecuteHamB(Ham_CS_RoundRespawn, g_iChallenger) 
                        set_pev( g_iChallenger , pev_origin , { 50.0 , -150.0 , -650.0 } );
		}
	}
	challenge[id]++
}

Last edited by raizo11; 02-24-2016 at 01:33.
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
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 10:00.


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