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

no idea where to start


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
owned
Member
Join Date: Jul 2007
Old 07-29-2007 , 18:43   no idea where to start
Reply With Quote #1

I'm trying to make something that will slap a player a certain times.

Say I did: amx_sexyslap me 10

I want it to do:

amx_slap me 1
amx_slap me 2
amx_slap me 3
amx_slap me 4
amx_slap me 5
amx_slap me 6
amx_slap me 7
amx_slap me 8
amx_slap me 9
amx_slap me 10

I'm guessing this would use a for statement?

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN "Sexy Slap"
#define VERSION "1.0"
#define AUTHOR "MARREC"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("amx_sexyslap","sexyslap",ADMIN_SLAY)
}

public 
sexyslap(id){
    
//right here

__________________
MARREC/OWNED = me.
owned is offline
Old 07-29-2007, 19:27
X-Script
This message has been deleted by X-Script.
X-Script
BANNED
Join Date: Jul 2007
Location: (#504434)
Old 07-29-2007 , 19:35   Re: no idea where to start
Reply With Quote #2

NOT TESTED

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Sexy Slap"
#define VERSION "1.0"
#define AUTHOR "X-Script"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_concmd("amx_sexyslap""cmd_slap"ADMIN_KICK"Slaps the user a certain number of times")
}

public 
cmd_slap(idlevelcid)
{
    
    if (!
cmd_access(idlevelcid3))
    {
        return 
PLUGIN_HANDLED;
    }
    new 
Arg1[24], Arg2[4];
    
read_argv(1Arg123);
    
read_argv(2Arg23);
    new 
SlapsNum str_to_num(Arg2);
    {
        return 
PLUGIN_HANDLED;
    }
    
    new 
player cmd_target(idArg11);
    if (!
player)
    {
        
console_print(id"[ERROR] Inserted name is not valid!");
        return 
PLUGIN_HANDLED;
    }

    else
    {
        new 
i;
        for (
i=0i<SlapsNumi++)
        {
            
user_slap(player11);
        }
        
            
    }
    return 
PLUGIN_HANDLED;
        

X-Script is offline
owned
Member
Join Date: Jul 2007
Old 07-29-2007 , 19:48   Re: no idea where to start
Reply With Quote #3

Doesn't work, it doesn't slap.
__________________
MARREC/OWNED = me.
owned is offline
X-Script
BANNED
Join Date: Jul 2007
Location: (#504434)
Old 07-29-2007 , 19:49   Re: no idea where to start
Reply With Quote #4

I know why, woops I forgot to add a important part of the code.

hold on, editing.
X-Script is offline
X-Script
BANNED
Join Date: Jul 2007
Location: (#504434)
Old 07-29-2007 , 19:52   Re: no idea where to start
Reply With Quote #5

Are you sure you're typing in the correct command? amx_sexyslap?
X-Script is offline
owned
Member
Join Date: Jul 2007
Old 07-29-2007 , 19:56   Re: no idea where to start
Reply With Quote #6

Yep.

My ingame name was: A[MS]owned #emo /wrists

So I did:

amx_sexyslap owned 10

Nothing.

Then I changed my name to owned

amx_sexyslap owned 10

Nothing.
__________________
MARREC/OWNED = me.
owned is offline
Deviance
Veteran Member
Join Date: Nov 2004
Location: Sweden
Old 07-29-2007 , 23:22   Re: no idea where to start
Reply With Quote #7

Code:
#include <amxmodx>
#include <amxmisc>

#define Plugin "SexySlap"
#define Version "1.0"
#define Author "Doombringer"

public plugin_init() 
{
	register_plugin(Plugin, Version, Author)    
	register_clcmd("amx_sexyslap", "cmd_slap", ADMIN_SLAY, "- <name> <times> Slap's a player X times")
}

public cmd_slap(id, level, cid)
{
	if(!cmd_access(id, level, cid, 3))
	return PLUGIN_HANDLED
	
	new arg1[32]
	new arg2[5]
	
	read_argv(1, arg1, 31)
	read_argv(2, arg2, 4)
	
	new player = cmd_target(id, arg1, 2)
	
	if(!player)
	return PLUGIN_HANDLED
	
	new times = str_to_num(arg2)
	set_task(0.1, "sexyslap", player, _, _, "a", times)
	
	static name[32]
	get_user_name(player, name, 31)
	
	client_print(id, print_chat, "[AMXX] You slapped %s %d time%s", name, times, times == 1 ? "":"s")
	return PLUGIN_HANDLED
}
	
public sexyslap(id)
{
	user_slap(id, 1, 1)
}

Last edited by Deviance; 07-29-2007 at 23:25.
Deviance is offline
X-Script
BANNED
Join Date: Jul 2007
Location: (#504434)
Old 07-30-2007 , 00:19   Re: no idea where to start
Reply With Quote #8

I knew I was missing something, I wrote it just before I left so I thought i'd get something wrong.
X-Script is offline
owned
Member
Join Date: Jul 2007
Old 07-30-2007 , 01:44   Re: no idea where to start
Reply With Quote #9

What I mean was like, slap them x times but increase the damage for each slap.

So 5 slaps: 1st > 1dmg, 2nd: 2dmg, 3rd: 3dmg, 4th: 4dmg, 5th: 5dmg
__________________
MARREC/OWNED = me.
owned is offline
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 07-30-2007 , 02:50   Re: no idea where to start
Reply With Quote #10

Provided it worked before..

Code:
#include <amxmodx> #include <amxmisc> #define Plugin "SexySlap" #define Version "1.0" #define Author "Doombringer"
new g_Damage;
public plugin_init() {     register_plugin(Plugin, Version, Author)        register_clcmd("amx_sexyslap", "cmd_slap", ADMIN_SLAY, "- <name> <times> Slap's a player X times") } public cmd_slap(id, level, cid) {     if(!cmd_access(id, level, cid, 3))         return PLUGIN_HANDLED         new arg1[32]     new arg2[5]         read_argv(1, arg1, 31)     read_argv(2, arg2, 4)         new player = cmd_target(id, arg1, 2)         if(!player)         return PLUGIN_HANDLED    
    g_Damage = 0
    new times = str_to_num(arg2)     set_task(0.1, "sexyslap", player, _, _, "a", times)         static name[32]     get_user_name(player, name, 31)         client_print(id, print_chat, "[AMXX] You slapped %s %d time%s", name, times, times == 1 ? "":"s")     return PLUGIN_HANDLED }     public sexyslap(id) {
    user_slap(id, ++g_Damage)
}

Last edited by Lee; 07-30-2007 at 02:55.
Lee 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 06:42.


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