Witamy w Nieoficjalnym polskim support'cie AMX Mod X
Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
|
Funkcja - 50% na odrodzenie dla CT.
#1
Napisano 28.08.2011 09:08
#2
Napisano 28.08.2011 10:03
#include <amxmodx>
#include <cstrike>
#include <fun>
public plugin_init() {
register_event("DeathMsg","func_death","a")
}
public func_death()
{
new id = read_data(2)
if ( cs_get_user_team(id) == CS_TEAM_CT )
{
switch(random_num(1,2))
{
case 1:
{
spawn(id)
}
case 2:
{
return PLUGIN_HANDLED
}
}
}
return PLUGIN_HANDLED
}
Lub tak :
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
public plugin_init() {
register_event("DeathMsg","func_death","a")
}
public func_death()
{
new id = read_data(2)
if ( cs_get_user_team(id) == CS_TEAM_CT )
{
switch(random_num(1,2))
{
case 1:
{
ExecuteHamB(Ham_CS_RoundRespawn, id)
}
case 2:
{
return PLUGIN_HANDLED
}
}
}
return PLUGIN_HANDLED
}
Użytkownik speedkill123 edytował ten post 28.08.2011 10:05
If you can dream it, you can do it.
#3
Napisano 28.08.2011 10:10
ExecuteHamB( Ham_CS_RoundRespawn, id );
#4
Napisano 28.08.2011 10:13
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
public plugin_init(){
register_plugin("Odrodzenie", "0.1", "Skull3D");
register_event("DeathMsg", "eventDeath", "a");
}
public eventDeath(){
new ofiara = read_data(2);
if(cs_get_user_team(ofiara) == CS_TEAM_CT ){
switch(random_num(0,100)){
case 0..50:{
ExecuteHamB(Ham_CS_RoundRespawn, ofiara);
}
case 51..100:{ return 1;
}
}
}
return 1;
}
#5
Napisano 28.08.2011 10:34
Kompilacja przebiegła bez błędu, ale plugin nie działa ;<
Logi:
L 08/28/2011 - 11:29:34: [AMXX] Run time error 10 (plugin "vip.amxx") (native "cs_get_user_team") - debug not enabled! L 08/28/2011 - 11:29:34: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).Plugin:
Mógłbym prosić o poprawienie?
#6
Napisano 28.08.2011 10:45
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <engine>
#include <cstrike>
#include <hamsandwich>
#define PLUGIN "VIP"
#define VERSION "1.0"
#define AUTHOR "xxx"
new player_b_jumpx[33]
new jumps[33]
new bool:dojump[33]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_logevent("RoundStart", 2, "0=World triggered", "1=Round_Start");
register_event("ResetHUD", "resetModel", "b");
register_event("DeathMsg", "eventDeath", "a");
return PLUGIN_CONTINUE
}
public client_PreThink ( id )
{
if ( get_user_flags(id) & ADMIN_LEVEL_H && is_user_alive(id))
{
set_user_footsteps(id, 1)
Prethink_Doublejump(id)
}
}
public Prethink_Doublejump(id)
{
if(!is_user_alive(id))
return PLUGIN_HANDLED
if((get_user_button(id) & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(get_user_oldbutton(id) & IN_JUMP))
{
if(jumps[id] < player_b_jumpx[id])
{
dojump[id] = true
jumps[id]++
return PLUGIN_HANDLED
}
}
if((get_user_button(id) & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
{
jumps[id] = 0
return PLUGIN_CONTINUE
}
return PLUGIN_HANDLED
}
public client_PostThink( id )
{
if (player_b_jumpx[id] > 0) Postthink_Doubeljump(id)
}
public Postthink_Doubeljump(id)
{
if(!is_user_alive(id))
return PLUGIN_HANDLED
if(dojump[id] == true)
{
new Float:velocity[3]
entity_get_vector(id,EV_VEC_velocity,velocity)
velocity[2] = random_float(265.0,285.0)
entity_set_vector(id,EV_VEC_velocity,velocity)
dojump[id] = false
return PLUGIN_CONTINUE
}
return PLUGIN_HANDLED
}
public RoundStart()
{
for (new i=0; i < 33; i++)
{
if (get_user_flags(i) & ADMIN_LEVEL_H)
{
if(cs_get_user_team(i) == CS_TEAM_CT)
{
give_item(i, "weapon_elite")
give_item(i,"ammo_9mm")
give_item(i,"ammo_9mm")
give_item(i,"ammo_9mm")
give_item(i,"ammo_9mm")
set_user_health (i, 120)
}
if(cs_get_user_team(i) == CS_TEAM_T)
{
give_item(i, "weapon_hegrenade")
give_item(i, "weapon_flashbang")
set_user_health (i, 155)
set_user_armor (i, 100)
}
}
}
}
public eventDeath(){
new ofiara = read_data(2);
if(get_user_team(ofiara) == 2){
switch(random_num(0,100)){
case 0..50:{
ExecuteHamB(Ham_CS_RoundRespawn, ofiara);
}
case 51..100:{ return 1;
}
}
}
return 1;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1045\\ f0\\ fs16 \n\\ par }
*/
albo
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <engine>
#include <cstrike>
#include <hamsandwich>
#define PLUGIN "VIP"
#define VERSION "1.0"
#define AUTHOR "xxx"
new player_b_jumpx[33]
new jumps[33]
new bool:dojump[33]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_logevent("RoundStart", 2, "0=World triggered", "1=Round_Start");
register_event("ResetHUD", "resetModel", "b");
register_event("DeathMsg", "eventDeath", "a");
return PLUGIN_CONTINUE
}
public client_PreThink ( id )
{
if ( get_user_flags(id) & ADMIN_LEVEL_H && is_user_alive(id))
{
set_user_footsteps(id, 1)
Prethink_Doublejump(id)
}
}
public Prethink_Doublejump(id)
{
if(!is_user_alive(id))
return PLUGIN_HANDLED
if((get_user_button(id) & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(get_user_oldbutton(id) & IN_JUMP))
{
if(jumps[id] < player_b_jumpx[id])
{
dojump[id] = true
jumps[id]++
return PLUGIN_HANDLED
}
}
if((get_user_button(id) & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
{
jumps[id] = 0
return PLUGIN_CONTINUE
}
return PLUGIN_HANDLED
}
public client_PostThink( id )
{
if (player_b_jumpx[id] > 0) Postthink_Doubeljump(id)
}
public Postthink_Doubeljump(id)
{
if(!is_user_alive(id))
return PLUGIN_HANDLED
if(dojump[id] == true)
{
new Float:velocity[3]
entity_get_vector(id,EV_VEC_velocity,velocity)
velocity[2] = random_float(265.0,285.0)
entity_set_vector(id,EV_VEC_velocity,velocity)
dojump[id] = false
return PLUGIN_CONTINUE
}
return PLUGIN_HANDLED
}
public RoundStart()
{
for (new i=0; i < 33; i++)
{
if (get_user_flags(i) & ADMIN_LEVEL_H)
{
if(cs_get_user_team(i) == CS_TEAM_CT)
{
give_item(i, "weapon_elite")
give_item(i,"ammo_9mm")
give_item(i,"ammo_9mm")
give_item(i,"ammo_9mm")
give_item(i,"ammo_9mm")
set_user_health (i, 120)
}
if(cs_get_user_team(i) == CS_TEAM_T)
{
give_item(i, "weapon_hegrenade")
give_item(i, "weapon_flashbang")
set_user_health (i, 155)
set_user_armor (i, 100)
}
}
}
}
public eventDeath(){
new ofiara = read_data(2);
for (new i=0; i < 33; i++)
{
if(cs_get_user_team(i) == CS_TEAM_CT)
switch(random_num(0,100)){
case 0..50:{
set_task(1.5,"na_respa",ofiara)
}
case 51..100:{ return 1;
}
}
}
return 1;
}
public na_respa()
ExecuteHamB(Ham_CS_RoundRespawn, ofiara);
ja polecam 2
Użytkownik Skull3D edytował ten post 28.08.2011 10:52
#7
Napisano 28.08.2011 10:48
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <engine>
#include <cstrike>
#include <hamsandwich>
#define PLUGIN "VIP"
#define VERSION "1.0"
#define AUTHOR "xxx"
new player_b_jumpx[33]
new jumps[33]
new bool:dojump[33]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
RegisterHam(Ham_Spawn, "player", "Fwd_PlayerSpawn_Post", 1);
register_event("ResetHUD", "resetModel", "b");
register_event("DeathMsg", "eventDeath", "a");
return PLUGIN_CONTINUE
}
public client_PreThink ( id )
{
if ( get_user_flags(id) & ADMIN_LEVEL_H && is_user_alive(id))
{
set_user_footsteps(id, 1)
Prethink_Doublejump(id)
}
}
public Prethink_Doublejump(id)
{
if(!is_user_alive(id))
return PLUGIN_HANDLED
if((get_user_button(id) & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(get_user_oldbutton(id) & IN_JUMP))
{
if(jumps[id] < player_b_jumpx[id])
{
dojump[id] = true
jumps[id]++
return PLUGIN_HANDLED
}
}
if((get_user_button(id) & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
{
jumps[id] = 0
return PLUGIN_CONTINUE
}
return PLUGIN_HANDLED
}
public client_PostThink( id )
{
if (player_b_jumpx[id] > 0) Postthink_Doubeljump(id)
}
public Postthink_Doubeljump(id)
{
if(!is_user_alive(id))
return PLUGIN_HANDLED
if(dojump[id] == true)
{
new Float:velocity[3]
entity_get_vector(id,EV_VEC_velocity,velocity)
velocity[2] = random_float(265.0,285.0)
entity_set_vector(id,EV_VEC_velocity,velocity)
dojump[id] = false
return PLUGIN_CONTINUE
}
return PLUGIN_HANDLED
}
public Fwd_PlayerSpawn_Post(id)
{
if (get_user_flags(id) & ADMIN_LEVEL_H)
{
if(cs_get_user_team(id) == CS_TEAM_CT)
{
give_item(id, "weapon_elite")
give_item(id,"ammo_9mm")
give_item(id,"ammo_9mm")
give_item(id,"ammo_9mm")
give_item(id,"ammo_9mm")
set_user_health (id, 120)
}
if(cs_get_user_team(id) == CS_TEAM_T)
{
give_item(id, "weapon_hegrenade")
give_item(id, "weapon_flashbang")
set_user_health (id, 155)
set_user_armor (id, 100)
}
}
}
public eventDeath(){
new ofiara = read_data(2);
if(cs_get_user_team(ofiara) == CS_TEAM_CT ){
switch(random_num(0,100)){
case 0..50:{
ExecuteHamB(Ham_CS_RoundRespawn, ofiara);
}
case 51..100:{ return 1;
}
}
}
return 1;
}
#8
Napisano 28.08.2011 10:50
#9
Napisano 28.08.2011 10:56
Dopisz debug w plugins.ini za pluginem z vipem, np. vip.amxx debug.
I nie wiem czy wiecie, ale random_num(0,100) losuje liczby od 0 do 100 - co daje łącznie 101 liczb do wylosowania... Więc nie jest to równe 50%.
Po drugie: po co losować od 0 do 100 skoro można losować pomiędzy 0 i 1 i to da ten sam efekt?
Ewentualnie spróbuj takiego DeathMSG: http://amxx.pl/wklej...31452532811795/
#10
Napisano 28.08.2011 10:59
Prosiłbym też odrodzenie 3 sekundy po śmierci.
Użytkownik AX!S edytował ten post 28.08.2011 11:00
#11
Napisano 28.08.2011 11:27
public eventDeath() {
new ofiara = read_data(2);
if(cs_get_user_team(ofiara) == CS_TEAM_CT && random(100) < 50)
set_task(3.0, "odrodzenie", ofiara);
}
public odrodzenie(id)
ExecuteHamB(Ham_CS_RoundRespawn, id);
Posiadam TBM (inaczej PTB), które działa dużo lepiej niż zwykłe PTB, nawet na modach z lvlami. Zainteresowany? Proszę bardzo
#12
Napisano 28.08.2011 12:33
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <engine>
#include <cstrike>
#include <hamsandwich>
#define PLUGIN "VIP"
#define VERSION "1.0"
#define AUTHOR "xxx"
new bool:dojump[33]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
RegisterHam(Ham_Spawn, "player", "Fwd_PlayerSpawn_Post", 1);
register_event("ResetHUD", "resetModel", "b");
register_event("DeathMsg", "eventDeath", "a");
return PLUGIN_CONTINUE
}
public Fwd_PlayerSpawn_Post(id)
{
if (get_user_flags(id) & ADMIN_LEVEL_H)
{
if(cs_get_user_team(id) == CS_TEAM_CT)
{
give_item(id, "weapon_elite")
give_item(id,"ammo_9mm")
give_item(id,"ammo_9mm")
give_item(id,"ammo_9mm")
give_item(id,"ammo_9mm")
set_user_health (id, 120)
}
if(cs_get_user_team(id) == CS_TEAM_T)
{
give_item(id, "weapon_hegrenade")
give_item(id, "weapon_flashbang")
set_user_health (id, 155)
set_user_armor (id, 100)
}
}
}
public eventDeath() {
new ofiara = read_data(2);
if(cs_get_user_team(ofiara) == CS_TEAM_CT)
{
set_task(3.0, "odrodzenie", ofiara);
client_print(id, print_chat, "Odrodzisz sie za 3 sekundy!");
}
}
public odrodzenie(id)
ExecuteHamB(Ham_CS_RoundRespawn, id);Czemu nie chce skompilować?
#13
Napisano 28.08.2011 12:34
public eventDeath() {
new ofiara = read_data(2);
if(cs_get_user_team(ofiara) == CS_TEAM_CT) {
set_task(3.0, "odrodzenie", ofiara);
client_print(ofiara, print_chat, "Odrodzisz sie za 3 sekundy!");
}
}
Posiadam TBM (inaczej PTB), które działa dużo lepiej niż zwykłe PTB, nawet na modach z lvlami. Zainteresowany? Proszę bardzo
#14
Napisano 28.08.2011 12:59
k**wa!
#15
Napisano 28.08.2011 13:20
Posiadam TBM (inaczej PTB), które działa dużo lepiej niż zwykłe PTB, nawet na modach z lvlami. Zainteresowany? Proszę bardzo
#16
Napisano 28.08.2011 13:35
Było "runtime error"
Użytkownicy przeglądający ten temat: 0
0 użytkowników, 0 gości, 0 anonimowych


Dodatki SourceMod



Temat jest zamknięty









