AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [ Solved ] Last in team (Ct & T) (https://forums.alliedmods.net/showthread.php?t=188524)

Aooka 06-27-2012 10:34

[ Solved ] Last in team (Ct & T)
 
I do that :
Code:
#include < amxmodx > public plugin_init( ) {     register_plugin( "Last In Team" , "1.0" , "Aooka" );         register_event( "DeathMsg" , "Ev_DeathMsg" , "a" ); } public Ev_DeathMsg( ) {     new iPlrCt[ 32 ] , iPlrTe[ 32 ];     new iNumCt , iNumTe;         get_players( iPlrCt , iNumCt , "aeh" , "CT" );         if( iNumCt == 1 )     {         client_print( 0 , print_center , "Il ne reste plus qu'un Ct" );     }         get_players( iPlrTe , iNumTe , "aeh" , "TERRORIST" );         if( iNumTe == 1 )     {         client_print( 0 , print_center , "Il ne reste plus qu'un Terro" );     } }

My question is very simple : Is theire an other way to do that ? :3

hornet 06-27-2012 11:35

Re: [REQ] Last in team (Ct & T)
 
Yes, you only need one player list array and one player count variable. Just reuse them.

Neeeeeeeeeel.- 06-27-2012 12:35

Re: [REQ] Last in team (Ct & T)
 
Or using Ham_Killed.

Aooka 06-27-2012 12:41

Re: [REQ] Last in team (Ct & T)
 
Yes but if I do that i've to include hamsandwich but yes it's work fine :D Thanks !

Neeeeeeeeeel.- 06-27-2012 13:11

Re: [REQ] Last in team (Ct & T)
 
Quote:

Originally Posted by Aooka (Post 1737333)
Yes but if I do that i've to include hamsandwich but yes it's work fine :D Thanks !

And what's the problem to use other module?

Aooka 06-27-2012 14:12

Re: [REQ] Last in team (Ct & T)
 
It's not a really a problem.
it's just an overload for your code.

It's inserts in your code all that the include contains so it's not the better way. :)

<VeCo> 06-27-2012 14:18

Re: [REQ] Last in team (Ct & T)
 
No it's not an overload and it includes only that you have used in the code. Also there are some occasions when player dies without sending a death message.

Aooka 06-27-2012 14:21

Re: [REQ] Last in team (Ct & T)
 
So if i've a plugin with 20 include it's the same as if i've only 4 ? I did not know , so thanks ! :d

Yes i test it and they are this problem :/ I check it this evening.

<VeCo> 06-27-2012 14:25

Re: [REQ] Last in team (Ct & T)
 
And btw:
PHP Code:

public Ev_DeathMsg( const id 


It doesn't have an index, because the event is global (it isn't sent only to one specific player).

Aooka 06-27-2012 14:26

Re: [REQ] Last in team (Ct & T)
 
Oh yes i edit that i just ... forget it . Thx


All times are GMT -4. The time now is 06:10.

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