Raised This Month: $ Target: $400
 0% 

Problem making input file


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GunnerBones
Junior Member
Join Date: Sep 2017
Old 10-15-2017 , 01:02   Problem making input file
Reply With Quote #1

Hello,
I'm working off an already-created plugin for personal use, a plugin that lets you play as robots in TF2. I was interested in the Precache function and thought I could use that for any model, provided theres an MDL in the /models and the player types a command of the path, say "/clone/clonetrooper.mdl". However I am very new to sourcemod scripting and have ran into problems. When trying to compile this I get many errors like some of the variables are shadowing a variable at a preceding level, undefined/invalid expressions, etc. The full SP is attached, the code of problem is at 413-428, and 561-585:

-Argument that changes player stats and runs custom model command:
PHP Code:
public Action:Command_Cmodel_Me(clientargs)
{
    if (
GetClientTeam(client) ==3)
    {    
        
SetEntPropFloat(clientProp_Send"m_flModelScale"1.0);
        
TF2Attrib_SetByName(client"max health additive bonus"1000.0);
        
SetEntityHealth(client1000);
        
SetModelC(clientargs);
        
ReplyToCommand(client"[Red2Robot] You now have a custom model!");
        
ShowActivity2(client"[Red2Robot] ""%N is now using a custom model!"client);
    }
    else
    {
        
ReplyToCommand(client"[Red2Robot] You need to be in the BLU/Robots team in order to get a custom model.");
    }

-Custom model command:
PHP Code:
stock bool:SetModelC(client)
{
    if (
args == 1):
        new 
String:arg1[128]
        
GetCmdArg(1arg1128);
        if (!
IsValidClient(client)) return false;
        if (!
IsPlayerAlive(client)) return false;
        new 
String:Mdl[PLATFORM_MAX_PATH];
        switch (
TF2_GetPlayerClass(client))
        {
            
Format(Mdlsizeof(Mdl), arg1);
        }
        if (!
StrEquals(Mdl""))
        {
            
Format(Mdlsizeof(Mdl), "models/%s.mdl"Mdl);
            
PrecacheModel(Mdl);
        }
        
SetVariantString(Mdl);
        
AcceptEntityInput(client"SetCustomModel");
        
SetEntProp(clientProp_Send"m_bUseClassAnimations"1);
        if (
StrEqual(Mdl"")) return false;
        return 
true;
    else if (
args == 0):
        
ReplyToCommand(client"[Red2Robot] Error no input found!");

Its probably because I don't know how to import strings from a command If anyone could help that would be awesome.
Thanks
Attached Files
File Type: sp Get Plugin or Get Source (red2robotmodified.sp - 117 views - 21.3 KB)
GunnerBones is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 10-15-2017 , 01:52   Re: Problem making input file
Reply With Quote #2

I think you already know why you won`t get help here.
__________________
retired chump
DjSoftero 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 22:19.


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