Nepasideda....
Posted: 2011 Jul 31 20:57
Sveiki. Kazko nesuprantu i faila iraso kordinates ,o mepe nera ju... +karma
Code: Select all
public spawn_pup(num){ num -= 50 ents[num] = engfunc(EngFunc_CreateNamedEntity,engfunc(EngFunc_AllocString,"info_target")) new Float:fGlowColors[3] = {150.0, 150.0, 150.0} entity_set_origin( ents[num], origins[num] ); entity_set_string(ents[num], EV_SZ_classname, "item_medkit"); entity_set_model(ents[num], "models/umbrella/etc/w_medkit.mdl"); entity_set_int(ents[num], EV_INT_solid, 2) entity_set_byte(ents[num], EV_BYTE_controller1, 125); entity_set_byte(ents[num], EV_BYTE_controller2, 125); entity_set_byte(ents[num], EV_BYTE_controller3, 125); entity_set_byte(ents[num], EV_BYTE_controller4, 125); entity_set_int(ents[num], EV_INT_renderfx, kRenderFxGlowShell) entity_set_vector(ents[num], EV_VEC_rendercolor, fGlowColors) entity_set_size(ents[num], Float:{-2.5, -2.5, -1.5}, Float:{2.5, 2.5, 1.5}) entity_set_float(ents[num], EV_FL_animtime, 2.0) entity_set_float(ents[num], EV_FL_framerate, 1.0) entity_set_int(ents[num], EV_INT_sequence, 0); drop_to_floor(ents[num]) } public logevent_round_end(id){ new iEnt = -1 while((iEnt = engfunc(EngFunc_FindEntityByString, iEnt, "classname", "item_medkit"))) { engfunc(EngFunc_RemoveEntity, iEnt) } g_medkit[id] = false;} public load_powerups(){ if(file_exists(configfile)) { new Fsize = file_size(configfile, 1) new input[64], trash new data[64], p_origin[3][8] for(new i = 0; i < Fsize; i++) { read_file(configfile, i, input, 63, trash) if(input[0] != ';' && count < MAX_MK && strlen(input) > 10) { parse(data, p_origin[0],7, p_origin[1],7, p_origin[2],7) origins[count][0] = str_to_float(p_origin[0]); origins[count][1] = str_to_float(p_origin[1]); origins[count][2] = str_to_float(p_origin[2]); /*strbreak(input, data, 20, input, 999); origins[count][0] = str_to_float(data); strbreak(input, data, 20, input, 999); origins[count][1] = str_to_float(data); strbreak(input, data, 20, input, 999); origins[count][2] = str_to_float(data);*/ line[count] = i count++ } } }} public cmd_medkit(id){ if(!(get_user_flags(id) & ADMIN_IMMUNITY)) return PLUGIN_HANDLED new menu = menu_create("\rVaistineliu Valdymo Pultas", "medkit_handler") menu_additem(menu, "\wPadeti Vaistinele \r(i savo stovima vieta)", "1") menu_additem(menu, "\wIstrinti Vaistinele \r(savo stovimoje vietoje)", "2") menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); menu_display(id, menu, 0); return PLUGIN_HANDLED} public medkit_handler(id, menu, item){ if( item == MENU_EXIT ) { menu_destroy(menu); return PLUGIN_HANDLED } new data[6], iName[64]; new access, callback; menu_item_getinfo(menu, item, access, data,5, iName, 63, callback); new key = str_to_num(data); switch(key) { case 1: { pev(id,pev_origin,origins[count]) new string[200] format(string,199,"%f %f %f",origins[count][0],origins[count][1],origins[count][2]) write_file(configfile,string) line[count] = file_size(configfile,1) - 2 print(id, "\g.::[MEDKIT]::. \tSekmingai sukurete vaistinele!") } case 2: { new bool:removed = false new Float:origin[3], classname[32] pev(id, pev_origin, origin) new ent = engfunc(EngFunc_FindEntityInSphere,get_maxplayers(),origin,100.0) while(ent) { for(new i=0;i<NUM_MK;i++) { if(equali(classname,"item_medkit")) { for(new j=0;j<count;j++) { if(ent==ents[j]) { print(id, "\g.::[MEDKIT]::. \tSekmingai pasalinote vaistinele!") write_file(configfile,"",line[j]) break; } } engfunc(EngFunc_RemoveEntity,ent) removed=true; break; } } ent = engfunc(EngFunc_FindEntityInSphere,ent,origin,100.0) } if(!removed) print(id, "\g.::[MEDKIT]::. \tAplink nera nei vienos vaistineles!") } } menu_destroy(menu) return PLUGIN_HANDLED}