AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Cs:s Deagle plugin - help (https://forums.alliedmods.net/showthread.php?t=295791)

TheBomBa 04-04-2017 17:52

Cs:s Deagle plugin - help
 
1 Attachment(s)
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.

OciXCrom 04-04-2017 18:02

Re: Cs:s Deagle plugin - help
 
The section is still wrong. This is not SourceMod. Why is it so hard to notice this?

TheBomBa 04-04-2017 18:35

Re: Cs:s Deagle plugin - help
 
Quote:

Originally Posted by OciXCrom (Post 2509412)
The section is still wrong. This is not SourceMod. Why is it so hard to notice this?

Sorry :D omg . I will post this at Sm. Misscliked

DELETE THIS POST.


All times are GMT -4. The time now is 17:59.

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