AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Noob's thing's (https://forums.alliedmods.net/showthread.php?t=117108)

ZaMirDj 01-29-2010 05:58

Noob's thing's
 
Well, my first creation have many problem's.

Code:

#include <amxmodx>
#include <fakemeta>


public plugin_init() {
    register_plugin("Slapper","0.1","Zamirdj");
    register_forward(FM_PlayerPreThink,"fw_prethink");
}

public fw_prethink(id)
{
    if( get_user_team(id) == 2)
    {
set_hudmessage(255, 0, 0, -1.0, 0.01)
show_hudmessage(id, "<Hudmessage>")
user_slap(id, 0, 1)
  }
}

Works but i want to know how i can stop the loop of the slap because the slap is continous.

And i want to know anothers variables to the command "if", to make something how the "Connected People Welcome Message", etc.

See ya~

PD: Sorry for my bad english x.x

Bugsy 01-29-2010 08:39

Re: Noob's thing's
 
Your mistake is using prethink to slap without any conditionals (besides team) so the plugin will do nothing but slap the player at a super fast rate. Explain what you're trying to do and we can help to show you the best way.

For a welcome msg..

PHP Code:

public client_putinserverid )
{
    
set_task7.0 "SayHi" id );
}

public 
SayHiid )
{
    new 
szName33 ];
    
get_user_nameid szName charsmaxszName ) );
    
client_printid print_chat "Welcome to the server %s!" szName );



ZaMirDj 01-29-2010 13:50

Re: Noob's thing's
 
I want to slap Ct player 3 times when he respawn and display a message for 3 seconds (this is my idea)

Mxnn 01-29-2010 14:00

Re: Noob's thing's
 
PHP Code:

set_hudmessage(25500, -1.00.0106.03.0)
show_hudmessage(id"MESSAGE"

The hudmessage will disappear at 3 seconds after the message was shown

ZaMirDj 01-29-2010 14:51

Re: Noob's thing's
 
Quote:

Originally Posted by Bugsy (Post 1071567)
Your mistake is using prethink to slap without any conditionals (besides team) so the plugin will do nothing but slap the player at a super fast rate. Explain what you're trying to do and we can help to show you the best way.

For a welcome msg..

What command could i use if i remove the fw_prethink to stop the Loop?

Bugsy 01-30-2010 14:53

Re: Noob's thing's
 
PHP Code:

#include <amxmodx>
#include <hamsandwich>

public plugin_init() 
{
    
register_plugin"Slap Hi" "0.1" "bugsy" );
    
    
RegisterHamHam_Spawn "player" "fw_HamSpawn_Post" );
}

public 
fw_HamSpawn_Postid )
{
    if ( 
is_user_aliveid ) )
    {
        
set_task0.25 "SlapPlayer" id __"a" );
        
set_hudmessage255 255 255 , -1.0 , -1.0 6.0 3.0 );
        
show_hudmessageid "Hello, here be 3 slap" );
    }
}

public 
SlapPlayerid )
{
    
user_slapid 1);



floatman 01-30-2010 15:54

Re: Noob's thing's
 
PHP Code:

        show_hudmessageid "Hello, here's 3 slaps" ); 

->
PHP Code:

        show_hudmessageid "Hello, here are 3 slaps" ); 

?

Bugsy 01-30-2010 16:08

Re: Noob's thing's
 
Quote:

Originally Posted by floatman (Post 1073338)
PHP Code:

        show_hudmessageid "Hello, here's 3 slaps" ); 

->
PHP Code:

        show_hudmessageid "Hello, here are 3 slaps" ); 

?

I don't get it

floatman 01-30-2010 16:27

Re: Noob's thing's
 
rofl
Quote:

Originally Posted by Bugsy
here's 3 slaps

->
Quote:

here are 3 slaps

Bugsy 01-30-2010 20:55

Re: Noob's thing's
 
Nice waste of bandwidth, chief. I edited my above code just for you.


All times are GMT -4. The time now is 07:24.

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