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

[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 - 2014 views - 2.4 KB)
File Type: inc czerotutor.inc (974 Bytes, 933 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
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 05-28-2012 , 15:46   Re: [CZ][INC&NATIVE] Czero Tutor
Reply With Quote #8

Spoiler

Hey connor, You're version for the czero tutor doesnt work i dont know why, maybe you can tell me.
this is what i have:
PHP Code:
#include <amxmodx>
//#include <czerotutor>
#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")
 
    
set_task(360.0"tutor_spam"0__"b")
}
public 
plugin_natives()
{
    
register_native("client_tutor""client_tutor")
}
public 
plugin_precache()
{
    new 
szModName[9]
    
get_modname(szModNamecharsmax(szModName))
    if( !
equal(szModName"czero") )
    {
        
set_fail_state("Tutor 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()
            }
        }
    }

public 
tutor_spam()
{
 new 
Random
 
Random random_num);
 switch( 
Random 
 {     
  case 
1:
  {
   
client_tutor(0TutorYellowTaskComplete12.3"test"); //line 178
  
}
  case 
2:
  {
   
client_tutor(0TutorYellowTaskComplete12.3"test"); //line 182
  
}
 }

and these are my errors:
Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team
Warning: Tag mismatch on line 178
Error: Number of arguments does not match definition on line 178
Warning: Tag mismatch on line 182
Error: Number of arguments does not match definition on line 182
2 Errors.
It doesnt work without the #include<czerotutor> and defenitly not with it
Why is it saying that the number of parameters is wrong?
__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]
striker07 is offline
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 05-13-2014 , 14:35   Re: [CZ][INC&NATIVE] Czero Tutor
Reply With Quote #9

Is there a way to do tutor support UTF8 related letters and symbols (é à è for exemple) ?

I guess not, it should be hardcoded, but i prefer asking, maybe...
Fr33m@n 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 #10

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
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 11:43.


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