Raised This Month: $ Target: $400
 0% 

Zombie Panic Source [Spawn misc edit]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ORdli
Member
Join Date: Nov 2021
Old 12-16-2022 , 08:48   Zombie Panic Source [Spawn misc edit]
Reply With Quote #1

I tried to make a plugin, one of them works but does not give armor, the other plugin simply does not compile, although in other games the armor issuance plugin works, most likely I think this is due to the command itself, which is responsible for issuing armor, but I'm not sure...if anyone knows which line is responsible for spawning armor in the game, let me know, I know that the item in the game is called give misc_armor But it does not work.

1. Spawn with Added random guns

#include <sourcemod>

public OnPluginStart()
{
HookEvent("player_spawn", EventSpawn);
}

public EventSpawn(Handle:Event, const String:Name[], bool:Broadcast)
{
decl Client;
Client = GetClientOfUserId(GetEventInt(Event, "userid"));

GivePlayerItem(Client, "weapon_m4"); GivePlayerItem(Client, "weapon_870"); "random"));
}


2. Spawn with Armor

public OnPluginStart()
{
cvar_armor = CreateConVar( "sv_armor", "1", "Enables/disables the plugin" );
cvar_armor_amount = CreateConVar( "sv_armor_amount", "100", "How much armor player will get on spawn" );

HookEvent( "player_spawn", HookPlayerSpawn, EventHookMode_Post );

CreateConVar( "sm_spawn_armor", PLUGIN_VERSION, "Spawn with Armor version", CVAR_FLAGS );
}

public HookPlayerSpawn( Handle:event, const String:name[ ], bool:dontBroadcast )
{
new client = GetClientOfUserId( GetEventInt( event, "userid" ) );

if ( IsPlayerAlive( client ) && GetConVarInt( cvar_armor ) )
{
SetEntProp( client, Prop_Send, g_armor_prop, GetConVarInt( cvar_armor_amount ), 1 );
}
}

Last edited by ORdli; 12-16-2022 at 09:01.
ORdli 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 05:48.


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