Raised This Month: $ Target: $400
 0% 

Upgrade Mod help plz


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 05-10-2006 , 19:18   Upgrade Mod help plz
Reply With Quote #1

NEED MEGA HELP!!..Look at my bottom help with native errors...
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Des12
Senior Member
Join Date: Jan 2005
Old 05-10-2006 , 20:10   Re: Upgrade Mod help :) (With menus :))
Reply With Quote #2

Quote:
Originally Posted by SweatyBanana
Code:
stTime = register_cvar("stuck_time", "5")     stAmount = register_cvar("stuck_amount", "1")     AnTime = register_cvar("anounce_time","45")
Wouldnt you want to use

Code:
 register_cvar("stuck_time", "5");     register_cvar("stuck_amount", "1");     register_cvar("anounce_time","45");    // later on...    stTime = get_cvar_num("stuck_time");     stAmount = get_cvar_num("stuck_amount");     AnTime = get_cvar_num("anounce_time");
__________________
-Dest Romano

www.JustRP.com
A TSRP Server

Quote:
Originally Posted by Brad
Don't you go be bringing reality into this.
Des12 is offline
FatalisDK
Senior Member
Join Date: Mar 2006
Location: bacon
Old 05-10-2006 , 20:42  
Reply With Quote #3

There is no need to do all those set_tasks. You can just do this:

Code:
case '1': {     cmd_stuck(id) } case '2': {     foot_steps(id) } //etc
__________________
FatalisDK is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 05-10-2006 , 21:46  
Reply With Quote #4

Look to bottom...
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 05-10-2006 , 22:20  
Reply With Quote #5

EDIT: NEW PROBLEM...NEXT POST
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 05-10-2006 , 22:40  
Reply With Quote #6

Ok...Im getting a native error in this function...It says its trying set the server solid instead of the player...how can I fix that??:

Code:
public unclip(id) {     entity_set_int(id, EV_INT_solid, SOLID_BBOX) }


anyone tell me what Im doing wrong??

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> #include <engine> #define PLUGIN "Upgrades Mod" #define VERSION "1.0" #define AUTHOR "SweatyBanana" new stuck[33]; new g_Menu public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_cvar("stuck_time", "5")     register_cvar("stuck_amount", "1")     register_cvar("anounce_time","30")         set_task(20.0,"advertise");         register_clcmd("say /upgrades", "Menu_Command")     register_clcmd("say_team /upgrades", "Menu_Command")             g_Menu = menu_create("Upgrade Mod", "Menu_Handle")       menu_additem(g_Menu, "Temporary Semi-Clip", "1")       menu_additem(g_Menu, "Silent footsteps", "2")       menu_additem(g_Menu, "Raise armor and Health", "3")       menu_additem(g_Menu, "Low Gravity", "4")       menu_additem(g_Menu, "Faster Speed", "5")       menu_additem(g_Menu, "reserved", "6")       menu_additem(g_Menu, "reserved", "7")         register_logevent("round_start", 2, "0=World triggered", "1=Round_Start"); } public Menu_Command(id) {     menu_display(id, g_Menu, 0)           return PLUGIN_HANDLED } public Menu_Handle(id, Menu, Item) {       new szCommand[3],  Accesss, Callback           menu_item_getinfo(Menu, Item, Accesss, szCommand, 2, _, _, Callback)           switch(szCommand[0])     {         case '-':         {             return PLUGIN_HANDLED         }                   case '1':         {             cmd_stuck(id)         }                   case '2':         {             foot_steps(id)         }                     case '3':         {             armor_hp(id)         }                   case '4':         {             gravity(id)         }                   case '5':         {             fast_speed(id)         }                   case '6':         {             foot_steps(id)         }                   case '7':         {             foot_steps(id)         }     }           return PLUGIN_HANDLED } public advertise() {     client_print(0,print_chat,"[UPGRADE] say /upgrades to show the upgrade menu.")     set_task(get_cvar_float("anounce_time"),"advertise")     return PLUGIN_HANDLED } public foot_steps(id) {     set_user_footsteps (id, 1) } public armor_hp(id) {     cs_set_user_armor (id, 200, CsArmorType:2)     set_user_health(id, 125) } public gravity(id) {     set_user_gravity (id, 0.25) } public fast_speed(id) {     new Float:speed = get_user_maxspeed(id) + 140.0;     set_user_maxspeed(id , speed); } public round_start() {     for(new id = 1; id <= 32; id++)        stuck[id] = 0; } public cmd_stuck(id) {     new Time = get_cvar_num("stuck_time");     new stuckamount = get_cvar_num("stuck_amount");         if(!is_user_alive(id))     {         client_print(id, print_chat, "[STUCK] you can only use the stuck option if you are alive!")         return PLUGIN_HANDLED;     }         if(stuck[id] >= stuckamount)     {         client_print(id , print_chat , "[AMXX] You can only do that command %i times a round", stuckamount);         return PLUGIN_HANDLED;     }         else     {         entity_set_int(id, EV_INT_solid, SOLID_TRIGGER)         stuck[id]++;         set_task(get_cvar_float("stuck_time"),"unclip")         client_print(id, print_chat, "[UPGRADE] You have %i second(s) until becoming solid again.", Time);     }     return PLUGIN_HANDLED; } public unclip(id) {     entity_set_int(id, EV_INT_solid, SOLID_BBOX) }
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 05-10-2006 , 22:55  
Reply With Quote #7

change
Code:
set_task(get_cvar_float("stuck_time"),"unclip")
to
Code:
set_task(get_cvar_float("stuck_time"),"unclip",id)
SubStream is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 05-10-2006 , 22:59  
Reply With Quote #8

Ill test it out...
Attached Files
File Type: sma Get Plugin or Get Source (upgrade_mod.sma - 671 views - 3.1 KB)
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 05-10-2006 , 22:59  
Reply With Quote #9

Hopefully that will fix the problem because that is necessary to set the task for that specific person.
SubStream is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 05-10-2006 , 23:27  
Reply With Quote #10

I hope this will work...Heres my almost final code...

Tell me if I did anything wrong..

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> #include <engine> #define PLUGIN "Upgrades Mod" #define VERSION "1.0" #define AUTHOR "SweatyBanana" new stuck[33]; new g_Menu public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_cvar("stuck_time", "5")     register_cvar("stuck_amount", "1")     register_cvar("anounce_time","30")     register_cvar("cost","7000")         set_task(20.0,"advertise");         register_clcmd("say /buymenu", "Menu_Command")     register_clcmd("say_team /buymenu", "Menu_Command")             g_Menu = menu_create("Upgrade Mod", "Menu_Handle")     menu_additem(g_Menu, "Temporary Semi-Clip", "1")     menu_additem(g_Menu, "Silent footsteps", "2")     menu_additem(g_Menu, "Raise armor and Health", "3")     menu_additem(g_Menu, "Low Gravity", "4")     menu_additem(g_Menu, "Faster Speed", "5")     menu_additem(g_Menu, "reserved", "6")     menu_additem(g_Menu, "reserved", "7")         register_logevent("round_start", 2, "0=World triggered", "1=Round_Start"); } public Menu_Command(id) {     menu_display(id, g_Menu, 0)           return PLUGIN_HANDLED } public Menu_Handle(id, Menu, Item) {       new szCommand[3],  Accesss, Callback           menu_item_getinfo(Menu, Item, Accesss, szCommand, 2, _, _, Callback)           switch(szCommand[0])     {         case '-':         {             return PLUGIN_HANDLED         }                   case '1':         {             cmd_stuck(id)         }                   case '2':         {             foot_steps(id)         }                     case '3':         {             armor_hp(id)         }                   case '4':         {             gravity(id)         }                   case '5':         {             fast_speed(id)         }                   case '6':         {             reserved(id)         }                   case '7':         {             reserved(id)         }     }           return PLUGIN_HANDLED } public advertise() {     client_print(0,print_chat,"[UM] say /buymenu to show the upgrade menu.")     set_task(get_cvar_float("anounce_time"),"advertise")     return PLUGIN_HANDLED } public foot_steps(id) {     if(cs_get_user_money(id) >= get_cvar_num("cost"))     {         set_user_footsteps (id, 1)     } } public armor_hp(id) {     if(cs_get_user_money(id) >= get_cvar_num("cost"))     {         cs_set_user_armor (id, 200, CsArmorType:2)         set_user_health(id, 125)     } } public gravity(id) {     if(cs_get_user_money(id) >= get_cvar_num("cost"))     {         set_user_gravity (id, 0.25)     } } public fast_speed(id) {     if(cs_get_user_money(id) >= get_cvar_num("cost"))     {         new Float:speed = get_user_maxspeed(id) + 140.0;         set_user_maxspeed(id , speed);     } } public round_start() {     for(new id = 1; id <= 32; id++)        stuck[id] = 0; } public cmd_stuck(id) {     new Time = get_cvar_num("stuck_time");     new stuckamount = get_cvar_num("stuck_amount");         if(!is_user_alive(id))     {         client_print(id, print_chat, "[UM] you can only use the stuck option if you are alive!")         return PLUGIN_HANDLED;     }         if(!(cs_get_user_money(id) >= get_cvar_num("cost")))     {         return PLUGIN_HANDLED;     }         if(stuck[id] >= stuckamount)     {         client_print(id , print_chat , "[UM] You can only do that command %i times a round", stuckamount);         return PLUGIN_HANDLED;     }         else     {         entity_set_int(id, EV_INT_solid, SOLID_TRIGGER)         stuck[id]++;         set_task(get_cvar_float("stuck_time"),"unclip",id)         client_print(id, print_chat, "[UM] You have %i second(s) until becoming solid again.", Time);     }     return PLUGIN_HANDLED; } public unclip(id) {     entity_set_int(id, EV_INT_solid, SOLID_BBOX) } public reserved(id) {     client_print(id, print_chat, "[UM] There is nothing currently in this slot") }
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
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 04:59.


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