Unde am gresit??

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
User avatar
tre3fla
Membru eXtream
Membru eXtream
Posts: 5333
Joined: 27 May 2012, 10:15
Detinator Steam: Da
CS Status: Allah Akbar !
Detinator server CS: Nu
SteamID: /id/tre3fla_xxx
Has thanked: 14 times
Been thanked: 129 times

13 Jul 2012, 03:17

[sursa=#include <amxmodx>
#include <fun>
#include <amxmisc>
#include <cstrike>

new plugin_on

enum Color
{
NORMAL = 1, // clients scr_concolor cvar color
GREEN, // Green Color
TEAM_COLOR, // Red, grey, blue
GREY, // grey
RED, // Red
BLUE, // Blue
}

new TeamName[][] =
{
"",
"TERRORIST",
"CT",
"SPECTATOR"
}


public plugin_init(){

register_plugin("VIP MENU", "1.1", "tre3fla,")
register_menucmd(register_menuid("VIP MENU"), 1023, "setoption")
plugin_on = register_cvar("amx_vipmenu", "1")


register_clcmd("say /vipmenu","vip_menu",ADMIN_CVAR)
register_clcmd("say_team /vipmenu","vip_menu",ADMIN_CVAR)

register_clcmd("say /vmenu","vip_menu",ADMIN_CVAR)
register_clcmd("say_team /vmenu","vip_menu",ADMIN_CVAR)


}

public vip_menu(id,level,cid)
{
if ( !get_pcvar_num(plugin_on) )
{
ColorChat(id, RED, "Vip Menu este momentan dezactivat");
return PLUGIN_HANDLED;
}

if(!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED

chooseoption(id)

return PLUGIN_HANDLED

}
public chooseoption(id)
{
new menu[192]
new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9
format(menu, 191, "\yVIP MENU^n^n\r1.\w MP5 Navy^n\r2.\w MAC 10^n\r3.\w Dual Elites^n\r4.\w Fiveseven^n\r5.\w Armura^n\r6.\w 250 HP^n^n\r0.\w Iesire")
show_menu(id, keys, menu)
return PLUGIN_CONTINUE
}

public setoption(id, key, menu)
{
if(key == 0) {
new name[17]
get_user_name(id, name, 18)
give_item(id,"weapon_smg");
ColorChat(0, GREEN, "^x04[VIP] ^x03%s^x01 si-a luat ^x04MP5 Navy^x01 (30GL)", name)
return PLUGIN_HANDLED
}

if(key == 1) {
new name[17]
get_user_name(id, name, 18)
give_item(id,"weapon_mac10");
ColorChat(0, GREEN, "^x04[VIP] ^x03%s^x01 si-a luat^x04 MAC 10 (30GL)", name)
return PLUGIN_HANDLED

}

if(key == 2) {
new name[17]
get_user_name(id, name, 18)
give_item(id,"weapon_elites");
ColorChat(id, TEAM_COLOR, "^x04[VIP] ^x03%s^x01 si-a luat o pereche de ^x03elites (30GL)", name)
return PLUGIN_HANDLED
}

if(key == 3) {
new name[17]
get_user_name(id, name, 18)
give_item(id,"weapon_mp5navy")
ColorChat(0, GREEN, "^x04[VIP] ^x03%s^x01 si-a luat ^x04Fiveseven (20GL)", name)
return PLUGIN_HANDLED

}

if(key == 4) {
new name[17]
get_user_name(id, name, 18)
set_user_armor(id, 300)
ColorChat(0, GREEN, "^x04[VIP] ^x03%s^x01 si-a luat ^x04 Armura (300 Aparare)", name)
return PLUGIN_HANDLED
}

if(key == 5) {
new name[17]
get_user_name(id, name, 18)
set_user_health(id, 250)
ColorChat(0, GREEN, "^x04[VIP] ^x03%s^x01 si-a luat^x04 250hp", name)
return PLUGIN_HANDLED
}

else {
return PLUGIN_HANDLED
}

return PLUGIN_HANDLED
}

public plugin_precache() {
precache_model("models/player/smith/smith.mdl")
precache_model("models/player/smith/smith.mdl")

return PLUGIN_CONTINUE
}

public resetModel(id, level, cid) {
if (get_user_flags(id) & ADMIN_CVAR) {
new CsTeams:userTeam = cs_get_user_team(id)
if (userTeam == CS_TEAM_T) {
cs_set_user_model(id, "smith")
}
else if(userTeam == CS_TEAM_CT) {
cs_set_user_model(id, "smith")
}
else {
cs_reset_user_model(id)
}
}

return PLUGIN_CONTINUE
}

ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...)
{
new message[256];

switch(type)
{
case NORMAL: // clients scr_concolor cvar color
{
message[0] = 0x01;
}
case GREEN: // Green
{
message[0] = 0x04;
}
default: // White, Red, Blue
{
message[0] = 0x03;
}
}

vformat(message[1], 251, msg, 4);

// Asigurate ca mesajul nu contine mai mult de 192 de caractere.Iti va pica serverul.
message[192] = '^0';

new team, ColorChange, index, MSG_Type;

if(id)
{
MSG_Type = MSG_ONE;
index = id;
} else {
index = FindPlayer();
MSG_Type = MSG_ALL;
}

team = get_user_team(index);
ColorChange = ColorSelection(index, MSG_Type, type);

ShowColorMessage(index, MSG_Type, message);

if(ColorChange)
{
Team_Info(index, MSG_Type, TeamName[team]);
}
}

ShowColorMessage(id, type, message[])
{
static bool:saytext_used;
static get_user_msgid_saytext;
if(!saytext_used)
{
get_user_msgid_saytext = get_user_msgid("SayText");
saytext_used = true;
}
message_begin(type, get_user_msgid_saytext, _, id);
write_byte(id)
write_string(message);
message_end();
}

Team_Info(id, type, team[])
{
static bool:teaminfo_used;
static get_user_msgid_teaminfo;
if(!teaminfo_used)
{
get_user_msgid_teaminfo = get_user_msgid("TeamInfo");
teaminfo_used = true;
}
message_begin(type, get_user_msgid_teaminfo, _, id);
write_byte(id);
write_string(team);
message_end();

return 1;
}

ColorSelection(index, type, Color:Type)
{
switch(Type)
{
case RED:
{
return Team_Info(index, type, TeamName[1]);
}
case BLUE:
{
return Team_Info(index, type, TeamName[2]);
}
case GREY:
{
return Team_Info(index, type, TeamName[0]);
}
}

return 0;
}

FindPlayer()
{
new i = -1;

while(i <= get_maxplayers())
{
if(is_user_connected(++i))
return i;
}

return -1;
}][/sursa]

M-am apucat sa fac un plugin de VIP pentru DeathRun...dupa ce am rezolvat 1001 de erori si buguri mai aparu unu care chiar nu-i dua de cap... :|
Deci va rog sa-mi spuneti unde am gresit si cum pot remedia,sau daca puteti sa-mi remediati chair voi problema...

PROBLEMA :[/b] scriu /vm sau /vipmenu si nu-mi arata NIMIC !
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 28 guests