Raised This Month: $ Target: $400
 0% 

Noob's thing's


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ZaMirDj
Junior Member
Join Date: May 2007
Old 01-29-2010 , 05:58   Noob's thing's
Reply With Quote #1

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
ZaMirDj is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-29-2010 , 08:39   Re: Noob's thing's
Reply With Quote #2

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 );

__________________
Bugsy is offline
ZaMirDj
Junior Member
Join Date: May 2007
Old 01-29-2010 , 13:50   Re: Noob's thing's
Reply With Quote #3

I want to slap Ct player 3 times when he respawn and display a message for 3 seconds (this is my idea)
ZaMirDj is offline
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 01-29-2010 , 14:00   Re: Noob's thing's
Reply With Quote #4

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
Mxnn is offline
ZaMirDj
Junior Member
Join Date: May 2007
Old 01-29-2010 , 14:51   Re: Noob's thing's
Reply With Quote #5

Quote:
Originally Posted by Bugsy View Post
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?
ZaMirDj is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-30-2010 , 14:53   Re: Noob's thing's
Reply With Quote #6

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);

__________________

Last edited by Bugsy; 01-30-2010 at 20:57.
Bugsy is offline
floatman
Senior Member
Join Date: Oct 2009
Location: nowhere.
Old 01-30-2010 , 15:54   Re: Noob's thing's
Reply With Quote #7

PHP Code:
        show_hudmessageid "Hello, here's 3 slaps" ); 
->
PHP Code:
        show_hudmessageid "Hello, here are 3 slaps" ); 
?
__________________

floatman is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-30-2010 , 16:08   Re: Noob's thing's
Reply With Quote #8

Quote:
Originally Posted by floatman View Post
PHP Code:
        show_hudmessageid "Hello, here's 3 slaps" ); 
->
PHP Code:
        show_hudmessageid "Hello, here are 3 slaps" ); 
?
I don't get it
__________________
Bugsy is offline
floatman
Senior Member
Join Date: Oct 2009
Location: nowhere.
Old 01-30-2010 , 16:27   Re: Noob's thing's
Reply With Quote #9

rofl
Quote:
Originally Posted by Bugsy
here's 3 slaps
->
Quote:
here are 3 slaps
__________________

floatman is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-30-2010 , 20:55   Re: Noob's thing's
Reply With Quote #10

Nice waste of bandwidth, chief. I edited my above code just for you.
__________________

Last edited by Bugsy; 01-30-2010 at 21:00.
Bugsy 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 07:24.


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