AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   amx parachute (https://forums.alliedmods.net/showthread.php?t=11535)

nightscreem 03-22-2005 09:32

amx parachute
 
i ported this but it gave no errors at compiling but when i buy a parachute and wanna use it it doens't work
Code:
#include <amxmodx> #include <amxmisc> #include <engine> #include <cstrike> new bool:has_parachute[33] new para_ent[33] public plugin_init() {     register_plugin("AMX Parachute", "0.1.1", "KRoT@L")     register_concmd("say buy_parachute", "buy_parachute")     register_cvar("parachute_cost", "2000") } public plugin_precache() {     precache_model("models/parachute.mdl") } public client_connect(id) {     has_parachute[id] = false     para_ent[id] = 0 } public buy_parachute(id) {     if(has_parachute[id])     {         client_print(id, print_chat, "[AMXX] You already have a parachute.")         return PLUGIN_HANDLED           }     new money = cs_get_user_money(id)     new cost = get_cvar_num("parachute_cost")     if(money < cost)     {         client_print(id, print_chat, "[AMXX] You don't have enough money ($%i needed).", cost)         return PLUGIN_CONTINUE     }     cs_set_user_money(id, money - cost)     client_print(id, print_chat, "[AMXX] You have bought a parachute. To use it, press +use while falling.")     has_parachute[id] = true     return PLUGIN_CONTINUE } public client_prethink(id) {     if(!is_user_alive(id))     {         return PLUGIN_CONTINUE     }     if(has_parachute[id] || get_user_flags(id) & ADMIN_LEVEL_A)     {         if(get_user_button(id) & IN_USE)         {             if(!(get_user_oldbutton(id) & IN_USE))             {                 para_ent[id] = create_entity("info_target")                 if(para_ent[id] > 0)                 {                     entity_set_model(para_ent[id], "models/parachute.mdl")                 }             }             if(!(get_entity_flags(id) & FL_ONGROUND))             {                 new Float:velocity[3]                 entity_get_vector(id, EV_VEC_velocity, velocity)                 if(velocity[2] < 0)                 {                     velocity[2] = (velocity[2] + 40.0 < -100) ? velocity[2] + 40.0 : -100.0                     entity_set_vector(id, EV_VEC_velocity, velocity)                     if(para_ent[id] > 0)                     {                         if(entity_get_float(para_ent[id], EV_FL_frame) < 0.0 || entity_get_float(para_ent[id], EV_FL_frame) > 254)                         {                             if(entity_get_int(para_ent[id], EV_INT_sequence) == 0)                             {                                 entity_set_int(para_ent[id], EV_INT_sequence, 1)                             }                             entity_set_float(para_ent[id], EV_FL_frame, 0.0)                         }                         else                         {                             entity_set_float(para_ent[id], EV_FL_frame, entity_get_float(para_ent[id], EV_FL_frame) + 1.0)                         }                         new Float:origin[3]                         entity_get_vector(id, EV_VEC_origin, origin)                         origin[2] -= 46.0                         entity_set_vector(para_ent[id], EV_VEC_origin, origin)                     }                 }                 else                 {                     if(para_ent[id] > 0)                     {                         remove_entity(para_ent[id])                         para_ent[id] = 0                     }                 }             }             else             {                 if(para_ent[id] > 0)                 {                     remove_entity(para_ent[id])                     para_ent[id] = 0                 }             }         }         else         {             if(para_ent[id] > 0)             {                 remove_entity(para_ent[id])                 para_ent[id] = 0             }         }     }         return PLUGIN_CONTINUE }
and help me here http://forums.alliedmods.net/showthread.php?t=11408

XxAvalanchexX 03-22-2005 16:58

client_prethink is now client_PreThink.

nightscreem 03-22-2005 17:28

thx you own man :D :D

|2eM!x 03-22-2005 21:42

caps locks matter in this dang thing?

v3x 03-22-2005 21:46

Quote:

Originally Posted by |2eM!x
caps locks matter in this dang thing?

Yea, I guess it's cAsE-sEnSiTiVe. :D

XxAvalanchexX 03-22-2005 22:45

I probably would've have even noticed it if someone hadn't already told you why in the topic for the plugin itself. Go thank him, not me.

nightscreem 04-08-2005 07:17

ok but how can i change it that if you die you have to buy a new one

LynX 04-08-2005 11:14

if_is_user_alive and has_parachute[id]=false


All times are GMT -4. The time now is 09:52.

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