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

game_player_equip


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 03-17-2010 , 19:12   game_player_equip
Reply With Quote #1

Does anybody knows how to create and use game_player_equip with a plugin?

I mean, I guess I know how it works but I've tried to create and add some weapons as kvd but doesn't work.

As far as I know, this entity give items to players when they spawn.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-17-2010 , 19:21   Re: game_player_equip
Reply With Quote #2

example :

entity = create_entity( "game_player_equip" );
DispatchKeyValue( entity, "weapon_knife" , "1" );
DispatchKeyValue( entity, "weapon_glock18", "1" );
DispatchKeyValue( entity, "ammo_9mm" , "3" );
DispatchKeyValue( entity, "targetname" , "equipment" );
DispatchSpawn( entity );

Then you need to trigger it either using another entity (any entities which can called a target ) either I guess with Ham_Use or something.
This entity doesn't give weapons at spawn. It needs another entity to trigger it ( game_playerspawn used multi_manager )
Something like : https://forums.alliedmods.net/showpo...27&postcount=2 ; but it will called each times on resethud too ; so it may not a good idea.
__________________

Last edited by Arkshine; 03-17-2010 at 19:25.
Arkshine is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 03-17-2010 , 19:26   Re: game_player_equip
Reply With Quote #3

Right, but what about this:

http://developer.valvesoftware.com/w...e_player_equip
Quote:
Spawns one or several entities at the location of the player. Used in multiplayer games to automatically equip the players with standard gear on map spawn
I want the engine give items automatically using it.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-17-2010 , 19:28   Re: game_player_equip
Reply With Quote #4

Yes it works, you don't need any other trigger ent.
But weapons will be given also when players send command "fullupdate".
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-17-2010 , 19:29   Re: game_player_equip
Reply With Quote #5

oh I was not aware, so yes it should work so, though never tried.
__________________
Arkshine is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-17-2010 , 19:45   Re: game_player_equip
Reply With Quote #6

I'm idiot, I was aware. Last time I have decompiled PlayerSpawn() for Connor and it's quite the same as the HLSDK one and we can see well it search for game_player_equip automatically :

Code:
void CHalfLifeMultiplay::PlayerSpawn( CBasePlayer *pPlayer ) {     if ( pPlayer->m_bJustConnected )     {         return;     }     bool addDefault = true;     CBaseEntity *pWeapon = NULL;         pPlayer->pev->weapons |= ( 1 << WEAPON_SUIT );     while ( pWeapon = UTIL_FindEntityByClassname( pWeapon, "game_player_equip" ) )     {         pWeapon->Touch( pPlayer );         addDefault = false;     }     if ( pPlayer->m_bNotKilled )     {         addDefault = false;     }         if ( addDefault || pPlayer->m_bIsVIP )     {         pPlayer->GiveDefaultItems();     }     pPlayer->SetPlayerModel(); }
__________________

Last edited by Arkshine; 03-17-2010 at 19:51.
Arkshine is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 03-17-2010 , 20:00   Re: game_player_equip
Reply With Quote #7

Last question.
Should this entity be created at precache or can be created during game?
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-17-2010 , 20:05   Re: game_player_equip
Reply With Quote #8

If it searches like that on player's spawn we can guess it can be creatde in game without problem.
__________________
Arkshine is offline
ish12321
Veteran Member
Join Date: May 2016
Old 06-11-2018 , 07:07   Re: game_player_equip
Reply With Quote #9

Quote:
Originally Posted by Arkshine View Post
example :

entity = create_entity( "game_player_equip" );
DispatchKeyValue( entity, "weapon_knife" , "1" );
DispatchKeyValue( entity, "weapon_glock18", "1" );
DispatchKeyValue( entity, "ammo_9mm" , "3" );
DispatchKeyValue( entity, "targetname" , "equipment" );
DispatchSpawn( entity );

Then you need to trigger it either using another entity (any entities which can called a target ) either I guess with Ham_Use or something.
This entity doesn't give weapons at spawn. It needs another entity to trigger it ( game_playerspawn used multi_manager )
Something like : https://forums.alliedmods.net/showpo...27&postcount=2 ; but it will called each times on resethud too ; so it may not a good idea.
Sorry to bump this old thread.
If there is already an existing game_player_equip entity. Is it possible to know which all keyvalues it has, i.e., which all weapons it gives ?
__________________
['O|s|G'] | Death Wins a.k.a Ish Chhabra was here
ish12321 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 04:52.


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