Plugina muutmin (kontroll kas CT)
Lehekülg 1, lehekülgi kokku 1 • Share
- Kristjan PAlgaja
- Liitus : 14/01/2017
Postitusi : 8
Tere! Mul oleks tarvis pluginat, mis menüü valimisel annaks granaadid ainult teamile CT, nimelt teen zombie serverit ja hetkel saab ka zombie granaate valida.
Mida ma valesti tegin reas: if (cs_get_user_team(id) != CS_TEAM_CT || !is_user_alive(id)){?
Algselt oli rida selline: if(is_user_alive(id)){
- Kood:
/* Plugin generated by AMXX-Studio */
#include < amxmodx >
#include < fun >
#include < fakemeta >
#define PLUGIN "VipMenu"
#define VERSION "0.1"
#define AUTHOR "HaSKe"
#define FLAG ADMIN_LEVEL_H
const Float:speed = 300.0
new g_Block[33][5]
new g_Speed[33]
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_logevent("RoundStart", 2, "1=Round_Start")
register_event("CurWeapon", "CurWeapon", "be", "1=1")
register_clcmd("vipmenu", "vipmenu")
register_clcmd("say /vipmenu","vipmenu")
register_clcmd("say vipmenu","vipmenu")
// Add your code here...
}
public vipmenu(id){
if(get_user_flags(id) & FLAG){
new menu = menu_create("\rVIP MENU", "vip_handle")
if(g_Block[id][0] == 0){
menu_additem(menu, "Take 100 Armor", "1")
}else{
menu_additem(menu, "\dTake 100 Armor", "1")
}
if(g_Block[id][1] == 0){
menu_additem(menu, "Take 100 HP", "2")
}else{
menu_additem(menu, "\dTake 100 HP", "2")
}
if(g_Block[id][2] == 0){
menu_additem(menu, "Take Nades", "3")
}else{
menu_additem(menu, "\dTake Nades", "3")
}
if(g_Block[id][3] == 0){
menu_additem(menu, "Take Speed", "4")
}else{
menu_additem(menu, "\dTake Speed", "4")
}
if(g_Block[id][4] == 0){
menu_additem(menu, "Take Gravitation", "5")
}else{
menu_additem(menu, "\dTake Gravitation", "5")
}
menu_setprop(menu, MPROP_EXITNAME, "Exit")
menu_display(id, menu, 0)
}else{
client_print(id, print_chat, "You are not VIP. Type /wantvip")
}
return PLUGIN_HANDLED
}
public vip_handle(id, menu, item){
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED;
}
new data[6], iName[64], access, call_back
menu_item_getinfo(menu, item, access, data, 5, iName, 63, call_back)
new key = str_to_num(data)
switch(key){
case 1:{
if(is_user_alive(id)){
if(g_Block[id][0] == 0){
g_Block[id][0] += 2
set_user_armor(id, get_user_armor(id) + 100)
client_print(id, print_chat, "You took 100 armor.")
}else if(g_Block[id][0] > 0){
client_print(id, print_chat, "Wait %d round(s).", g_Block[id][0])
}
}
}
case 2:{
if(is_user_alive(id)){
if(g_Block[id][1] == 0){
g_Block[id][1] += 2
set_user_health(id, get_user_health(id) + 100)
client_print(id, print_chat, "You took 100 HP.")
}else if(g_Block[id][1] > 0){
client_print(id, print_chat, "Wait %d round(s).", g_Block[id][1])
}
}
}
case 3:{
if (cs_get_user_team(id) != CS_TEAM_CT || !is_user_alive(id)){
if(g_Block[id][2] == 0){
g_Block[id][2] += 2
give_item(id, "weapon_hegrenade")
give_item(id, "weapon_flashbang")
give_item(id, "weapon_smokegrenade")
client_print(id, print_chat, "You took nades.")
}else if(g_Block[id][2] > 0){
client_print(id, print_chat, "Wait %d round(s).", g_Block[id][2])
}
}
}
case 4:{
if(is_user_alive(id)){
if(g_Block[id][3] == 0){
g_Block[id][3] += 2
Speed(id)
client_print(id, print_chat, "You took speed.")
}else if(g_Block[id][3] > 0){
client_print(id, print_chat, "Wait %d round(s).", g_Block[id][3])
}
}
}
case 5:{
if(is_user_alive(id)){
if(g_Block[id][4] == 0){
g_Block[id][4] += 2
set_pev(id, pev_gravity, 0.75)
client_print(id, print_chat, "You took gravitation.")
}else if(g_Block[id][4] > 0){
client_print(id, print_chat, "Wait %d round(s).", g_Block[id][4])
}
}
}
}
return PLUGIN_HANDLED
}
public Speed(id){
set_pev(id, pev_maxspeed, speed)
g_Speed[id] = true
}
public CurWeapon(id){
if(g_Speed[id])
set_pev(id, pev_maxspeed, speed)
}
public RoundStart(id){
for(new id = 0; id < 33; id++){
if(g_Speed[id]){
g_Speed[id] = false
}
if(g_Block[id][0] > 0){
g_Block[id][0] -= 1
}
if(g_Block[id][1] > 0){
g_Block[id][1] -= 1
}
if(g_Block[id][2] > 0){
g_Block[id][2] -= 1
}
if(g_Block[id][3] > 0){
g_Block[id][3] -= 1
}
if(g_Block[id][4] > 0){
g_Block[id][4] -= 1
}
}
}
Mida ma valesti tegin reas: if (cs_get_user_team(id) != CS_TEAM_CT || !is_user_alive(id)){?
- Kood:
case 3:{
if (cs_get_user_team(id) != CS_TEAM_CT || !is_user_alive(id)){
if(g_Block[id][2] == 0){
g_Block[id][2] += 2
give_item(id, "weapon_hegrenade")
give_item(id, "weapon_flashbang")
give_item(id, "weapon_smokegrenade")
client_print(id, print_chat, "You took nades.")
}else if(g_Block[id][2] > 0){
client_print(id, print_chat, "Wait %d round(s).", g_Block[id][2])
}
}
}
Algselt oli rida selline: if(is_user_alive(id)){
- Tonight
- Liitus : 19/02/2012
Postitusi : 18000
if (cs_get_user_team(id) == CS_TEAM_CT && is_user_alive(id)){
cstrike includemata ka sul scriptis.
cstrike includemata ka sul scriptis.
- Kristjan PAlgaja
- Liitus : 14/01/2017
Postitusi : 8
Hetkel on selline kood, aga saan zombina ikka granaadid kätte.
- Kood:
/* Plugin generated by AMXX-Studio */
#include < amxmodx >
#include < fun >
#include < fakemeta >
#include < cstrike >
#define PLUGIN "VipMenu"
#define VERSION "0.2"
#define AUTHOR "HaSKe"
#define FLAG ADMIN_LEVEL_H
const Float:speed = 300.0
new g_Block[33][5]
new g_Speed[33]
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_logevent("RoundStart", 2, "1=Round_Start")
register_event("CurWeapon", "CurWeapon", "be", "1=1")
register_clcmd("vipmenu", "vipmenu")
register_clcmd("say /vipmenu","vipmenu")
register_clcmd("say vipmenu","vipmenu")
// Add your code here...
}
public vipmenu(id){
if(get_user_flags(id) & FLAG){
new menu = menu_create("\rVIP MENU", "vip_handle")
if(g_Block[id][0] == 0){
menu_additem(menu, "Take 100 Armor", "1")
}else{
menu_additem(menu, "\dTake 100 Armor", "1")
}
if(g_Block[id][1] == 0){
menu_additem(menu, "Take 100 HP", "2")
}else{
menu_additem(menu, "\dTake 100 HP", "2")
}
if(g_Block[id][2] == 0){
menu_additem(menu, "Take Nades", "3")
}else{
menu_additem(menu, "\dTake Nades", "3")
}
if(g_Block[id][3] == 0){
menu_additem(menu, "Take Speed", "4")
}else{
menu_additem(menu, "\dTake Speed", "4")
}
if(g_Block[id][4] == 0){
menu_additem(menu, "Take Gravitation", "5")
}else{
menu_additem(menu, "\dTake Gravitation", "5")
}
menu_setprop(menu, MPROP_EXITNAME, "Exit")
menu_display(id, menu, 0)
}else{
client_print(id, print_chat, "You are not VIP. Type /wantvip")
}
return PLUGIN_HANDLED
}
public vip_handle(id, menu, item){
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED;
}
new data[6], iName[64], access, call_back
menu_item_getinfo(menu, item, access, data, 5, iName, 63, call_back)
new key = str_to_num(data)
switch(key){
case 1:{
if(is_user_alive(id)){
if(g_Block[id][0] == 0){
g_Block[id][0] += 2
set_user_armor(id, get_user_armor(id) + 100)
client_print(id, print_chat, "You took 100 armor.")
}else if(g_Block[id][0] > 0){
client_print(id, print_chat, "Wait %d round(s).", g_Block[id][0])
}
}
}
case 2:{
if(is_user_alive(id)){
if(g_Block[id][1] == 0){
g_Block[id][1] += 2
set_user_health(id, get_user_health(id) + 100)
client_print(id, print_chat, "You took 100 HP.")
}else if(g_Block[id][1] > 0){
client_print(id, print_chat, "Wait %d round(s).", g_Block[id][1])
}
}
}
case 3:{
if (cs_get_user_team(id) == CS_TEAM_CT && is_user_alive(id)){
if(g_Block[id][2] == 0){
g_Block[id][2] += 2
give_item(id, "weapon_hegrenade")
give_item(id, "weapon_flashbang")
give_item(id, "weapon_smokegrenade")
client_print(id, print_chat, "You took nades.")
}else if(g_Block[id][2] > 0){
client_print(id, print_chat, "Wait %d round(s).", g_Block[id][2])
}
}
}
case 4:{
if(is_user_alive(id)){
if(g_Block[id][3] == 0){
g_Block[id][3] += 2
Speed(id)
client_print(id, print_chat, "You took speed.")
}else if(g_Block[id][3] > 0){
client_print(id, print_chat, "Wait %d round(s).", g_Block[id][3])
}
}
}
case 5:{
if(is_user_alive(id)){
if(g_Block[id][4] == 0){
g_Block[id][4] += 2
set_pev(id, pev_gravity, 0.75)
client_print(id, print_chat, "You took gravitation.")
}else if(g_Block[id][4] > 0){
client_print(id, print_chat, "Wait %d round(s).", g_Block[id][4])
}
}
}
}
return PLUGIN_HANDLED
}
public Speed(id){
set_pev(id, pev_maxspeed, speed)
g_Speed[id] = true
}
public CurWeapon(id){
if(g_Speed[id])
set_pev(id, pev_maxspeed, speed)
}
public RoundStart(id){
for(new id = 0; id < 33; id++){
if(g_Speed[id]){
g_Speed[id] = false
}
if(g_Block[id][0] > 0){
g_Block[id][0] -= 1
}
if(g_Block[id][1] > 0){
g_Block[id][1] -= 1
}
if(g_Block[id][2] > 0){
g_Block[id][2] -= 1
}
if(g_Block[id][3] > 0){
g_Block[id][3] -= 1
}
if(g_Block[id][4] > 0){
g_Block[id][4] -= 1
}
}
}
- Kristjan PAlgaja
- Liitus : 14/01/2017
Postitusi : 8
#töötab
vahetasin kohtadega elus oleku kontrolli ja team kontrolli
vahetasin kohtadega elus oleku kontrolli ja team kontrolli
- Kood:
if (is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT
Soovid vestluses osaleda?
Selleks logi sisse või tee endale kasutaja.
Lehekülg 1, lehekülgi kokku 1
Permissions in this forum:
Sa ei saa vastata siinsetele teemadele