It is currently 24 May 2018 07:26



Forum rules


Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .



Reply to topic  [ 17 posts ]  Go to page Previous  1, 2
 Plugin random respawn? 
Author Message
Membru, skill 0
Membru, skill 0

Joined: 05 Dec 2014 21:56
Posts: 98
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Multumesc, revin cu edit


12 Feb 2018 21:46
Profile multumesc WWW
Membru, skill 0
Membru, skill 0

Joined: 05 Dec 2014 21:56
Posts: 98
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Nu e exact ceea ce voiam, pluginul alege un player de la inceputul rundei si il anunta ca primeste respawn dupa ce trece 60 de secunde... normal faza cu ‘ai fost ales random sa primesti respawn’ de la inceputul rundei nu trebuie sa fie acolo. Eu doresc ca dupa 60 de secunde sa se aleaga 2 playeri morti sa primeasca respawn, nu ca si acuma... playerul ce primeste respawn e ales la inceput de runda.. si daca nu moare runda in care e ales runda viitoare e ales iara sa primeasca respawn..


14 Feb 2018 09:42
Profile multumesc WWW
Fost moderator
Fost moderator
User avatar

Joined: 08 Nov 2013 21:43
Posts: 3410
Detinator Steam: Da
CS Status: Activitate scăzută
SteamID: /id/FurienMaster
Reputatie: Nick anterior: DnD. Gold, Emrys
0.5/3
Fost moderator ajutator
Fost Membru Club eXtreamCS (doua luni)
Fond eXtream: 0
? | Afiseaza codul
#include <amxmodx>
#include <hamsandwich>

#define PLUGIN "RANDOM RESPAWN"
#define VERSION "2.0"
#define AUTHOR "DaNNe./YONTU"

#define TASKID_RESPAWN 10000

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)

register_event("HLTV", "EVENT_NewRound", "a", "1=0", "2=0");
}

public EVENT_NewRound()
set_task(float(get_cvar_num("mp_freezetime")) + 60.0, "TASK_CHECK", TASKID_RESPAWN)

public TASK_CHECK() {
new Players[32], Terrorist, CounterTerrorist, RandomT, RandomCT
get_players(Players, Terrorist, "be", "TERRORIST")
get_players(Players, CounterTerrorist, "be", "CT")
RandomT = Players[random(Terrorist)]
RandomCT = Players[random(CounterTerrorist)]
set_task(0.2, "TASK_RESPAWN", RandomT)
set_task(0.2, "TASK_RESPAWN", RandomCT)
remove_task(TASKID_RESPAWN)
}

public TASK_RESPAWN(id) {
if(is_user_connected(id) && !is_user_alive(id)) {
ExecuteHamB(Ham_CS_RoundRespawn, id)
new Name[32]
get_user_name(id, Name, charsmax(Name))
client_print(0, print_chat, "[RANDOM RESPAWN] - %s a primit RESPAWN ca a fost ales din echipa(%s)", Name, get_user_team(id) == 1 ? "T" : "CT")
}
remove_task(TASKID_RESPAWN)
}

_________________
Contact:

Activitate scazuta.


14 Feb 2018 15:28
Profile multumesc WWW
Moderator ajutator
Moderator ajutator
User avatar

Joined: 10 May 2013 14:25
Posts: 2793
Location: Gura Humorului, Suceava
Detinator Steam: Nu
Reputatie: Moderator ajutator
Fost scripter eXtreamCS
Fond eXtream: 0
DaNNe. wrote:
? | Afiseaza codul
#include <amxmodx>
#include <hamsandwich>

#define PLUGIN "RANDOM RESPAWN"
#define VERSION "2.0"
#define AUTHOR "DaNNe./YONTU"

#define TASKID_RESPAWN 10000

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)

register_event("HLTV", "EVENT_NewRound", "a", "1=0", "2=0");
}

public EVENT_NewRound()
set_task(float(get_cvar_num("mp_freezetime")) + 60.0, "TASK_CHECK", TASKID_RESPAWN)

public TASK_CHECK() {
new Players[32], Terrorist, CounterTerrorist, RandomT, RandomCT
get_players(Players, Terrorist, "be", "TERRORIST")
get_players(Players, CounterTerrorist, "be", "CT")
RandomT = Players[random(Terrorist)]
RandomCT = Players[random(CounterTerrorist)]
set_task(0.2, "TASK_RESPAWN", RandomT)
set_task(0.2, "TASK_RESPAWN", RandomCT)
remove_task(TASKID_RESPAWN)
}

public TASK_RESPAWN(id) {
if(is_user_connected(id) && !is_user_alive(id)) {
ExecuteHamB(Ham_CS_RoundRespawn, id)
new Name[32]
get_user_name(id, Name, charsmax(Name))
client_print(0, print_chat, "[RANDOM RESPAWN] - %s a primit RESPAWN ca a fost ales din echipa(%s)", Name, get_user_team(id) == 1 ? "T" : "CT")
}
remove_task(TASKID_RESPAWN)
}

Tu practic nu retii corect indexul jucatorilor, daca ai 5 intr o echipa si 4 in cealalta, ar fi 9 jucatori, fiecare fiind unic datorita indexului. Pe tine asta te interesează. Tu alegi random odata de la 0 la Terrorist si apoi de la 0 la CounterTerrorist. Sansele sunt f mari ca sa nimeresti 2 jucatori din aceeasi echipa. Am testat pluginul pe care l ai postat prima data si nu a mers

EDIT:
testat | Afiseaza codul
#include <amxmodx>
#include <hamsandwich>

new const PLUGIN_NAME[] = "Random Respawn",
PLUGIN_VERSION[] = "1.0",
PLUGIN_AUTHOR[] = "YONTU & DaNNe.";

new RandomTerrorist = -1, RandomCTerrorist = -1;

#define RESPAWN_AFTER 30 // dupa cate secunde va fi respawnat cel ales

public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
register_event("HLTV", "EVENT_NewRound", "a", "1=0", "2=0");
}

public EVENT_NewRound()
{
set_task(float(RESPAWN_AFTER), "enablerespawn");
}

public enablerespawn()
{
new Players[32], num;
get_players(Players, num, "b"); // fara jucatori in viata

new teamt[16], teamct[16];
arrayset(teamt, 0, 16);
arrayset(teamct, 0, 16);

new tero = 0, ct = 0, id, player;
for(id = 0; id < num; id++)
{
// retinem indexul fiecarui jucator in functie de echipa lui
player = Players[id];
if(get_user_team(player) == 1)
teamt[tero++] = player;
else if(get_user_team(player) == 2)
teamct[ct++] = player;
}

new namet[32], namect[32];
if(tero != 0)
{
RandomTerrorist = teamt[random_num(0, tero-1)];
set_task(0.3, "TASK_Respawn", RandomTerrorist);
get_user_name(RandomTerrorist, namet, 31);
}

if(ct != 0)
{
RandomCTerrorist = teamct[random_num(0, ct-1)];
set_task(0.3, "TASK_Respawn", RandomCTerrorist);
get_user_name(RandomCTerrorist, namect, 31);
}

if(tero != 0 && ct != 0)
client_print(0, print_chat, "[RESPAWN] %s(T) si %s(CT) au fost alesi sa primeasca respawn. ENJOY!.", namet, namect);
}

public TASK_Respawn(id)
{
if(!is_user_alive(id))
{
ExecuteHamB(Ham_CS_RoundRespawn, id);

if(id == RandomTerrorist) RandomTerrorist = -1;
else if(id == RandomCTerrorist) RandomCTerrorist = -1;
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/


Deci fii atent, reciteste-ti posturile tale din topicul asta si o sa vezi ca te-ai contrazis in vorbe.
Acum sa iti explic de face pluginul de mai sus. Alege dupa un interval de X secunde 2 jucatori random, unul de la CT si celalalt de la T, acestia fiind deja morti, si le da respawn, apoi anunta printr-un mesaj in chat, tuturor jucatorilor ca XX si YY au reinviat. Sper ca asta este ceea ce vrei ca nu mai inteleg..

_________________
„Peste douăzeci de ani vei fi dezamăgit din cauza lucrurilor pe care nu le-ai făcut, nu din cauza celor pe care le-ai făcut.” - Mark Twain
„Asa e si in viata, hotii castiga, prostii care invata pierd.” - Mihai Nemeș

Pluginurile mele publice | Afiseaza codul
Control HE Damage(s)
[Zombie mod] Liderul oamenilor
NO RUSH (MANUAL)
Salvatorul Craciunului
Harry Potter's Magic Wand [0.0.3]
New HE Grenade Effects
Upgrades Menu -> Health/Armor/Damage

Serverele care au achizitonat pluginurile mele: #1 #2

CONTACT: sef_yontu@yahoo.com | skype: cyp_yontu
Creez pluginuri contra cost! PM ME!

[AMXX] LEVEL MOD PUBLIC [In faza de testare]


14 Feb 2018 15:53
Profile multumesc YIM WWW
Membru, skill 0
Membru, skill 0

Joined: 05 Dec 2014 21:56
Posts: 98
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Saru' mana, atat voiam. +multam. merge perfect.


14 Feb 2018 21:28
Profile multumesc WWW
Display posts from previous:  Sort by  
Reply to topic   [ 17 posts ]  Go to page Previous  1, 2

Who is online

Users browsing this forum: Google [Bot] and 49 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  

În cazul în care aveți probleme cu contul trimiteți un email sau mesaj la servicii_extream[arond]yahoo[punct]com

Powered by phpBB® Forum Software © phpBB Group