Raised This Month: $ Target: $400
 0% 

Spawn equipment


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Malak044
Member
Join Date: Feb 2011
Location: héhéhé
Old 03-25-2011 , 08:01   Spawn equipment
Reply With Quote #1

Here is the problem, i want to spawn some equipement for bunny (a scout) and ive got this problem :

Console :
Code:
L 03/25/2011 - 12:45:26: "Malak044 | SourcePawn <3<2><STEAM_0:0:36354811><TERRORIST>" say "!VIP"
L 03/25/2011 - 12:45:28: [VIP script.smx] "Malak044 | SourcePawn <3<2><STEAM_0:0:36354811><>" spawn a scout V.I.P.
Bad pstudiohdr in GetSequenceLinearMotion()!
CalcSequenceIndex: can't find 'idle_upper_***************************H'.
L 03/25/2011 - 12:46:01: "Malak044 | SourcePa
and the code in the plugin is this :
Code:
GetScout(client)
{
    if(GetPlayerWeaponSlot(client, 1) != -1)
    {
        PrintToChat(client, "\x04[V.I.P.]\x03 You already have a primary arm !");
    }
    else
    {
        new scoutvip = CreateEntityByName("weapon_scout");
        EquipPlayerWeapon(client, scoutvip);
        SetEntData(scoutvip, FindSendPropInfo("CBaseCombatWeapon", "m_iClip1"), 0);
        LogMessage("\"%L\" spawn a scout V.I.P.", client);
        PrintToChatAll("\x04[V.I.P.]\x03 \"%L\" a recu un scout", client);
    }
}
First If-Statement he cant receive a scout because he have already a primary weapon
Second If-statement is giving him a scout with no bullets

Second problem, i want to put the third view for fun and ive put this :
Code:
SetThirdPersonView(client, third)
{
    if(third && !g_InThirdPersonView[client])
    {
        SetEntPropEnt(client, Prop_Send, "m_hObserverTarget", 0); 
        SetEntProp(client, Prop_Send, "m_iObserverMode", 1);
        SetEntProp(client, Prop_Send, "m_bDrawViewmodel", 0);
        SetEntProp(client, Prop_Send, "m_iFOV", 120);
        g_InThirdPersonView[client] = true;
        LogMessage("\"%L\" active la 3rd view V.I.P.", client);
        PrintToChatAll("\x04[V.I.P.]\x03 \"%L\" active la 3rd view", client);
    }
    else if(!third && g_InThirdPersonView[client])
    {
        SetEntPropEnt(client, Prop_Send, "m_hObserverTarget", -1);
        SetEntProp(client, Prop_Send, "m_iObserverMode", 0);
        SetEntProp(client, Prop_Send, "m_bDrawViewmodel", 1);
        SetEntProp(client, Prop_Send, "m_iFOV", 90);
        g_InThirdPersonView[client] = false;
        LogMessage("\"%L\" desactive la 3rd view V.I.P.", client);
    }    
}
First If statment for giving him 3rd view and second if statement for returning to normal mod

But it give to the player third view but fixed ... i want that the third view follow the player (always behind him)

Where am i wrong ?

Last edited by Malak044; 03-25-2011 at 08:03.
Malak044 is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 03-25-2011 , 08:03   Re: Spawn equipment
Reply With Quote #2

Regarding the second question, that thirdperson view doesn work for TF2, there is another method which you can find by searching.
__________________
Silvers is offline
Malak044
Member
Join Date: Feb 2011
Location: héhéhé
Old 03-25-2011 , 08:05   Re: Spawn equipment
Reply With Quote #3

its for Counter-Strike Source

so there is another method witch is more simple like "SetThirdView(client, bool)" ?

EDIT : there is a command considered as a cheat for the third view, if i force clients to use it on a non cheating server, will get steam banned ?

Last edited by Malak044; 03-25-2011 at 08:13.
Malak044 is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 03-25-2011 , 08:13   Re: Spawn equipment
Reply With Quote #4

Oh hmm then I think that should work, maybe the m_iFOV is messing it since I dont see that in the thirdpersonview codes I saw (althought I doubt that). There are various topics on it if you search.
__________________
Silvers is offline
Malak044
Member
Join Date: Feb 2011
Location: héhéhé
Old 03-25-2011 , 09:05   Re: Spawn equipment
Reply With Quote #5

okay fixed, it was mp_forcecamera

but ive got problem with menu ... when i clic on the 0 for exit the menu ... then the server crashed ... here is the code for the handlers ...
Code:
//Handler du menu VIP
public MenuHandlerVIP(Handle:menu_VIP, MenuAction:action, param1 ,param2)
{
    if(action == MenuAction_Select)
    {
        switch (param2)
        {
            case 0:
            {
                //envoye le menu 3rd
                DisplayMenu(menu_3rd, param1, MENU_TIME_FOREVER);
            }
            case 1:
            {
                //envoye le menu skin
                DisplayMenu(menu_skin, param1, MENU_TIME_FOREVER);
            }
            case 2:
            {
                //envoye le menu color
                DisplayMenu(menu_color, param1, MENU_TIME_FOREVER);
            }
            case 3:
            {
                PerformNoClip(param1);
            }
            case 4:
            {
                GetScout(param1);
            }
        }
    }
    if(action == MenuAction_End || action == MenuAction_Cancel)
    {
        //ferme le menu
        CloseHandle(menu_VIP);
    }
}
dont understand ...
Malak044 is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 03-25-2011 , 09:14   Re: Spawn equipment
Reply With Quote #6

Only use CloseHandle() on MenuAction_End.
__________________
Silvers is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 03-25-2011 , 09:20   Re: Spawn equipment
Reply With Quote #7

Use GivePlayerItem considering your first question.
__________________
Peace-Maker 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 02:46.


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