Raised This Month: $ Target: $400
 0% 

Solved Cs:s Deagle plugin - help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TheBomBa
Junior Member
Join Date: Apr 2017
Old 04-04-2017 , 17:52   Cs:s Deagle plugin - help
Reply With Quote #1

Hello, i was requested for make this plugin work this way. If someone keeps the pistol example (usp,glock,dualies and more..) at the end of round, pistol wil be not replaced by deagle. If someone dies or drops the pistol. He will get a deagle at start of the round. Normal script (pistol is always replaced with deagle)

PHP Code:
public OnPluginStart()
{
   
HookEvent("player_spawn"Event_PlayerSpawn);
}

public 
Action:Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    new 
weaponEntity GetPlayerWeaponSlot(client1);
    if (
IsValidEntity(weaponEntity))
    {
        
RemovePlayerItem(clientweaponEntity);
        
RemoveEdict(weaponEntity);
    }
    
GivePlayerItem(client"weapon_deagle"0);
    
GivePlayerItem(client"item_assaultsuit"0);
    return;

PHP Code:
public OnPluginStart()
{
   
HookEvent("player_spawn"Event_PlayerSpawn);
}

public 
Action:Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    new 
weaponEntity GetPlayerWeaponSlot(client1);
    
GivePlayerItem(client"weapon_deagle"0);
    
GivePlayerItem(client"item_assaultsuit"0);
    return;

This is how i tried to make it "work"

If i remove this, the plugin will never give you deagle. Even if you drop the pistol or die. You always get the basic starting pistol.
PHP Code:
if (IsValidEntity(weaponEntity))
    {
        
RemovePlayerItem(clientweaponEntity);
        
RemoveEdict(weaponEntity);
    } 
I saw it on one server working this way. But i don't know how to make it happen on mine. Any ideas how to make it happen? I tried more things, but still without change .

Thanks, all advices will be appreciate.
Attached Files
File Type: sp Get Plugin or Get Source (css-suit-and-deagle.sp - 107 views - 857 Bytes)

Last edited by TheBomBa; 04-04-2017 at 18:36. Reason: Miss
TheBomBa is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-04-2017 , 18:02   Re: Cs:s Deagle plugin - help
Reply With Quote #2

The section is still wrong. This is not SourceMod. Why is it so hard to notice this?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
TheBomBa
Junior Member
Join Date: Apr 2017
Old 04-04-2017 , 18:35   Re: Cs:s Deagle plugin - help
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
The section is still wrong. This is not SourceMod. Why is it so hard to notice this?
Sorry omg . I will post this at Sm. Misscliked

DELETE THIS POST.
TheBomBa 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 17:59.


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