Raised This Month: $ Target: $400
 0% 

Timer text repeat - help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zuben
Junior Member
Join Date: May 2009
Old 08-05-2009 , 20:05   Timer text repeat - help
Reply With Quote #1

Good morning , I am noob , , please I need help , I noww learn SourcePawn and I more try it , but i dont know how it. I can do plugin where display and repeat text from translations/myfirstplugin.txt , Thank you
Zuben is offline
atom0s
Senior Member
Join Date: Jul 2009
Old 08-05-2009 , 20:37   Re: Timer text repeat - help
Reply With Quote #2

You can use a timer to repeat something such as displaying text.

The timer syntax can be found here:
http://docs.sourcemod.net/api/index....d=show&id=156&


You can display a string from a translation file using the %t argument inside of a format call such as:

PHP Code:
PrintChatToAll"%t""Your Message Name" ); 
Then for example we have a translation file with:

PHP Code:
"Phrases"
{
    
"Your Message Name"
    
{
        
"en"    "This is an example message!"
    
}

So users would see on the server:
This is an example message!
atom0s is offline
Zuben
Junior Member
Join Date: May 2009
Old 08-05-2009 , 21:11   Re: Timer text repeat - help
Reply With Quote #3

very much thanks , but i have error
Code:
reklama2.sp(13) : error 017: undefined symbol "PrintChatToAll"


reklama2.sp :

Code:
#include <sourcemod>
public Plugin:myinfo =
{
    name = "REklama",
    author = "Zuben",
    description = "Reklama pro vaše sponzori , darce ,atd..",
    version = "1.0.0.0",
    url = "http://www.sourcemod.net/"
};
 public OnPluginStart()
{
LoadTranslations("reklama2");
PrintChatToAll( "30.0", "Your Message Name" );  
}
EDIT : And no error , i edited on this :
Code:
#include <sourcemod>
public Plugin:myinfo =
{
    name = "REklama",
    author = "Zuben",
    description = "Reklama pro vaše sponzori , darce ,atd..",
    version = "1.0.0.0",
    url = "http://www.sourcemod.net/"
};
 public OnPluginStart()
{

LoadTranslations("reklama2");
CreateTimer(5.0, LoadStuff)

}

public Action:LoadStuff(Handle:timer)
{
PrintToChatAll( "%t", "Your Message Name" );  
}
but I dont see in server this text

Last edited by Zuben; 08-05-2009 at 21:39.
Zuben is offline
atom0s
Senior Member
Join Date: Jul 2009
Old 08-06-2009 , 01:08   Re: Timer text repeat - help
Reply With Quote #4

Heres a working example:

spam.sp:
PHP Code:
#include <sourcemod>
#include <sdktools>

public Plugin:myInfo = {
    
name             "Spam Example",
    
author         "atom0s",
    
description     "Example of using timers to spam a message.",
    
version         "1.0.0",
    
url             "N/A"
};

/* Timer Define */
#define DEFAULT_TIMER_FLAGS     TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE

/* Timer Handle */
new Handle:t_TimerHandle INVALID_HANDLE;


/* Plugin Start */
public OnPluginStart( )
{
    
/* Load Translation File */
    
LoadTranslations"spam.phrases" );
    
    
/* Create Timer */
    
t_TimerHandle CreateTimer5.0Timer_SpamMessage_DEFAULT_TIMER_FLAGS );
}

/* Spam Timer */
public Action:Timer_SpamMessageHandle:Timer )
{
    
PrintToChatAll"%t""Spam Message" );
    return 
Plugin_Continue;

spam.phrases.txt:
Code:
"Phrases"
{
    "Spam Message"
    {
    "en"    "This is an example message!"
    }
}
atom0s is offline
Zuben
Junior Member
Join Date: May 2009
Old 08-06-2009 , 10:10   Re: Timer text repeat - help
Reply With Quote #5

Very very mutch thank you
Zuben 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:35.


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