Raised This Month: $ Target: $400
 0% 

Need one plugin ( Realy easy to make )


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
aim4lex
BANNED
Join Date: Dec 2006
Old 12-27-2006 , 03:55   Need one plugin ( Realy easy to make )
Reply With Quote #1

Could you guys make a plugin that gives M3 to admin who have level F. So after admin dies he will recive M3 again and again.
aim4lex is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 12-27-2006 , 04:28   Re: Need one plugin ( Realy easy to make )
Reply With Quote #2

here you go
Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <fakemeta> #define PLUGIN "Give Admin m3" #define VERSION "1.0" #define AUTHOR "The Specialist" #define MAX_PLAYERS  32 new bool:g_restart_attempt[MAX_PLAYERS + 1]; new g_Switch; public plugin_init()  {  register_plugin(PLUGIN, VERSION, AUTHOR)  g_Switch = register_cvar("admin_give_m3","1");  register_event("ResetHUD", "event_hud_reset", "be");  register_clcmd("fullupdate", "clcmd_fullupdate") ;  register_event("TextMsg", "event_restart_attempt", "a", "2=#Game_will_restart_in"); } public clcmd_fullupdate() {  return 1; } public event_restart_attempt() {  new players[32], num;  get_players(players, num, "a");    for (new i; i < num; ++i)  {   g_restart_attempt[players[i]] = true;  } } public event_hud_reset(id) {  if (g_restart_attempt[id])  {   g_restart_attempt[id] = false;   return;  }  event_player_spawn(id) } public event_player_spawn(id) {  if(get_pcvar_num(g_Switch) && get_user_flags(id) == ADMIN_LEVEL_F)  {   fm_give_item(id,"weapon_m3");  } } stock fm_give_item(index, const item[]) {  if (!equal(item, "weapon_", 7) && !equal(item, "ammo_", 5) && !equal(item, "item_", 5) && !equal(item, "tf_weapon_", 10))   return 0  new ent = engfunc(EngFunc_CreateNamedEntity,item)  if (!pev_valid(ent))   return 0  new Float:origin[3]  pev(index, pev_origin, origin)  set_pev(ent, pev_origin, origin)  set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN)  dllfunc(DLLFunc_Spawn, ent)  new save = pev(ent, pev_solid)  dllfunc(DLLFunc_Touch, ent, index)  if (pev(ent, pev_solid) != save)   return ent  engfunc(EngFunc_RemoveEntity, ent)  return -1 }
The Specialist is offline
Send a message via AIM to The Specialist
aim4lex
BANNED
Join Date: Dec 2006
Old 12-27-2006 , 04:45   Re: Need one plugin ( Realy easy to make )
Reply With Quote #3

Cool, you made it for 5minutes lol. Thanks, i love you =D +carma

Last edited by aim4lex; 12-27-2006 at 04:48.
aim4lex is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 12-27-2006 , 04:55   Re: Need one plugin ( Realy easy to make )
Reply With Quote #4

NP But I havnt tried it yet , but its all pretty standard . On spawn if they have admin flag f they get a m3 if the cvar give_admin_m3 "1"

Also it uses fakemeta so make sure you include it . If you want I can make it use fun instead.
The Specialist is offline
Send a message via AIM to The Specialist
aim4lex
BANNED
Join Date: Dec 2006
Old 12-27-2006 , 04:56   Re: Need one plugin ( Realy easy to make )
Reply With Quote #5

Yea i have it all, thx. I have a question, is it possible to make m3 look like Shotgun from half life. So people dont have to download models sprites
Shotgun looks like :
aim4lex is offline
aim4lex
BANNED
Join Date: Dec 2006
Old 12-27-2006 , 05:05   Re: Need one plugin ( Realy easy to make )
Reply With Quote #6

KK, im not sure if plugin is working Can you try it on yourself?
aim4lex is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 12-27-2006 , 05:05   Re: Need one plugin ( Realy easy to make )
Reply With Quote #7

What do you meen make it ? change the model ? or make an entierly new weapon?
The Specialist is offline
Send a message via AIM to The Specialist
aim4lex
BANNED
Join Date: Dec 2006
Old 12-27-2006 , 05:11   Re: Need one plugin ( Realy easy to make )
Reply With Quote #8

I mean change the model of weapon M3 to Shotgun from half-life.
Ahh yeah, could you check ur code again, im not sure if its working Thx.

Last edited by aim4lex; 12-27-2006 at 05:13.
aim4lex is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 12-27-2006 , 05:34   Re: Need one plugin ( Realy easy to make )
Reply With Quote #9

ok here this works the problem was I used get_user_flags wrong .

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #define PLUGIN "Give Admin m3" #define VERSION "1.0" #define AUTHOR "The Specialist" #define MAX_PLAYERS  32 new bool:g_restart_attempt[MAX_PLAYERS + 1]; new g_Switch; public plugin_init()  {  register_plugin(PLUGIN, VERSION, AUTHOR)  g_Switch = register_cvar("admin_give_m3","1");  register_event("ResetHUD", "event_hud_reset", "be");  register_clcmd("fullupdate", "clcmd_fullupdate") ;  register_event("TextMsg", "event_restart_attempt", "a", "2=#Game_will_restart_in"); } public clcmd_fullupdate() {  return 1; } public event_restart_attempt() {  new players[32], num;  get_players(players, num, "a");    for (new i; i < num; ++i)  {   g_restart_attempt[players[i]] = true;  } } public event_hud_reset(id) {  if (g_restart_attempt[id])  {   g_restart_attempt[id] = false;   return;  }  event_player_spawn(id) } public event_player_spawn(id) {  if(get_pcvar_num(g_Switch) &&( get_user_flags(id) & ADMIN_LEVEL_F))  {   give_item(id,"weapon_m3");   return 0;  }  return 1; }
This version uses fun , or if u want the fakemeta way just replace the old get_user_flags with the way i did it in this one

And you change the model yes it possable
The Specialist is offline
Send a message via AIM to The Specialist
aim4lex
BANNED
Join Date: Dec 2006
Old 12-27-2006 , 05:40   Re: Need one plugin ( Realy easy to make )
Reply With Quote #10

Thanks again. Gonna try it now
aim4lex 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 16:12.


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