AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Help please scripting weapon (https://forums.alliedmods.net/showthread.php?t=183087)

romain3009 04-17-2012 05:45

Help please scripting weapon
 
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

berni 04-17-2012 06:52

Re: Help please scripting weapon
 
You forgot to tell the problem.

berni 04-17-2012 06:54

Re: Help please scripting weapon
 
It's:

return Plugin_Handled;

341464 04-17-2012 08:04

Re: Help please scripting weapon
 
Doesn't this require sv_cheats?

Powerlord 04-17-2012 11:54

Re: Help please scripting weapon
 
Rather than using FakeClientCommand, use GivePlayerItem.

Does anyone know if it's weapon_rifle for the rifle in CS:S?

Dr!fter 04-17-2012 12:24

Re: Help please scripting weapon
 
Quote:

Originally Posted by Powerlord (Post 1691088)
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.


All times are GMT -4. The time now is 09:44.

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