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

[CSGO] Fix plugin playerModel


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
poel
Veteran Member
Join Date: Mar 2013
Old 08-02-2015 , 18:18   [CSGO] Fix plugin playerModel
Reply With Quote #1

Hi,

Modeler (Andi) made a new skin, and with this skin, he included a plugin to give some effects in the model. (Flame)

The plugin is public, and I just want a plugin fixed, so, if someone can help him with his code, fix it, I think he will appreciat. Atm, for him, he doesnt have any problem. But, I have some error logs (probably because I have some conflit with others plugins, i'm using timer plugin from zipcore)

[SM] Native "GetEntPropString" reported: Entity 4 (4) is invalid
L 08/03/2015 - 00:054: [SM] Displaying call stack trace for plugin "sm_ghostrider.smx":
L 08/03/2015 - 00:054: [SM] [0] Line 108, D:\csgo\csgo\addons\sourcemod\scripting\sm_gh ostrider.sp:LDeleteFlame()

+ Atm, if you join the game, you will not have the flame. The plugin give to you the effect, only after round restart. Will be great if someone can add in the code, something to fix that. Because, on MG, or bhop, or zombie server, you all the time join the server when round is in progress.

+If you are in spec, and if you are spectate a player, you still have flame on his head (third person view) It mean, add cvar when player join spect, remove or disable it.

Ty for help.

All credits for Andi ofc.
Attached Files
File Type: sp Get Plugin or Get Source (sm_ghostrider.sp - 423 views - 3.2 KB)

Last edited by poel; 08-02-2015 at 18:32.
poel is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 08-02-2015 , 23:08   Re: [CSGO] Fix plugin playerModel
Reply With Quote #2

for error you should pass userid instead of client index and check if index/user is valid
so change
PHP Code:
CreateTimer(5.0DLDeleteFlameclientTIMER_REPEAT
to

PHP Code:
CreateTimer(5.0DLDeleteFlameGetClientUserid(client), TIMER_REPEAT
and then change
PHP Code:
public Action:DLDeleteFlame(Handle:timerany:client)
{
    
decl String:ModelName[128];
    
GetEntPropString(clientProp_Data"m_ModelName"ModelNamesizeof(ModelName));
    
    if(
StrEqual(ModelName"models/player/marvel/ghostrider/ghostrider_t.mdl"))
    {
        return 
Plugin_Continue;
    }
    else 
    {
        
DeleteFlame(client);
    }
    return 
Plugin_Handled

to

PHP Code:
public Action:DLDeleteFlame(Handle:timerany:userid)
{
    
decl String:ModelName[128];
        new 
client GetClientOfUserId(userid);
        if (!
IsValidClient(client))
           return 
Plugin_Stop;
    
GetEntPropString(GetClientOfUserId(userid), Prop_Data"m_ModelName"ModelNamesizeof(ModelName));
    
    if(
StrEqual(ModelName"models/player/marvel/ghostrider/ghostrider_t.mdl"))
    {
        return 
Plugin_Continue;
    }
    else 
    {
        
DeleteFlame(client);
    }
    return 
Plugin_Handled

but i think maybe an individual timer should be used instead of just one timer :>

Last edited by 8guawong; 08-02-2015 at 23:09.
8guawong 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 09:40.


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