AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Ad. (https://forums.alliedmods.net/showthread.php?t=51868)

terrum 02-25-2007 12:23

Ad.
 
Can someone help me with my plugin im making called "Crashing Carz". I just need a quick code what advertises a command saying "Use /car_crash to get into your cool car" every 5/10 minutes. Thanks.

+karma and your name on my credits will be done. Thanks!

SAMURAI16 02-25-2007 13:38

Re: Ad.
 
->
Code:

#include <amxmodx>


public plugin_init() {
    register_plugin("","","");
   
    set_task(1.0,"advert");
}

public advert()
{
    new value = random_num(300,360)
   
    client_print(0,print_chat,"Use /car_crash to get into your cool car")
   
    set_task(float(value),"advert")
}


FormulaZero 02-25-2007 13:39

Re: Ad.
 
Here, this might help to, this will display it once they enter the server:

PHP Code:

public client_putinserver(id)
{
    
    
set_task(3.0"welcome"id)
}

public 
welcome(id)
{
    new 
name[32]
    
get_user_name(idname31)
    
set_hudmessage(225000.050.4506.06.00.50.5, -1)
    
show_hudmessage(0"Use /car_crash to enter your vehicle."name)



SAMURAI16 02-25-2007 13:42

Re: Ad.
 
FormulaZero, wtf ?
maybe:
Code:

#include <amxmodx>

public client_putinserver(id)
{
   
    set_task(3.0, "welcome", id)
}

public welcome(id)
{
    set_hudmessage(225, 0, 0, 0.05, 0.45, 0, 6.0, 6.0, 0.5, 0.5, -1)
    show_hudmessage(0, "Use /car_crash to enter your vehicle.")
}

id = 0
You don't any name to check there
He want to repeat message

FormulaZero 02-25-2007 13:44

Re: Ad.
 
I know he wants to repeat it, this will display it once they enter the server.
Name would need to be in there?

SAMURAI16 02-25-2007 13:46

Re: Ad.
 
get_user_name is for get the index name
An example:
Code:

new name[32]
get_user_name(id,name,31)
set_hudmessage(225, 0, 0, 0.05, 0.45, 0, 6.0, 6.0, 0.5, 0.5, -1)
show_hudmessage(0, "%s is an idiot",name)


terrum 02-25-2007 13:49

Re: Ad.
 
thanks for the help guys. but can both of you agree and make sure it works. Credit/+karma for both of you when tested and worked (if that's ok)

terrum 02-25-2007 13:52

Re: Ad.
 
Quote:

Originally Posted by SAMURAI16 (Post 445408)
->
Code:

#include <amxmodx>


public plugin_init() {
    register_plugin("","","");
   
    set_task(1.0,"advert");
}

public advert()
{
    new value = random_num(300,360)
   
    client_print(0,print_chat,"Use /car_crash to get into your cool car")
   
    set_task(float(value),"advert")
}


actually i might just have this one, does it just show a message every 300-360 seconds saying /car_crash etc (not hud) ?

SAMURAI16 02-25-2007 13:52

Re: Ad.
 
yes, it's says in chat . You want HudMessage ?

terrum 02-25-2007 13:55

Re: Ad.
 
nope. that's exactly what i want. thank you very much (added to credits: SAMURAI16 - For the advertising script)

+karma for both of you :)


All times are GMT -4. The time now is 00:43.

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