Senior Member
Join Date: Jun 2014
Location: Morroco
|
03-25-2015
, 14:28
[ReQ] \Block & Allow Cmd /
|
#1
|
Hey , it's me Again
I'm working on this plugins ( Naruto mod ) I know i'm not an expert but i will try at least ^^
This mod is a mix of a lot of plugins ( GhW changemodel - Longjump- portal..)
And , I've added Some stuffs & This Classmenu
PHP Code:
#include <amxmodx> #include <fun> #include <cstrike> #include <hamsandwich>
new bool:HasSpeed[33];
public client_putinserver(id) HasSpeed[id] = true; public client_disconnect(id) HasSpeed[id] = true;
public onCurWeapon(id) if(HasSpeed[id]) set_user_maxspeed(id, 600.0);
public plugin_precache() { precache_model("models/player/gaara/gaara.mdl") precache_model("models/player/naruto/naruto.mdl") precache_model("models/player/shikamaru/shikamaru.mdl") }
public plugin_init() { register_clcmd( "youwontknowthis","Classmenu" ); RegisterHam(Ham_Spawn, "player", "onSpawnPost", true); register_event("CurWeapon", "onCurWeapon", "be", "1=1"); RegisterHam(Ham_Item_PostFrame, "weapon_knife", "Knife_PostFrame") } public onSpawnPost(id) Classmenu(id);
public Classmenu( id ) { new menu = menu_create( "Class menu", "menu_handler" ); menu_additem( menu, "\\r Gaara [Fly + Speed]", "", 0 ); menu_additem( menu, "\\r Naruto [\\y Speed +Hp+Shadow-Clone]", "", 0 ); menu_additem( menu, "\\w Shikamaru [\\y Grab + Speed O.Admins]", "", ADMIN_BAN ); menu_additem( menu, "\\w Kisame Hoshigaki [\\y No Clip +low hp]", "", 0 ); menu_additem( menu, "\\w Obito [\\y Portals + Speed O.Admins]", "", ADMIN_BAN );
menu_setprop( menu, MPROP_EXIT, MEXIT_ALL ); menu_display( id, menu, 0 ); }
public menu_handler( id, menu, item ) {
switch( item ) { case 0: { client_print( id, print_chat, "You Are now Gaara " ); set_user_health(id, get_user_health( id ) + 300); give_item(id, "weapon_hegrenade") give_item(id, "weapon_smokegrenade") cs_set_user_bpammo(id, CSW_HEGRENADE, 10) cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 5) set_user_maxspeed(id, 850.0); cs_set_user_model(id, "Gaara")
menu_destroy( menu ); return PLUGIN_HANDLED; } case 1: { client_print( id, print_chat, " You are now Naruto" ); set_user_health(id, get_user_health( id ) + 450); give_item(id, "weapon_hegrenade") give_item(id, "weapon_smokegrenade") cs_set_user_bpammo(id, CSW_HEGRENADE, 10) cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 10) set_user_maxspeed(id, 850.0); cs_set_user_model(id, "Naruto") } case 2: { client_print( id, print_chat, "You have selected Shikamaru" ); set_user_health(id, get_user_health( id ) + 350); give_item(id, "weapon_hegrenade") give_item(id, "weapon_smokegrenade") cs_set_user_bpammo(id, CSW_HEGRENADE, 5) cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 5) set_user_maxspeed(id, 850.0); cs_set_user_model(id, "shikamaru") } case 3: { client_print( id, print_chat, "You have selected Kisame Hoshigaki" ); set_user_health(id, get_user_health( id ) + 150); give_item(id, "weapon_hegrenade") give_item(id, "weapon_smokegrenade") cs_set_user_bpammo(id, CSW_HEGRENADE, 5) cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 5) set_user_maxspeed(id, 850.0); cs_set_user_model(id, "shikamaru") set_user_noclip(id, 1) } case 4: { client_print( id, print_chat, "You have selected Obito" ); client_print( id, print_chat, "Use Bind X portal_entrance & bind x2 portal_exit" ); set_user_health(id, get_user_health( id ) + 350); give_item(id, "weapon_hegrenade") give_item(id, "weapon_smokegrenade") cs_set_user_bpammo(id, CSW_HEGRENADE, 5) cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 5) set_user_maxspeed(id, 850.0); cs_set_user_model(id, "shikamaru") } case MENU_EXIT: { client_print( id, print_chat, "You exited the menu... " ); } }
menu_destroy( menu ); return PLUGIN_HANDLED; }
So , The Deal is , I dont know where exactly , i found a topic , some one was asking about some portal plugin , here's the code ( it's not Completed )
PHP Code:
#include <amxmodx> #include <engine> #include <fun>
new bool:Exit new bool:Entrance new Float: fTeleportOrigin[3] new iTeleportOrigin[3]
public plugin_precache() { precache_model("sprites/e-tele1.spr") }
public plugin_init() { register_touch("portal_entrance", "player", "portal_touch")
register_clcmd("portal_entrance", "cmd_portal") register_clcmd("portal_exit", "cmd_portal2") } public cmd_portal(id) { new enOrigin[3]
get_user_origin(id, enOrigin) enOrigin[2] = enOrigin[2] + 20
client_print(0, print_chat, "%d started creating portal...", id)
set_task(1.0, "create_portal", id, enOrigin, 3) } public cmd_portal2(id) { new exOrigin[3]
get_user_origin(id, exOrigin)
client_print(0, print_chat, "%d started creating portal...", id)
set_task(1.0, "create_portal2", id, exOrigin, 3) } public portal_touch(ent, id) { new Owner = entity_get_edict(ent,EV_ENT_owner) if(Owner == id) { if(!Exit) { client_print(id, print_center, "Create A Exit Portal First") } else { set_user_origin(id, iTeleportOrigin) client_print(id,print_center,"You have been teleported") client_print(id, print_chat, "Teleported..") set_user_health(id, get_user_health( id ) + 5); } } else { client_print(id, print_center, "Use your own portals") return } }
public create_portal(enOrigin[3], id) { new Float:fOrigin[3] new ent = create_entity("env_sprite")
remove_entity_name("portal_entrance") IVecFVec(enOrigin, fOrigin)
entity_set_string(ent, EV_SZ_classname, "portal_entrance") entity_set_model(ent, "sprites/e-tele1.spr") entity_set_int(ent, EV_INT_spawnflags, SF_SPRITE_STARTON) entity_set_float(ent, EV_FL_framerate, 30.0)
DispatchSpawn(ent)
entity_set_origin(ent, fOrigin) entity_set_size(ent, Float:{-25.0, -25.0, -25.0}, Float:{25.0, 25.0, 25.0}) entity_set_int(ent, EV_INT_solid, SOLID_TRIGGER) entity_set_int(ent, EV_INT_movetype, MOVETYPE_FLY) entity_set_int(ent, EV_INT_rendermode, kRenderTransAdd) entity_set_float(ent, EV_FL_renderamt, 255.0) entity_set_float(ent, EV_FL_scale, 1.0) entity_set_edict(ent,EV_ENT_owner, id) Entrance = true client_print(0, print_chat, "%d created portal (%d)", id, ent) } public create_portal2(exOrigin[3], id) { new Float:fOrigin[3] remove_entity_name( "portal_exit" ) new ent = create_entity("env_sprite")
IVecFVec(exOrigin, fOrigin) entity_set_string(ent, EV_SZ_classname, "portal_exit") entity_set_model(ent, "sprites/e-tele1.spr") entity_set_int(ent, EV_INT_spawnflags, SF_SPRITE_STARTON) entity_set_float(ent, EV_FL_framerate, 30.0)
DispatchSpawn(ent)
entity_set_origin(ent, fOrigin) entity_set_size(ent, Float:{-25.0, -25.0, -25.0}, Float:{25.0, 25.0, 25.0}) entity_set_int(ent, EV_INT_solid, SOLID_TRIGGER) entity_set_int(ent, EV_INT_movetype, MOVETYPE_FLY) entity_set_int(ent, EV_INT_rendermode, kRenderTransAdd) entity_set_float(ent, EV_FL_renderamt, 255.0) entity_set_float(ent, EV_FL_scale, 1.0) entity_set_edict(ent,EV_ENT_owner, id)
client_print(0, print_chat, "%d created portal (%d)", id, ent) Exit = true entity_get_vector(ent, EV_VEC_origin, fTeleportOrigin) FVecIVec(fTeleportOrigin, iTeleportOrigin) }
Description : You Bind 2 keys , one to create an entrance & the other to create an exit [ I've added +1Hp Every time you Get in the portal ] ..
1-i want That only 1 class Can use it , like if i block the Cmd For other classes , The Same thing with "Fly.amxx" of Velocity36 And "Grab_plus.amxx"
Would that be possible ? thank you
2-Ah , yes and , is it possible to attash a sprite on player ? And can we use some codes to spawn hostages near to you ?
Last edited by Zaidbt; 03-25-2015 at 16:38.
|
|