Raised This Month: $32 Target: $400
 8% 

[CSGO] Need plugin fixed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
srvmil
Senior Member
Join Date: Oct 2010
Old 02-25-2018 , 21:42   [CSGO] Need plugin fixed
Reply With Quote #1

PHP Code:
#include <sourcemod>
#include <sdkhooks>
#include <sdktools>
#include <cstrike>

new Handle:Cvar_Enable;


#define PLUGIN_VERSION "1.0"

public Plugin:myinfo 
{
    
name "Predator",
    
author "",
    
description "Predator Mod",
    
version PLUGIN_VERSION,
    
url ""
};

public 
OnPluginStart()
{

    
HookEvent("player_spawn"PlayerSpawnEvent);
  
    
Cvar_Enable CreateConVar("mvp_enable""1""Enable/disable Predator Mod"FCVAR_PLUGIN);
  
    
PrintToServer("Predator Mod v1 - 2018")
}


public 
PlayerSpawnEvent(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"))
    
    if (
GetClientTeam(client) == 2)
    {    
        if (
GetConVarInt(Cvar_Enable) == 1)
        {
            
SetEntityModel(client,"models/player/custom/predator/predator.mdl");
            
SetEntityRenderMode(client,  RENDER_TRANSCOLOR);
            
SetEntityRenderColor(client25525525515);
            
SetEntityHealth(client600);
         
//EmitSoundToClient(client, "");
            
SetEntPropFloat(clientProp_Data"m_flLaggedMovementValue"1.2);    
        }
        for(new 
04i++)
        {
            new 
weapon GetPlayerWeaponSlot(clienti);
            if(
weapon != -1)
            {
            }
        }
    }
    else if (
GetClientTeam(client) == 3)
    {
        
SetEntPropFloat(clientProp_Data"m_flLaggedMovementValue"1.0);
    
//SetEntityModel(client,"models/player/.mdl Add Marine Here");
        
SetEntityRenderColor(client255255255255);
        
SetEntityHealth(client100);
    }

This plugins keep crashing in game when joining the Terrorist team. Server is Linux based, of course I did use Linux version of SourceMod and MetaMod Source.

sv_disable_immunity_alpha "1" is also in server.cfg for it to work.

Any idea why it keep crashing? Can anybody help fix this up please?

Last edited by srvmil; 02-25-2018 at 21:44.
srvmil is offline
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 02-25-2018 , 22:02   Re: [CSGO] Need plugin fixed
Reply With Quote #2

you must precache the model on OnMapStart
__________________
coding & free software
shanapu 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 16:54.


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