It is currently 14 Aug 2018 19:04



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  [ 18 posts ]  Go to page Previous  1, 2
 Plugin sistem puncte 
Author Message
Membru, skill +1
Membru, skill +1

Joined: 02 Aug 2015 15:12
Posts: 145
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Iti dau sistemul de points privat ca eu nu reusesc sa-l pun..


24 Jul 2018 14:37
Profile multumesc WWW
Membru, skill +1
Membru, skill +1

Joined: 02 Aug 2015 15:12
Posts: 145
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Nu s-a rezolvat...altcineva?


29 Jul 2018 11:33
Profile multumesc WWW
Moderator ajutator
Moderator ajutator
User avatar

Joined: 10 May 2013 14:25
Posts: 2817
Location: Gura Humorului, Suceava
Detinator Steam: Nu
Reputatie: Moderator ajutator
Fost scripter eXtreamCS
Fond eXtream: 0
Ia vezi asa
| Afiseaza codul
// Includes
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <fun>
#include <csx>
#include <nvault>


// Register Plugin
new const PLUGIN_NAME[] = "Points System",
PLUGIN_VERSION[] = "3.0",
PLUGIN_AUTHOR[] = "YONTU";


//new const PLUGIN_UPDATE[] = "13.02.2018";

#define is_user_valid(%1) (1 <= %1 <= 32)

#define is_user_vip(%1) (get_user_flags(%1) & read_flags("t")) // flag VIP (vip-ul face x2 puncte)

new const Tag[] = "[Level System]";

new points_jucator[33], nume_jucator[33][32], bool:este_inviata[33], bool:este_conectat[33], g_Vault;

enum _data_cvars
{
cvarname[32],
cvarvalue[5],
cvardesc[512]
}

enum _:cvars
{
points_kill = 0,
points_hs,
points_kill_knife,
points_hs_knife,
points_he,
points_plant_bmb,
points_defuse_bmb,
points_epointslode_bmb,
points_tk
}
new cvar[cvars], cvar_cache[cvars];

new const data_cvars[][_data_cvars] =
{
//nume cvar + valore + descriere cvar
{"points_kill", "10", "Punctele obtinute pe kill:"},
{"points_hs", "25", "Punctele obtinute pe headshot:"},
{"points_kill_knife", "30", "Punctele obtinute pe kill facut cu cutitul:"},
{"points_hs_knife", "40", "Punctele obtinute pe headshot facut cu cutitul:"},
{"points_he", "30", "Punctele obtinute pe kill facut cu grenada:"},
{"points_plant_bmb", "10", "Punctele obtinute plantand bomba:"},
{"points_defuse_bmb", "15", "Punctele obtinute dezamorsand bomba:"},
{"points_epointslode_bmb", "20", "Punctele obtinute datorita epointsloziei bombei:"},
{"points_teamkiller", "5", "Cate puncte pierzi cand omori un coechipier:"}
}

public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
register_cvar("level_mod_", PLUGIN_VERSION, FCVAR_SPONLY|FCVAR_SERVER);
set_cvar_string("level_mod_", PLUGIN_VERSION);

new i;
for(i = 0; i < sizeof data_cvars; i++)
cvar[i] = register_cvar(data_cvars[i][cvarname], data_cvars[i][cvarvalue]);

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

RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn", 1);

register_clcmd("say /puncte", "ClShowpoints");
register_clcmd("say_team /puncte", "ClShowpoints");

g_Vault = nvault_open("_level_mod_");
if(g_Vault == INVALID_HANDLE)
set_fail_state("Eroare la deschiderea bazei de date din foldeurul data/vault.");
}

public plugin_end()
{
nvault_close(g_Vault);
}

public plugin_cfg()
{
new i;
for(i = 0; i < sizeof data_cvars; i++)
cvar_cache[i] = get_pcvar_num(cvar[i]);
}

public plugin_natives()
{
// Player specific natives
register_native("get_user_points", "native_get_user_points", 1);
}

public native_get_user_points(id)
{
if(!is_user_valid(id))
{
log_error(AMX_ERR_NATIVE, "%s: Invalid Player (%d).", PLUGIN_NAME, id);
return false;
}

return points_jucator[id];
}

public client_putinserver(id)
{
get_user_name(id, nume_jucator[id], 31);
points_jucator[id] = 0;
este_conectat[id] = true;
este_inviata[id] = false;
LoadUserEpointserienta(id);
}

public client_disconnect(id)
{
este_conectat[id] = false;
este_inviata[id] = false;
SaveUserEpointserienta(id);
}

public fw_PlayerSpawn(id)
{
if(!is_user_alive(id))
return HAM_IGNORED;

este_inviata[id] = true;
return HAM_IGNORED;
}

public event_NewRound()
{
new i;
for(i = 0; i < sizeof data_cvars; i++)
cvar_cache[i] = get_pcvar_num(cvar[i]);
}

public client_death(killer, victim, wpnindex, hitplace, TK)
{
if(killer == victim || !este_inviata[killer])
return;

este_inviata[victim] = false;

new points = cvar_cache[points_tk];
if(cs_get_user_team(killer) == cs_get_user_team(victim))
{
if(points == 0)
return;

make_user_happy(killer, -points);
ColorChat(killer, "!4%s!1 Ai pierdut!3 %d!1 punct%s pentru ca ai omorat un coechipier.", Tag, points, points == 1 ? "" : "e");
}
else
{
switch(wpnindex)
{
case CSW_KNIFE:
{
if(hitplace == HIT_HEAD) points = (cvar_cache[points_hs_knife] == 0) ? 0 : cvar_cache[points_hs_knife];
else points = (cvar_cache[points_kill_knife] == 0) ? 0 : cvar_cache[points_kill_knife];
}
case CSW_HEGRENADE: points = (cvar_cache[points_he] == 0) ? 0 : cvar_cache[points_he];
default:
{
if(hitplace == HIT_HEAD) points = (cvar_cache[points_hs] == 0) ? 0 : cvar_cache[points_hs];
else points = (cvar_cache[points_kill] == 0) ? 0 : cvar_cache[points_kill];
}
}
if(is_user_vip(killer))
points *= 2;

if(points != 0)
{
make_user_happy(killer, points);
ColorChat(killer, "!4%s!1 +!3 %i puncte", Tag, points);
}
}
}

public bomb_planted(planter)
{
if(!este_conectat[planter] || cvar_cache[points_plant_bmb] == 0)
return PLUGIN_CONTINUE;

if(is_user_vip(planter))
cvar_cache[points_plant_bmb] *= 2;

make_user_happy(planter, cvar_cache[points_plant_bmb]);
ColorChat(0, "!3%s!1 Jucatorul!4 %s!1 a primit!3 %d!1 puncte pentru plantarea bombei.", Tag, nume_jucator[planter], cvar_cache[points_plant_bmb]);

return PLUGIN_CONTINUE;
}

public bomb_epointslode(planter, defuser)
{
if(!este_conectat[planter] || cvar_cache[points_epointslode_bmb] == 0)
return PLUGIN_CONTINUE;

if(is_user_vip(planter))
cvar_cache[points_epointslode_bmb] *= 2;

make_user_happy(planter, cvar_cache[points_epointslode_bmb]);
ColorChat(0, "!3%s!1 Jucatorul!4 %s!1 a primit!3 %d!1 puncte pentru ca a avut grija de bomba.", Tag, nume_jucator[planter], cvar_cache[points_epointslode_bmb]);

return PLUGIN_CONTINUE;
}

public bomb_defused(defuser)
{
if(!este_conectat[defuser] || cvar_cache[points_defuse_bmb] == 0)
return PLUGIN_CONTINUE;

if(is_user_vip(defuser))
cvar_cache[points_defuse_bmb] *= 2;

make_user_happy(defuser, cvar_cache[points_defuse_bmb]);
ColorChat(0, "!3%s!1 Jucatorul!4 %s!1 a primit!3 %d!1 puncte pentru dezamorsarea bombei.", Tag, nume_jucator[defuser], cvar_cache[points_defuse_bmb]);

return PLUGIN_CONTINUE;
}

public ClShowpoints(id)
{
if(este_conectat[id])
{
ColorChat(id, "!4%s!1 Ai!4 %d!1 punct%s.", Tag, points_jucator[id], points_jucator[id] == 1 ? "" : "e");
}

return PLUGIN_HANDLED;
}

public SaveUserEpointserienta(id)
{
new szVaultData[64];
format(szVaultData, charsmax(szVaultData), "%i#", points_jucator[id]);
nvault_set(g_Vault, nume_jucator[id], szVaultData);
//nvault_close(g_Vault);
}

public LoadUserEpointserienta(id)
{
new szVaultData[64], points[33];
format(szVaultData, charsmax(szVaultData), "%i#", points_jucator[id]);

nvault_get(g_Vault, nume_jucator[id], szVaultData, charsmax(szVaultData));
replace_all(szVaultData, charsmax(szVaultData), "#", " ");

parse(szVaultData, points, charsmax(points));
points_jucator[id] = str_to_num(points);
//nvault_close(g_Vault);
}

stock make_user_happy(id, points)
{
if(!este_conectat[id])
return PLUGIN_HANDLED;

if(points != 0)
{
points_jucator[id] += points;
if(points_jucator[id] <= 0) points_jucator[id] = 0;
}

SaveUserEpointserienta(id)
return PLUGIN_CONTINUE;
}

stock ColorChat(id, String[], any:...)
{
static szMesage[192];
vformat(szMesage, charsmax(szMesage), String, 3);

replace_all(szMesage, charsmax(szMesage), "!1", "^1");
replace_all(szMesage, charsmax(szMesage), "!3", "^3");
replace_all(szMesage, charsmax(szMesage), "!4", "^4");

static g_msg_SayText = 0;
if(!g_msg_SayText)
g_msg_SayText = get_user_msgid("SayText");

new Players[32], iNum = 1, i;

if(id) Players[0] = id;
else get_players(Players, iNum, "ch");

for(--iNum; iNum >= 0; iNum--)
{
i = Players[iNum];

message_begin(MSG_ONE_UNRELIABLE, g_msg_SayText, _, i);
write_byte(i);
write_string(szMesage);
message_end();
}
}


Sper ca stii sa modifici cvar-urile, daca nu, lasa replay si te ajut

_________________
„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]


30 Jul 2018 16:13
Profile multumesc YIM WWW
Membru, skill +1
Membru, skill +1

Joined: 02 Aug 2015 15:12
Posts: 145
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Ajuta-ma tu ca sa nu fac prostii pe acolo.. Ti-am dat PM cu o problema.


30 Jul 2018 20:22
Profile multumesc WWW
Membru, skill +1
Membru, skill +1

Joined: 02 Aug 2015 15:12
Posts: 145
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
UP!


07 Aug 2018 17:50
Profile multumesc WWW
Membru, skill +1
Membru, skill +1

Joined: 02 Aug 2015 15:12
Posts: 145
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Up!


11 Aug 2018 09:35
Profile multumesc WWW
Display posts from previous:  Sort by  
Reply to topic   [ 18 posts ]  Go to page Previous  1, 2

Who is online

Users browsing this forum: Mobbed and 78 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:  
cron

Î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