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

problem with this script (remove)


Post New Thread Reply   
 
Thread Tools Display Modes
Rowdy4E
Junior Member
Join Date: Nov 2018
Old 02-12-2019 , 13:41   Re: problem with this script (remove)
Reply With Quote #21

Quote:
i want add 2flashbang ..2grenade..1smoke... and 1 m4a1 for ct (ak47 for T) in every round (at spawn)

Without manipulating the original script ..how can i do?
So where is the problem?

PHP Code:
#pragma semicolon 1 

#define DEBUG 

#define PLUGIN_AUTHOR "Rowdy" 
#define PLUGIN_VERSION "1.03" 

#include <sourcemod> 
#include <sdktools>
#include <smlib>

#pragma newdecls required 

public Plugin myinfo =  

    
name "Replacing Guns?"
    
author PLUGIN_AUTHOR
    
description "..."
    
version PLUGIN_VERSION
    
url "https://steamcommunity.com/profiles/76561198307962930" 
}; 

public 
void OnPluginStart() 

    
HookEvent("player_spawn"OnPlayerSpawn); 


public 
void OnPlayerSpawn(Handle eventchar[] namebool dontBroadcast) { 
    
int client GetClientOfUserId(GetEventInt(event"userid")); 
     
    
ReplaceGuns(client); 


public 
void ReplaceGuns(int client) { 
    
int weaponIndex
    
char weaponName[64]; 
     
    if ((
weaponIndex GetPlayerWeaponSlot(client1)) != -1) { 
        if (
IsValidEntity(weaponIndex)) { 
            
GetEntityClassname(weaponIndexweaponNamesizeof(weaponName)); 
            if (
StrContains(weaponName"usp"false) != -|| StrContains(weaponName"glock"false) != -1) {  
                
RemovePlayerItem(clientweaponIndex); 
                
AcceptEntityInput(weaponIndex"Kill"); 
                
Client_GiveWeaponAndAmmo(client"weapon_deagle"true90);
            } 
        } 
    }
    
    
int team GetClientTeam(client); 
    if(
team == 2) { 
        
Client_GiveWeaponAndAmmo(client"weapon_ak47"true90); 
        
Client_GiveWeaponAndAmmo(client"weapon_knife"true1); 
        
Client_GiveWeaponAndAmmo(client"weapon_hegrenade"true2); 
        
Client_GiveWeaponAndAmmo(client"weapon_flashbang"true2); 
        
Client_GiveWeaponAndAmmo(client"weapon_smokegrenade"true1); 
    } else if (
team == 3) {
        
Client_GiveWeaponAndAmmo(client"weapon_m4a1"true90); 
        
Client_GiveWeaponAndAmmo(client"weapon_knife"true1); 
        
Client_GiveWeaponAndAmmo(client"weapon_hegrenade"true2); 
        
Client_GiveWeaponAndAmmo(client"weapon_flashbang"true2); 
        
Client_GiveWeaponAndAmmo(client"weapon_smokegrenade"true1); 
    } 

__________________


PHP, MySQL, SM, IPS Apps & Plugins

Last edited by Rowdy4E; 02-12-2019 at 13:43.
Rowdy4E is offline
generals
Member
Join Date: Aug 2018
Old 02-12-2019 , 13:53   Re: problem with this script (remove)
Reply With Quote #22

when i use 1 smoke in current round... just give smoke on next round..whats the problem? (flashbang and grenade also) (But the gun like a m4a1 or ak47 has no problem)

i want give me every round (2 flashbang ..2grenade..1smoke...1deagle and 1 m4a1 for ct (ak47 for T))

EDIT:

i changed code to this.. its worked

PHP Code:
GivePlayerItem(client"weapon_weaponname"); 
special thanks to Rowdy4E...Nexd and Cruze

Last edited by generals; 02-12-2019 at 15:06.
generals 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 14:51.


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