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

One Shot, One Kill


Post New Thread Reply   
 
Thread Tools Display Modes
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-22-2009 , 14:33   Re: One Shot, One Kill
Reply With Quote #11

Hi. Some suggestions :

- FM_SetModel ; since you're using Ham It would be more efficient to use Ham_Touch with "weaponbox" and checking when he touches the ground. So your functon will look something like :

Code:
public WeaponBox_Touch ( const Entity, const Other ) {     if ( !Other )     {         set_pev( Entity, pev_nextthink, get_gametime() + get_pcvar_float( cvar_dropped ) );     } }
- set_weapons() ; I would check the cvar before is_user_alive()
- ham_damage() : Try to keep the condition in one line. No need to test if task exists, remove it directly. Your switch is pointless here. Somethink like is optimized :
Code:
    if ( get_pcvar_num( cvar_enabled ) && ( damagebits & DMG_FALL ) )     {         remove_task( this+123 );         pev( this, pev_health, Health[ this ] );                 return HAM_SUPERCEDE;     }         return HAM_IGNORED;
- plugin_message() : LANG_PLAYER should be id here. LANG_PLAYER should be used for all players. ( 0 as id )
- help_motd() ; motd size is too big. I think the limit that a modt can be displayed is around ~1500 characters. But your motd seems to use around ~600 characters ; it should be enough to use 1024 as size.
- fm_set_user_money() : Change MSG_ONE by MSG_ONE_UNRELIABLE ; and cache the value of get_user_msgid("Money").
- fm_set_user_health() : Adapt the stock to your need. The check is pointless here and you should use a float value directly, it will avoid to use float(). But the best would be to do a macro.
Code:
stock fm_set_user_health( index, Float:health ) {     set_pev( index, pev_health, health ); }
- fm_set_user_bpammo() : I think for your need it's totaly useless. Use directly : set_pdata_int( index, OFFSET_AWM_AMMO, 30 ); ( you can do a macro too to give a better name )
- fm_give_item() : Same here, adapt the code to your need to avoid unecessary work, somethink like should be enough for you :
Code:
stock fm_give_item( Client, const Item[] ) {     new Ent = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, Item ) );         if( pev_valid( Ent ) )     {         new Float:Origin[3];         pev( Client pev_origin, Origin );         set_pev( Ent , pev_origin, Origin );         set_pev( Ent, pev_spawnflags, pev( Ent, pev_spawnflags ) | SF_NORESPAWN );         dllfunc( DLLFunc_Spawn, Ent );         dllfunc( DLLFunc_Touch, Ent, Client );     } }

About strip and weapon given + ammo, if you want to optimize, there is the way of spawning one time ( so letting engine doing its job ) entities which strip and give weapons automaticaly at spawn ; but for that you would use a command instead of cvar so to remove/create theses entities when the use want to disable/enable the plugin. Also using command you could disable/enable forward and it would be more cool.

That's all for me. ^^

Last edited by Arkshine; 03-22-2009 at 14:36.
Arkshine is offline
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 03-23-2009 , 02:50   Re: One Shot, One Kill
Reply With Quote #12

nice plugin ;)

german translation

Quote:
[de]
PLUGIN_MESSAGE1 = Dieser Server lauft mit One Shot, One Kill Version %s
PLUGIN_MESSAGE2 = Schreibe /osinfo fuer Informationen ueber dieses Plugin.
HELP_MOTD :
<html>
<head>
<style type="text/css">
pre
{
font-family:Verdana,Tahoma;
color:#000000;
}

body
{
background:#91B74F;
margin-left:8px;
margin-top:0px;
}
</style>
</head>

<body scroll="no">
<pre>
<strong>One Shot, One Kill</strong> by fezh^n^n
<strong>.: Beschreibung :.</strong>^n
Wenn die Runde startet, verlieren alle Spieler ihre Waffen und^n
bekommen eine AWP mit 1 Leben.^n^n
<strong>.: Originale Idee :.</strong>^n
Die Idee kommt vom Spiel AssaultCube.^n
</pre>
</body>
</html>
:
KadiR is offline
fezh
Veteran Member
Join Date: Dec 2008
Location: BANNED
Old 03-23-2009 , 13:52   Re: One Shot, One Kill
Reply With Quote #13

ML file updated. Thanks for the help!
__________________
"There is no knowledge, that is not power"
fezh is offline
AlejandroSk
BANNED
Join Date: Nov 2008
Location: Aqui, en mi casa. Karma:
Old 03-23-2009 , 16:57   Re: One Shot, One Kill
Reply With Quote #14

it will be more funny if you add dm respawn =)
also one more bullet for those who kill someone
AlejandroSk is offline
Send a message via MSN to AlejandroSk
fezh
Veteran Member
Join Date: Dec 2008
Location: BANNED
Old 03-23-2009 , 17:25   Re: One Shot, One Kill
Reply With Quote #15

Quote:
Originally Posted by AlejandroSk View Post
it will be more funny if you add dm respawn =)
I tried to do it in another plugin (using fakemeta's dllfunc Spawn), but only works on the people who have been conected on the start of the map, the other remained dead.. Also, someone can help me with this?

Quote:
Originally Posted by AlejandroSk View Post
also one more bullet for those who kill someone
Nice idea, I will try add it.
__________________
"There is no knowledge, that is not power"
fezh is offline
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 03-23-2009 , 17:32   Re: One Shot, One Kill
Reply With Quote #16

Quote:
Originally Posted by fezh View Post
I tried to do it in another plugin (using fakemeta's dllfunc Spawn), but only works on the people who have been conected on the start of the map, the other remained dead..
Use HamSandwich for that:

PHP Code:
ExecuteHamBHam_CS_RoundRespawnid ); 
__________________
In Flames we trust!

Last edited by Nextra; 03-25-2009 at 09:10.
Nextra is offline
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 03-24-2009 , 13:58   Re: One Shot, One Kill
Reply With Quote #17

Dutch translation:

Quote:
[nl]
PLUGIN_MESSAGE1 = Deze server heeft de 'een shot' plguin, 'Een moord' versie %s
PLUGIN_MESSAGE2 = Schrijf '/osinfo' voor meer informatie over deze plugin.
HELP_MOTD :
<html>
<head>
<style type="text/css">
pre
{
font-family:Verdana,Tahoma;
color:#000000;
}
body
{
background:#91B74F;
margin-left:8px;
margin-top:0px;
}
</style>
</head>
<body scroll="no">
<pre>
<strong>Een shot, Een moord</strong> gemaakt door fezh^n^n
<strong>.: Uitleg :.</strong>^n
Wanneer de ronde start zullen de levende spelers al hun wapens verliezen, ^n
en alleen een AWP en 1 LEVEN krijgen.^n^n
<strong>.: Origineel Idee :.</strong>^n
Het idee kwam van een van de spelversies van AssaultCube.^n
</pre>
</body>
</html>
:
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
fezh
Veteran Member
Join Date: Dec 2008
Location: BANNED
Old 03-24-2009 , 15:38   Re: One Shot, One Kill
Reply With Quote #18

Updated. Thanks!
__________________
"There is no knowledge, that is not power"
fezh is offline
AlejandroSk
BANNED
Join Date: Nov 2008
Location: Aqui, en mi casa. Karma:
Old 03-25-2009 , 16:41   Re: One Shot, One Kill
Reply With Quote #19

Quote:
Originally Posted by fezh View Post
I tried to do it in another plugin (using fakemeta's dllfunc Spawn), but only works on the people who have been conected on the start of the map, the other remained dead.. Also, someone can help me with this?



Nice idea, I will try add it.
i have other idea ; if you kill 3 without dead u get one ability , like bunny hop , if you have 5 kills , other abilty , etc
AlejandroSk is offline
Send a message via MSN to AlejandroSk
kane33
Junior Member
Join Date: Mar 2009
Old 03-27-2009 , 13:28   Re: One Shot, One Kill
Reply With Quote #20

Romanian translation:
PHP Code:
[ro]
PLUGIN_MESSAGE1 Acest server foloseste One ShotOne Kill versiunea %s
PLUGIN_MESSAGE2 
Scrieti /osinfo pentru a va arata cum se foloseste acest plugin
HELP_MOTD 
:
<
html>
    <
head>
        <
style type="text/css">
            
pre
            
{
                
font-family:Verdana,Tahoma;
                
color:#000000;
            
}

            
body
            
{
                
background:#91B74F;
                
margin-left:8px;
                
margin-top:0px;
            }
        </
style>
    </
head>

    <
body scroll="no">
        <
pre>
            <
strong>One ShotOne Kill</strongby fezh^n^n
            
<strong>.: Descriere :.</strong>^n
            Cand runda incepe
toti playerii care sunt in viata pierd arma si^
            ia un AWP si doar 1 HP
.^n^n
            
<strong>.: Ideea originala :.</strong>^n
            Ideea vine de la jocul AssaultCube
.^n
        
</pre>
    </
body>
</
html>

kane33 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 07:03.


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