AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [Request] Scoutzknivez only. (https://forums.alliedmods.net/showthread.php?t=86004)

T.N.T 02-19-2009 08:47

[Request] Scoutzknivez only.
 
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

anakin_cstrike 02-19-2009 09:18

Re: [Request] Scoutzknivez only.
 
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 );

xPaw 02-19-2009 09:21

Re: [Request] Scoutzknivez only.
 
you should just move buyzone from map, because you can buy with autobuy and console commands.

T.N.T 02-19-2009 10:23

Re: [Request] Scoutzknivez only.
 
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 =[

anakin_cstrike 02-19-2009 10:26

Re: [Request] Scoutzknivez only.
 
The .amxx file goes into amxmodx/plugins dir.

T.N.T 02-19-2009 10:27

Re: [Request] Scoutzknivez only.
 
That was the mistake! Ty (i NEVER make mistakes lol)

T.N.T 02-19-2009 10:52

Re: [Request] Scoutzknivez only.
 
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?

Arkshine 02-19-2009 10:53

Re: [Request] Scoutzknivez only.
 
@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.

DarkGod 02-19-2009 11:01

Re: [Request] Scoutzknivez only.
 
Arkshine, he never states that he wants it for a specific map.

Arkshine 02-19-2009 11:07

Re: [Request] Scoutzknivez only.
 
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.


All times are GMT -4. The time now is 08:03.

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