Raised This Month: $32 Target: $400
 8% 

how to save potision


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
gcz
Junior Member
Join Date: Feb 2016
Old 02-09-2017 , 07:16   how to save potision
Reply With Quote #1

i want to save chicken position to dir/*.txt and load dir/*.txt position origin

thank you ( i use google translate )

Code:
/* Plugin generated by AMXX-Studio */
  
#include <amxmodx>
#include <amxmisc>
#include <engine>
  
#define PLUGIN "[engine.inc] set_rendering"
#define VERSION "1.0"
#define AUTHOR "Admin"
  
new Ent
new g_Model[] = {"models/chick.mdl"}
  
public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_clcmd("say /rendoff","rendoff")
    register_clcmd("say /rendon","rendon")
    register_clcmd("say /chick","add_chicken")
      
}
public plugin_precache(){
    precache_model(g_Model)
}
public rendoff(id){    
 
     setrendering(id,kRenderFxNone,255,255,255,kRenderNormal,16)
     setrendering(Ent,kRenderFxNone,255,255,255,kRenderNormal,16)
}
public rendon(id){    
    setrendering( id,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,20)
    setrendering( Ent,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,20)
}
public add_chicken(id){
      
    Ent = create_entity("info_target")
      
    if(is_valid_ent(Ent)){
          
        entity_set_model(Ent, g_Model)
        entity_set_size(Ent,Float:{-6.0, -10.0, 0.0},Float:{6.0, 10.0, 18.0})
        new Float:f_Origin[3]
        entity_get_vector(id, EV_VEC_origin, f_Origin)    
        f_Origin[0] += 50.0
        entity_set_origin(Ent, f_Origin)        
        entity_set_int(Ent,EV_INT_solid,SOLID_BBOX)
          
        entity_set_float(Ent, EV_FL_takedamage, DAMAGE_YES)
          
        new Float:angles[3]
        angles[0] = 0.0
        angles[1] = 0.0
        angles[2] = 0.0
        entity_set_vector(Ent,EV_VEC_angles,angles)
          
        drop_to_floor(Ent)
    }
}

stock setrendering(index, fx=kRenderFxNone, r=255, g=0, b=0, render=kRenderNormal, amount=16)
{
    entity_set_int(index,EV_INT_renderfx,fx);
    new Float:RenderColor[3];
    RenderColor[0] = float(r);
    RenderColor[1] = float(g);
    RenderColor[2] = float(b);
    entity_set_vector(index,EV_VEC_rendercolor,RenderColor);
    entity_set_int(index,EV_INT_rendermode,render);
    entity_set_float(index,EV_FL_renderamt,float(amount));
 
    return 1;
}

Attached Images
File Type: jpg chick01.jpg (48.7 KB, 207 views)
File Type: jpg chick02.jpg (47.7 KB, 298 views)
gcz is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 02-09-2017 , 14:11   Re: how to save potision
Reply With Quote #2

Maybe installing minecraft would be easier than recreating it based on HL1 engine :p
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
gcz
Junior Member
Join Date: Feb 2016
Old 02-10-2017 , 14:25   Re: how to save potision
Reply With Quote #3

Quote:
Originally Posted by Neeeeeeeeeel.- View Post
Maybe installing minecraft would be easier than recreating it based on HL1 engine :p
Thank you for advice. I'll try to do.


gcz 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 00:14.


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