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

[CZ][INC&NATIVE] Czero Tutor


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dark Style
BANNED
Join Date: Feb 2011
Location: Brazil
Old 11-14-2011 , 06:40   [CZ][INC&NATIVE] Czero Tutor
Reply With Quote #1

[Description]
This include able you to make advices with czero tutor!
Works ONLY in CS: Condition-Zero

OBS: I know that have another czero tutor inc, but that have so many erros.

- Put the file czerotutor.amxx in: amxmodx/plugins/
- Open the file amxmodx/configs/plugins.ini and write czerotutor.amxx


[Functions]
Code:
enum
{
	NONE = 0,
	RED,
	BLUE,
	YELLOW,
	GREEN
}

/**
 * Create a tutor
 *
 * @param id		Player index.
 * @param color		Color of the text.
 * @param sound		Sound to play when display tutor.
 * @param time		Time to the tutor still alive.
 * @param input		Text to display in tutor.
 * @return			1 on success, 0 otherwise.
 */
native create_user_cztutor(id, color = GREEN, sound[] = "", Float:time = 0.0, const input[] = "");


/**
 * Remove player tutor.
 *
 * @param id		Player index.
 * @return			1 on success, 0 otherwise.
 */
native remove_user_cztutor(id);


/**
 * Check if a tutor is displaying to this player.
 *
 * @param id		Player index.
 * @return			Color of player tutor (If not exists will return NONE).
 */
native is_user_cztutor(id);
[Example]
Code:
#include <amxmodx>
#include <czerotutor>

// Native only support .wav sounds
new szSound[] = { "sound/misc/tutor.wav" }

public plugin_precache()
{
	// Renember you have to precache the sound
	precache_sound(szSound)
}

public plugin_init() 
{
	register_plugin("New Plugin", "1.0", "Dark Style")
	
	register_event("HLTV", "roundstart", "a", "1=0", "2=0")
}

public client_authorized(id)
{
	// Index, Text, Color, Sound, Time.
	create_user_cztutor(id, RED, szSound, 5.0, "Welcome!")
}

public roundstart()
{
	// You don't need to get_players when don't have id, the native do it for you.
	if(is_user_cztutor(0) != NONE)
		remove_user_cztutor(0), create_user_cztutor(0, RED, szSound, 5.0, "Dungerous Server^nIP: XXX.XXX.XXX:XXXXX!")
	else
		create_user_cztutor(0, RED, szSound, 5.0, "Dungerous Server^nIP: XXX.XXX.XXX:XXXXX!")
}
Attached Files
File Type: sma Get Plugin or Get Source (czerotutor.sma - 2000 views - 2.4 KB)
File Type: inc czerotutor.inc (974 Bytes, 921 views)

Last edited by Dark Style; 11-14-2011 at 08:22.
Dark Style is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 11-14-2011 , 07:49   Re: [CZ][INC&NATIVE] Czero Tutor
Reply With Quote #2

http://forums.alliedmods.net/showthread.php?t=148170 ?
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Dark Style
BANNED
Join Date: Feb 2011
Location: Brazil
Old 11-14-2011 , 08:17   Re: [CZ][INC&NATIVE] Czero Tutor
Reply With Quote #3

OBS: I know that have another czero tutor inc, but that have so many erros.
Dark Style is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 11-14-2011 , 16:51   Re: [CZ][INC&NATIVE] Czero Tutor
Reply With Quote #4

Quote:
Originally Posted by Dark Style View Post
OBS: I know that have another czero tutor inc, but that have so many erros.
I don't see any complaints in the thread.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-14-2011 , 18:04   Re: [CZ][INC&NATIVE] Czero Tutor
Reply With Quote #5

I also have one version to post
More flexible and support ML and formatting.

Code:
#if defined _cz_tutor_included
  #endinput
#endif
#define _cz_tutor_included

#pragma reqlib cztutor

enum TutorSounds {
	DefaultTutor,
	FriendDied,
	EnemyDied,
	TaskComplete,
	TutorNoSound
}

enum TutorColors
{
	TutorGreen = 1,
	TutorRed = 2,
	TutorBlue = 4,
	TutorYellow = 8
}

native client_tutor(id, TutorColors:iColor=TutorGreen, TutorSounds:iSound=DefaultTutor, Float:flCloseDelay=8.0, const fmt[], any:...);
PHP Code:
/*    Formatright © 2010, ConnorMcLeod

    This plugin is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this plugin; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include <amxmodx>

#define VERSION "0.0.1"
#define PLUGIN "TutorText"

#define TASK_OFFSET 1354897

enum TutorSounds {
    
DefaultTutor,
    
FriendDied,
    
EnemyDied,
    
TaskComplete,
    
TutorNoSound
}

new const 
g_szTutorSounds[TutorSounds][] = 
{
    
"sound/events/tutor_msg.wav"// Yellow, Green
    
"sound/events/friend_died.wav"// Red
    
"sound/events/enemy_died.wav"// Blue
    
"sound/events/task_complete.wav" // Green
}

enum TutorColors ( <<= )
{
    
TutorGreen 1,
    
TutorRed,
    
TutorBlue,
    
TutorYellow
}

new 
g_iTutorTextg_iTutorClose

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")
    
g_iTutorText get_user_msgid("TutorText")
    
g_iTutorClose get_user_msgid("TutorClose")
}

public 
plugin_natives()
{
    
register_library("cztutor")
    
register_native("client_tutor""client_tutor")
}

public 
plugin_precache()
{
    new 
szModName[9]
    
get_modname(szModNamecharsmax(szModName))
    if( !
equal(szModName"czero") )
    {
        
set_fail_state("Only works on condition zero")
    }
}

// client_tutor(id, TutorColors:iColor, TutorSounds:iSound, Float:flCloseDelay=8.0, fmt[], any:...)
public client_tutor(iPluginiParams)
{
    new 
id get_param(1)
    new 
TutorColors:iColor TutorColors:get_param(2)
    new 
TutorSounds:iSound TutorSounds:get_param(3)
    new 
Float:flDelay get_param_f(4)
    new 
szText[256]
    if( 
iParams == )
    {
        
get_string(5szTextcharsmax(szText))
        
Send_TutorText(idiColoriSoundflDelayszText)
    }
    else if( 
id || iParams == )
    {
        
vdformat(szTextcharsmax(szText), 56)
        
Send_TutorText(idiColoriSoundflDelayszText)
    }
    else 
// iParams > 6
    
{
        new 
iPlayers[32], iNum
        get_players
(iPlayersiNum"ch")
        if( !
iNum )
        {
            return 
0
        
}
        new 
ij, Array:aStoreML ArrayCreate(), iMlCount
        
for(i=6i<iParamsi++)
        {
            if( 
get_param_byref(i) == LANG_PLAYER )
            {
                
get_string(i+1szTextcharsmax(szText))
                if( 
GetLangTransKey(szText) != TransKey_Bad )
                {
                    
ArrayPushCell(aStoreMLi++)
                    
iMlCount++
                }
            }
        }
        if( !
iMlCount )
        {
            
vdformat(szTextcharsmax(szText), 56)
            
Send_TutorText(idiColoriSoundflDelayszText)
        }
        else
        {
            for(
i=0i<iNumi++)
            {
                
id iPlayers[i]
                for(
j=0j<iMlCountj++)
                {
                    
set_param_byref(ArrayGetCell(aStoreMLj), id)
                }
                
vdformat(szTextcharsmax(szText), 56)
                
Send_TutorText(idiColoriSoundflDelayszText)
            }
        }
        
ArrayDestroy(aStoreML)
    }
    return 
1
}

Send_TutorText(idTutorColors:iTypeTutorSounds:iSoundFloat:flDelay, const szText[])
{
    if( 
iSound != TutorNoSound )
    {
        
client_cmd(id"spk %s"g_szTutorSounds[iSound])
    }

    
message_begin(id MSG_ONE_UNRELIABLE MSG_BROADCASTg_iTutorText, .player=id)
    
write_string(szText)
    
write_byte(0)
    
write_short(-1// TutorMessageEventI
    
write_shortid && !is_user_alive(id) ) 
    
write_short_:iType )
    
message_end()

    
id += TASK_OFFSET
    remove_task
(id)
    if( 
flDelay 0.0 )
    {
        
set_task(flDelay"TutorClose"id)
    }
}

public 
TutorClose(id)
{
    
id -= TASK_OFFSET
    
if( id )
    {
        
message_begin(MSG_ONE_UNRELIABLEg_iTutorClose, .player=id)
        
message_end()
    }
    else
    {
        new 
iPlayers[32], iNum
        get_players
(iPlayersiNum"ch")
        for(new 
ii<iNumi++)
        {
            
id iPlayers[i]
            if( !
task_exists(id+TASK_OFFSET) )
            {
                
message_begin(MSG_ONE_UNRELIABLEg_iTutorClose, .player=id)
                
message_end()
            }
        }
    }

__________________
- tired and retired -

- my plugins -

Last edited by Emp`; 11-15-2011 at 00:38.
ConnorMcLeod is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 11-14-2011 , 18:19   Re: [CZ][INC&NATIVE] Czero Tutor
Reply With Quote #6

Quote:
Originally Posted by ConnorMcLeod View Post
I also have one version to post
More flexible and support ML and formatting.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.

Last edited by drekes; 11-14-2011 at 18:19.
drekes is offline
Send a message via MSN to drekes
Dark Style
BANNED
Join Date: Feb 2011
Location: Brazil
Old 11-15-2011 , 04:50   Re: [CZ][INC&NATIVE] Czero Tutor
Reply With Quote #7

Quote:
Originally Posted by ConnorMcLeod View Post
I also have one version to post
More flexible and support ML and formatting.
Better.
Dark Style is offline
TheArmagedon
Senior Member
Join Date: Sep 2010
Location: Unknown Source
Old 11-16-2011 , 10:31   Re: [CZ][INC&NATIVE] Czero Tutor
Reply With Quote #8

You're just a fucking ripper of MMYTH's plugin.
C'mon, look at your plugins man! all of them... the original author is the "MMYTH".
You just edit one or two things and you say "I made this plugin, i'm fucking awesome!" GTFO!
TheArmagedon is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 11-16-2011 , 11:05   Re: [CZ][INC&NATIVE] Czero Tutor
Reply With Quote #9

Quote:
Originally Posted by TheArmagedon View Post
You're just a fucking ripper of MMYTH's plugin.
C'mon, look at your plugins man! all of them... the original author is the "MMYTH".
Fun fact: Dark Style registered the day .MMYTH. got banned.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
Dark Style
BANNED
Join Date: Feb 2011
Location: Brazil
Old 11-16-2011 , 15:52   Re: [CZ][INC&NATIVE] Czero Tutor
Reply With Quote #10

Quote:
Originally Posted by TheArmagedon View Post
You're just a fucking ripper of MMYTH's plugin.
C'mon, look at your plugins man! all of them... the original author is the "MMYTH".
You just edit one or two things and you say "I made this plugin, i'm fucking awesome!" GTFO!
I think the problem is mine, and I create my plugins yes.
Dark Style is offline
Reply


Thread Tools
Display Modes

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 19:27.


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