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

Help please scripting weapon


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
romain3009
Junior Member
Join Date: Jul 2011
Old 04-17-2012 , 05:45   Help please scripting weapon
Reply With Quote #1

Hello, i'm a debutant and i have a little problem for the compilation :

PHP Code:
#include <sourcemod>
 
public Plugin:myinfo 
{
        
name "Weapon",
        
author "Izio38",
        
description " Give riffle when mmark !weapon",
        
version "1.0.0",
        
url "http://www.xlgamingforums.com" 
};

public 
OnPluginStart()
{
    
RegConsoleCmd("sm_weapon"Weapon);
}
public 
Action:Weapon(clientargs)
{
    
FakeClientCommand(client"give rifle");
    
PrintToChat(client"Tu a eu un riffle");
    return 
Plugin_Handle;

Thanks for u'r help
romain3009 is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 04-17-2012 , 06:52   Re: Help please scripting weapon
Reply With Quote #2

You forgot to tell the problem.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 04-17-2012 , 06:54   Re: Help please scripting weapon
Reply With Quote #3

It's:

return Plugin_Handled;
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0

Last edited by berni; 04-17-2012 at 06:54.
berni is offline
341464
Senior Member
Join Date: Dec 2010
Location: GetClientEyePosition
Old 04-17-2012 , 08:04   Re: Help please scripting weapon
Reply With Quote #4

Doesn't this require sv_cheats?
__________________
341464 is offline
Send a message via Skype™ to 341464
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 04-17-2012 , 11:54   Re: Help please scripting weapon
Reply With Quote #5

Rather than using FakeClientCommand, use GivePlayerItem.

Does anyone know if it's weapon_rifle for the rifle in CS:S?
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 04-17-2012 , 12:24   Re: Help please scripting weapon
Reply With Quote #6

Quote:
Originally Posted by Powerlord View Post
Rather than using FakeClientCommand, use GivePlayerItem.

Does anyone know if it's weapon_rifle for the rifle in CS:S?
It isnt. It sounds more like l4d(2) a lot of the plugins for l4d(2) use the give method I cant recall why
(or if there is reason as to why). But iirc GivePlayerItem should work.
Dr!fter is offline
Reply


Thread Tools
Display Modes

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 13:01.


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