Raised This Month: $32 Target: $400
 8% 

[Request] Scoutzknivez only.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
T.N.T
Junior Member
Join Date: Jan 2009
Old 02-19-2009 , 08:47   [Request] Scoutzknivez only.
Reply With Quote #1

Hi folks, I need a plugin for my server
What I want, is a plugin that disables the buy function on spawn, and you spawn with scout and knife ONLY. So no pistol! And if you can, a buying option to "buy" 200 gravity.

Name of plugin : Scoutzknivez Only
Disables : Buy menu and pistol [and if Gravity used, say "drop" in chat to have 800 gravity.
[Gravity] : Able to buy 200 gravity with the say command: gravity
[Help] : say /skhelp to popup a (motd??) screen with all the commands you an use. (and this needs to be said in chat every 2 rounds or so.

-Thx in advance
T.N.T is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 02-19-2009 , 09:18   Re: [Request] Scoutzknivez only.
Reply With Quote #2

Code:
#include <amxmodx> #include <fakemeta> #include <hamsandwich> #define fm_create_entity(%1)     engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, %1)) #define MAX_BUFFER_LENGTH       1024 new bool:g_HasGravity[ 33 ]; public plugin_init() {     RegisterHam( Ham_Spawn, "player", "ham_spawn", 1 );         register_clcmd( "buy", "block" );     register_clcmd( "say gravity", "buy_gravity" );     register_clcmd( "say /skhelp", "help_cmd" ); } public block( id )     return PLUGIN_HANDLED; public client_putinserver( id ) g_HasGravity[ id ] = false; public buy_gravity( id ) {     if( !is_user_alive( id ) )         return PLUGIN_HANDLED;             if( g_HasGravity[ id ] )         return PLUGIN_HANDLED;             g_HasGravity[ id ] = true;     fm_set_user_gravity( id, 0.25 );         return PLUGIN_CONTINUE; } public ham_spawn( id ) {     g_HasGravity[ id ] = false;     fm_set_user_gravity( id );         fm_strip_user_weapons( id );     ham_give_item( id, "weapon_knife" );     ham_give_item( id, "weapon_scout" );     for( new i; i < 4; i++ )         ham_give_item( id, "ammo_762nato" );         return HAM_IGNORED; } public help_cmd( id ) {     new motd[ MAX_BUFFER_LENGTH ], len;         len = format( motd, MAX_BUFFER_LENGTH, "<body bgcolor=#000000><font color=#87cefa><pre>")     len += format( motd[ len ], MAX_BUFFER_LENGTH-len, "<center><h4><font color=^"blue^"> Commands </font></h4></center>" );     len += format( motd[ len ], MAX_BUFFER_LENGTH-len, "<left><font color=^"red^"><B>.gravity</B> -> <font color=^"white^">sets your gravity to 200</color></left>^n" );     len += format( motd[ len ], MAX_BUFFER_LENGTH-len, "<left><font color=^"red^"><B>.drop</B> -> <font color=^"white^">sets your gravity to 800</color></left>^n" );         show_motd( id, motd, "Help" );     return PLUGIN_CONTINUE; } ham_give_item( id, weapon[] ) {     new wEnt = fm_create_entity( weapon );     if( !pev_valid( wEnt ) )         return 0;     set_pev( wEnt, pev_spawnflags, SF_NORESPAWN );     dllfunc( DLLFunc_Spawn, wEnt );         if( !ExecuteHamB( Ham_AddPlayerItem, id, wEnt ) )     {         if( pev_valid( wEnt ) )             set_pev( wEnt, pev_flags, pev( wEnt, pev_flags ) | FL_KILLME );         return 0;     }         ExecuteHamB( Ham_Item_AttachToPlayer, wEnt, id )     return 1; } fm_strip_user_weapons( index ) {     new ent = fm_create_entity( "player_weaponstrip" );     if( !pev_valid( ent ) )         return 0;     dllfunc( DLLFunc_Spawn, ent );     dllfunc( DLLFunc_Use, ent, index );     engfunc( EngFunc_RemoveEntity, ent );     return 1; } fm_set_user_gravity( index, Float:gravity = 1.0 )     set_pev( index, pev_gravity, gravity );
__________________

anakin_cstrike is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 02-19-2009 , 09:21   Re: [Request] Scoutzknivez only.
Reply With Quote #3

you should just move buyzone from map, because you can buy with autobuy and console commands.
__________________
xPaw is offline
T.N.T
Junior Member
Join Date: Jan 2009
Old 02-19-2009 , 10:23   Re: [Request] Scoutzknivez only.
Reply With Quote #4

Thanks! So I copied this all and saved as .amxx file, but it doesnt load =S Do I need to compile or something?? I cant find anything on this forum =[
T.N.T is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 02-19-2009 , 10:26   Re: [Request] Scoutzknivez only.
Reply With Quote #5

The .amxx file goes into amxmodx/plugins dir.
__________________

anakin_cstrike is offline
T.N.T
Junior Member
Join Date: Jan 2009
Old 02-19-2009 , 10:27   Re: [Request] Scoutzknivez only.
Reply With Quote #6

That was the mistake! Ty (i NEVER make mistakes lol)
T.N.T is offline
T.N.T
Junior Member
Join Date: Jan 2009
Old 02-19-2009 , 10:52   Re: [Request] Scoutzknivez only.
Reply With Quote #7

Okay, I compiled this code to .amxx using amxmodx.org webcompiler. now I downloaded the file and put it in amxmodx\plugins\ (named it scoutzknivez)
Now I mentioned scoutzknivez.amxx in the configs\plugins.ini RIGHT and when I check server console and write amx plugins and get this:


[ 28] unknown unknown unknown scoutzknivez.am running
28 plugins, 27 running

And when I join the server, the server crashes?? plugin bug or?
T.N.T is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-19-2009 , 10:53   Re: [Request] Scoutzknivez only.
Reply With Quote #8

@T.N.T : Are you sure you can buy on the map : scoutzknivez.bsp ? Because in this map there is an entity "info_map_parameters" which set to 3 meaning "Neither CT's nor T's can buy guns" ; so it should impossible to buy. It's not another map ? I will test.

@anakin_cstrike : Instead of rushing to do a request, try to think a bit before, please. In this map, there are already 2 entity which strip and give weapons at spawn. Supposing that the map is scoutzknivez.bsp and nothing else. So, most of code would be useless here. What you should try is to figure out why he can buy when there are already an entity blocking the bying for both team.
Arkshine is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 02-19-2009 , 11:01   Re: [Request] Scoutzknivez only.
Reply With Quote #9

Arkshine, he never states that he wants it for a specific map.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-19-2009 , 11:07   Re: [Request] Scoutzknivez only.
Reply With Quote #10

Title : [Request] Scoutzknivez only

??

Scoutzknivez is just a name, not the map name ? Oh I see. ^^ Shame on me to not fully understand english.

If so, well, it's still more appropriate to use here player_weaponstrip and game_playerequip.

Last edited by Arkshine; 02-19-2009 at 11:13.
Arkshine is offline
Old 02-19-2009, 11:11
xPaw
This message has been deleted by xPaw. Reason: nvm
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:13.


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