Raised This Month: $ Target: $400
 0% 

Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
omgitsme
Veteran Member
Join Date: Mar 2010
Old 07-30-2010 , 09:31   Help
Reply With Quote #1

hey, i have some questions.
i read some tutorials, but i don't understand what this does?
public plugin_init[b]()]/b] the () in bold. what does it do? and how important is it?
and i saw in some plugins, they have ==
why two?
and then what does this mean? { and how important is it? thanks
__________________

Last edited by omgitsme; 07-30-2010 at 09:48.
omgitsme is offline
Send a message via Skype™ to omgitsme
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 07-30-2010 , 10:21   Re: questions
Reply With Quote #2

I never saw the bold ()

The == are to compare stuff.
PHP Code:
if(== b// compare them
{
    
b// assign them.

And {} is used to open and close a block of code, really important
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
omgitsme
Veteran Member
Join Date: Mar 2010
Old 07-30-2010 , 11:39   Re: questions
Reply With Quote #3

ok, thanks. and is there like a page where i can see how to give ammo? this dosen't work (for a deagle)
Code:
cs_set_user_bpammo( id, CSW_DEAGLE, 200);
edit: and how do you use client_print? i don't understand. i just made a silly /deagle plugin. and i want it to print "you got a deagle and 150hp"
Code:
#include <amxmodx>
#include <fun>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
 
 
public plugin_init()
{
    register_clcmd("say /deagle", "weapon");
}
 
public weapon(id)
{
        if(is_user_alive(id))
    strip_user_weapons(id)
            give_item( id, "weapon_deagle" );
    set_user_health (id, 150)
    give_item( id, "weapon_knife" );
    client_print ("
and why when i compile it i get 2 errors? and whats the correct command for giving ammo? and what command is it when they respawn you give something?
__________________

Last edited by omgitsme; 07-30-2010 at 12:56.
omgitsme is offline
Send a message via Skype™ to omgitsme
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 07-30-2010 , 13:22   Re: Help
Reply With Quote #4

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

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
 
 
public plugin_init()
{
    
register_clcmd("say /deagle""weapon");
}
 
public 
weapon(id)
{
    if(
is_user_alive(id))
    {
        
strip_user_weapons(id)
        
give_itemid"weapon_knife" );
        
give_itemid"weapon_deagle" );
        
set_user_bpammo(idCSW_DEAGLE200);
        
set_user_health (id150);
        
        
client_print(idprint_chat"You got a deagle and 150 hp");
    }

You should read the basic tutorials first.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
omgitsme
Veteran Member
Join Date: Mar 2010
Old 07-30-2010 , 13:38   Re: Help
Reply With Quote #5

ok. but how come this still dosen't work?
set_user_bpammo(id, CSW_DEAGLE, 200);
Error: Undefined symbol "set_user_bpammo" on line 21
__________________
omgitsme is offline
Send a message via Skype™ to omgitsme
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 07-30-2010 , 13:44   Re: Help
Reply With Quote #6

Add

- #include <cstrike>
- Change set_user_bpammo to cs_set_user_bpammo
- compile

#Drekes

+1
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 07-31-2010 , 00:18   Re: Help
Reply With Quote #7

Quote:
Originally Posted by lucas_7_94 View Post
Add

- #include <cstrike>
- Change set_user_bpammo to cs_set_user_bpammo
- compile

#Drekes

+1
Damn, i failed
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
omgitsme
Veteran Member
Join Date: Mar 2010
Old 07-30-2010 , 15:03   Re: Help
Reply With Quote #8

thanks, and another last question (i hope)
i searched for spawn in the tutorials, and found a tutorial on new rounds, spawn and stuff. and i wanna know, how can i give a weapon/item to a player upon spawn?
Code:
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <hamsandwich>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
 
 
public plugin_init()
{
    register_clcmd("say /deagle", "weapon");
    RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1)
}
 
public weapon(id)
{
    if(is_user_alive(id))
    {
        strip_user_weapons(id)
        give_item( id, "weapon_knife" );
        give_item( id, "weapon_deagle" );
        cs_set_user_bpammo(id, CSW_DEAGLE, 200);
        set_user_health (id, 150);
        client_print(id, print_chat, "You got a deagle and 150 hp");
}

}
 
public fwHamPlayerSpawnPost(iPlayer) {
        if (is_user_alive(iPlayer)) {
    {
        give_item( id, "weapon_awp")
    }
}
{
i tried this, but it dosen't work. i'm just guessing, but i think it doesn't work because it's not a ham command and it's in the ham section? am i right? and i could'ent find the command for giving a item with ham. thanks for your help guys
__________________
omgitsme is offline
Send a message via Skype™ to omgitsme
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 07-30-2010 , 15:08   Re: Help
Reply With Quote #9

PHP Code:
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <hamsandwich>
 
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

public plugin_init()
{
     
register_clcmd("say /deagle""weapon");

     
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1)
}
 
public 
weapon(id)
{
     if(
is_user_alive(id))
     {
          
strip_user_weapons(id)
          
give_itemid"weapon_knife" );
          
give_itemid"weapon_deagle" );
          
cs_set_user_bpammo(idCSW_DEAGLE200);
          
set_user_health (id150);
          
client_print(idprint_chat"You got a deagle and 150 hp");
     }
}
 
public 
fwHamPlayerSpawnPost(id
{
     if (
is_user_alive(id))
          
give_itemid"weapon_awp")

__________________
You can do anything you set your mind to, man.

Devil259 is offline
omgitsme
Veteran Member
Join Date: Mar 2010
Old 08-03-2010 , 08:31   Re: Help
Reply With Quote #10

thanks, and what is wrong with this command
Code:
give_item(id, "weapon_he")
the whole code
Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1)
}

public fwHamPlayerSpawnPost(id)
if (is_user_alive(id))
{
    if (get_user_flags(id) & ADMIN_CHAT)
    strip_user_weapons(id)
    give_item(id, "weapon_knife")
    give_item(id, "weapon_he")
    give_item(id, "weapon_sg")
    give_item(id, "weapon_fb")
    give_item(id, "weapon_fb")
}
it does strip the weapons, and i do get a knife, and a bomb. but no grenades. wrong code, right?
__________________
omgitsme is offline
Send a message via Skype™ to omgitsme
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 00:08.


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