Raised This Month: $ Target: $400
 0% 

Hello, new to writing fresh code.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 10-18-2006 , 09:27   Re: Hello, new to writing fresh code.
Reply With Quote #3

heres one that should work (compare the 2)
Code:
#include <amxmodx> //only include things your using #include <fun> #define MAX_PLAYERS 32 //we dont need to make id global new isonapill[33] public plugin_init() {         register_plugin("Adrenaline pills","0.0.0.0","Dean Booker AKA Ecko Mantle");         //register it as a console command so we can get the id properly         register_concmd("item_apill","item_apill",ADMIN_ALL)         //register it again for admins that want to set it to everyone         register_concmd("item_apill_all","item_apill_all",ADMIN_KICK) } public item_apill_all(id) {         for(new i=1; i<MAX_PLAYERS; i++) //there is a better way to get players, but im in a hurry         {              if(is_user_connected(i))                  item_apill(i)         } } public item_apill(id)//we get the id here {         if(isonapill[id] = 1 || 1>id>MAX_PLAYERS)//stop if it isnt a proper id (a different ent or the server console), note that MAX_PLAYERS is defined at the top         {                return PLUGIN_HANDLED         }         if(is_user_alive(id)) //can only set maxspeed on alive people               set_user_maxspeed(id,450.0)         client_cmd(id, "cl_forwardspeed 450.0")         client_cmd(id, "cl_sidespeed 450.0")         client_cmd(id, "cl_backspeed 450.0")         client_cmd(id, "say /me takes an Adrenaline Pill.")         client_cmd(id, print_chat, "[Umbrella] You take an Adrenaline Pill.")         set_task(30.0, "apill_end", id)//your passing the id         isonapill[id] = 1         return PLUGIN_HANDLED; } public apill_end(id)//we passed the id, so lets keep it {         if(is_user_alive(id)) //again only alive people              set_user_maxspeed(id, 350.0)         client_cmd(id, "cl_forwardspeed 350.0")         client_cmd(id, "cl_sidespeed 350.0")         client_cmd(id, "cl_backspeed 350.0")         isonapill[id] = 0         return PLUGIN_HANDLED }

Last edited by Emp`; 10-18-2006 at 20:15.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
 



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 04:51.


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