Skocz do zawartości

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.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

Vip Paintball


  • Zamknięty Temat jest zamknięty
14 odpowiedzi w tym temacie

#1 Locorooco

    Nowy

  • Użytkownik

Reputacja: 0
Nowy

  • Postów:8
  • Imię:Kamil
  • Lokalizacja:Nowy Sącz
Offline

Napisano 15.08.2011 16:45

Witam. Napisałem plugin vip-a na paintball moda ale nie gracze z flagą "t" dostają p90 i 120 hp tylko wszyscy

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <cstrike>
#include <fun>
#include <hamsandwich>

#define PLUGIN "[VIP] PaintBall"
#define VERSION "1.0"
#define AUTHOR "Drako"

#define USAGE_LEVEL ADMIN_LEVEL_H

#define SCOREATTRIB_NONE 	0
#define SCOREATTRIB_DEAD	(1<<0)
#define SCOREATTRIB_BOMB	(1<<1)
#define SCOREATTRIB_VIP 	(1<<2)

#define TASK_WYSZKOLENIE_SANITARNE 736


public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_message(get_user_msgid("ScoreAttrib"), "MessageScoreAttrib");
	RegisterHam(Ham_Spawn, "player", "Odrodzenie", 1);
	
}

public MessageScoreAttrib(iMsgID, iDest, iReceiver)
{   
	new iPlayer = get_msg_arg_int(1);
	if(get_user_flags(iPlayer) & USAGE_LEVEL)
	{
		if(is_user_connected(iPlayer))
		{
			if(cs_get_user_team(iPlayer)==CS_TEAM_CT)
			{		
				set_msg_arg_int(2, ARG_BYTE, is_user_alive(iPlayer) ? SCOREATTRIB_VIP : SCOREATTRIB_DEAD);
			}
			else
			{
				set_msg_arg_int(2, ARG_BYTE, is_user_alive(iPlayer) ? SCOREATTRIB_VIP : SCOREATTRIB_BOMB);		
			}
		}
	}
}

public WyszkolenieSanitarne(id)
{
	id -= TASK_WYSZKOLENIE_SANITARNE;
	
	if(!is_user_connected(id))
		return PLUGIN_CONTINUE;
		
	if(get_user_flags(id) & USAGE_LEVEL)
	{
		set_task(2.0, "WyszkolenieSanitarne", id+TASK_WYSZKOLENIE_SANITARNE);
		
		if(is_user_alive(id))
		{
			new cur_health = get_user_health(id);
			new max_health = 120;
			new new_health = cur_health+1<max_health? cur_health+1: max_health;
			set_user_health(id, new_health);
		}
	}
	return PLUGIN_CONTINUE;
}

public Odrodzenie(id)
{	
	if(!is_user_alive(id) || !(get_user_flags(id) & USAGE_LEVEL))
		set_task(2.0, "WyszkolenieSanitarne", id+TASK_WYSZKOLENIE_SANITARNE);
		set_task(2.0, "DropNorm");
	
	set_user_health(id, 120);
	give_item(id, "weapon_p90");
	give_item(id, "weapon_p90");
	give_item(id, "weapon_p90");

	return PLUGIN_CONTINUE;
}

public DropNorm(id)
{	
	if(!is_user_connected(id))
		return PLUGIN_CONTINUE;
	client_cmd(id, "drop weapon_xm1014;drop weapon_scout");
		
	if(get_user_flags(id) & USAGE_LEVEL)
	{
		set_task(2.0, "DropNorm");
		
		if(is_user_alive(id))
		{
		client_cmd(id, "drop weapon_mp5navy;drop weapon_xm1014;drop weapon_scout");
		}
	}
	return PLUGIN_CONTINUE;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1045\\ f0\\ fs16 \n\\ par }
*/

proszę o pomoc


Proszę o pomoc
  • +
  • -
  • 0

#2 Hiroshima

    Godlike

  • Przyjaciel

Reputacja: 1 327
Godlike

  • Postów:4 984
  • Steam:steam
  • Imię:Michał
  • Lokalizacja:Málaga
Offline

Napisano 15.08.2011 16:49

Automatyczna wiadomość


Ten temat został przeniesiony z forum:
AMX Mod X -> Problemy z pluginami
do
Scripting -> Problemy

  • +
  • -
  • 0

#3 DarkGL

    Nie oddam ciasteczka !

  • Administrator

Reputacja: 6 553
Godlike

  • Postów:11 976
  • GG:
  • Steam:steam
  • Imię:Rafał
  • Lokalizacja:Warszawa
Offline

Napisano 15.08.2011 17:39

public Odrodzenie(id)
{	
	if(!is_user_alive(id) || !(get_user_flags(id) & USAGE_LEVEL))
		set_task(2.0, "WyszkolenieSanitarne", id+TASK_WYSZKOLENIE_SANITARNE);
		set_task(2.0, "DropNorm");
	
	set_user_health(id, 120);
	give_item(id, "weapon_p90");
	give_item(id, "weapon_p90");
	give_item(id, "weapon_p90");

	return PLUGIN_CONTINUE;
}
na
public Odrodzenie(id)
{	
	if(!is_user_alive(id) || !(get_user_flags(id) & USAGE_LEVEL))
		return ;
	}
	set_task(2.0, "WyszkolenieSanitarne", id+TASK_WYSZKOLENIE_SANITARNE);
	set_task(2.0, "DropNorm");
	set_user_health(id, 120);
	give_item(id, "weapon_p90");
	give_item(id, "weapon_p90");
	give_item(id, "weapon_p90");
}

  • +
  • -
  • 0

#4 Locorooco

    Nowy

  • Autor tematu
  • Użytkownik

Reputacja: 0
Nowy

  • Postów:8
  • Imię:Kamil
  • Lokalizacja:Nowy Sącz
Offline

Napisano 15.08.2011 18:05

Hp znikło (na fladze t też) nadal wszyscy mają szybkie markery
  • +
  • -
  • 0

#5 A może sma?

    Godlike

  • Power User

Reputacja: 546
Wszechwiedzący

  • Postów:1 464
  • Steam:steam
  • Imię:Tomasz
  • Lokalizacja:Polska
Offline

Napisano 15.08.2011 18:07

public Odrodzenie(id)
{
if(!is_user_alive(id) || (!(get_user_flags(id) & USAGE_LEVEL)))
return ;

set_task(2.0, "WyszkolenieSanitarne", id+TASK_WYSZKOLENIE_SANITARNE);
set_task(2.0, "DropNorm");
set_user_health(id, 120);
give_item(id, "weapon_p90");
give_item(id, "weapon_p90");
give_item(id, "weapon_p90");
}


A to?
Ew.:

public Odrodzenie(id)
{
if(!is_user_alive(id))
return ;
if(!(get_user_flags(id) & USAGE_LEVEL))
return ;

set_task(2.0, "WyszkolenieSanitarne", id+TASK_WYSZKOLENIE_SANITARNE);
set_task(2.0, "DropNorm");
set_user_health(id, 120);
give_item(id, "weapon_p90");
give_item(id, "weapon_p90");
give_item(id, "weapon_p90");
}

Użytkownik A może sma? edytował ten post 15.08.2011 18:09

  • +
  • -
  • 1

#6 Locorooco

    Nowy

  • Autor tematu
  • Użytkownik

Reputacja: 0
Nowy

  • Postów:8
  • Imię:Kamil
  • Lokalizacja:Nowy Sącz
Offline

Napisano 15.08.2011 18:30

Wszyscy mają 120hp i wszyscy mają szybkie markery
  • +
  • -
  • 0

#7 A może sma?

    Godlike

  • Power User

Reputacja: 546
Wszechwiedzący

  • Postów:1 464
  • Steam:steam
  • Imię:Tomasz
  • Lokalizacja:Polska
Offline

Napisano 15.08.2011 18:33

public Odrodzenie(id)
{
if(!is_user_alive(id)) return PLUGIN_CONTINUE;
if(get_user_flags(id) & USAGE_LEVEL)
{
set_task(2.0, "WyszkolenieSanitarne", id+TASK_WYSZKOLENIE_SANITARNE);
set_task(2.0, "DropNorm");

set_user_health(id, 120);
give_item(id, "weapon_p90");
give_item(id, "weapon_p90");
give_item(id, "weapon_p90");
}
return PLUGIN_CONTINUE;
}


Tak?
  • +
  • -
  • 0

#8 Locorooco

    Nowy

  • Autor tematu
  • Użytkownik

Reputacja: 0
Nowy

  • Postów:8
  • Imię:Kamil
  • Lokalizacja:Nowy Sącz
Offline

Napisano 15.08.2011 18:38

Nadal to samo
  • +
  • -
  • 0

#9 A może sma?

    Godlike

  • Power User

Reputacja: 546
Wszechwiedzący

  • Postów:1 464
  • Steam:steam
  • Imię:Tomasz
  • Lokalizacja:Polska
Offline

Napisano 15.08.2011 19:10

Głupio zapytam: skompilowałeś i wrzuciłeś na serwer?
  • +
  • -
  • 0

#10 Locorooco

    Nowy

  • Autor tematu
  • Użytkownik

Reputacja: 0
Nowy

  • Postów:8
  • Imię:Kamil
  • Lokalizacja:Nowy Sącz
Offline

Napisano 15.08.2011 19:14

Tak
  • +
  • -
  • 0

#11 DarkGL

    Nie oddam ciasteczka !

  • Administrator

Reputacja: 6 553
Godlike

  • Postów:11 976
  • GG:
  • Steam:steam
  • Imię:Rafał
  • Lokalizacja:Warszawa
Offline

Napisano 15.08.2011 20:34

bo może każdy ma flage "t" ? innego wytłumaczenia nie ma
taki kod jest poprawny :
public Odrodzenie(id)
{	
	if(!is_user_alive(id) || !(get_user_flags(id) & USAGE_LEVEL))
		return ;
	}
	set_task(2.0, "WyszkolenieSanitarne", id+TASK_WYSZKOLENIE_SANITARNE);
	set_task(2.0, "DropNorm");
	set_user_health(id, 120);
	give_item(id, "weapon_p90");
}

  • +
  • -
  • 0

#12 Locorooco

    Nowy

  • Autor tematu
  • Użytkownik

Reputacja: 0
Nowy

  • Postów:8
  • Imię:Kamil
  • Lokalizacja:Nowy Sącz
Offline

Napisano 15.08.2011 20:51

Ale jak każdy może mieć flagę "t" ? :)
  • +
  • -
  • 0

#13 A może sma?

    Godlike

  • Power User

Reputacja: 546
Wszechwiedzący

  • Postów:1 464
  • Steam:steam
  • Imię:Tomasz
  • Lokalizacja:Polska
Offline

Napisano 15.08.2011 21:02

@Dark: Dlaczego masz tam klamrę pomiędzy return ; a set_task?
I hipoteza Darka jest najbardziej realna... Kod musi działać, bo najzwyczajniej w świecie jest poprawny...
  • +
  • -
  • 0

#14 DarkGL

    Nie oddam ciasteczka !

  • Administrator

Reputacja: 6 553
Godlike

  • Postów:11 976
  • GG:
  • Steam:steam
  • Imię:Rafał
  • Lokalizacja:Warszawa
Offline

Napisano 15.08.2011 21:03

jeśli masz amxbans to sprawdź czy on tego nie robi , może jakiś plugin ustawia graczowi flagi pokaż users.ini
  • +
  • -
  • 0

#15 Locorooco

    Nowy

  • Autor tematu
  • Użytkownik

Reputacja: 0
Nowy

  • Postów:8
  • Imię:Kamil
  • Lokalizacja:Nowy Sącz
Offline

Napisano 16.08.2011 15:15

Users.ini jest czyste

; Access flags:
; a - immunity (can't be kicked/baned/slayed/slaped and affected by other commmands)
; b - reservation (can join on reserved slots)
; c - amx_kick command
; d - amx_ban and amx_unban commands
; e - amx_slay and amx_slap commands
; f - amx_map command
; g - amx_cvar command (not all cvars will be available)
; h - amx_cfg command
; i - amx_chat and other chat commands
; j - amx_vote and other vote commands
; k - access to sv_password cvar (by amx_cvar command)
; l - access to amx_rcon command and rcon_password cvar (by amx_cvar command)
; m - custom level A (for additional plugins)
; n - custom level B
; o - custom level C
; p - custom level D
; q - custom level E
; r - custom level F
; s - custom level G
; t - custom level H
; u - menu access
; z - user (no admin)

; Account flags:
; a - disconnect player on invalid password
; b - clan tag
; c - this is steamid/wonid
; d - this is ip
; e - password is not checked (only name/ip/steamid needed)
; k - name or tag is case sensitive.  eg: if you set it so the name "Ham"
;     is protected and case sensitive (flags "k" only), then anybody
;     can use the names "haM", "HAM", "ham", etc, but not "Ham"

; Password:
; Add to your autoexec.cfg: setinfo _pw "<password>"
; Change _pw to the value of amx_password_field

; Format of admin account:
; <name|ip|steamid> <password> <access flags> <account flags>

; Examples of admin accounts:
; "STEAM_0:0:123456" "" "abcdefghijklmnopqrstu" "ce"
; "123.45.67.89" "" "abcdefghijklmnopqrstu" "de"
; "My Name" "my_password" "abcdefghijklmnopqrstu" "a"

"loopback" "" "abcdefghijklmnopqrstu" "de"

  • +
  • -
  • 0




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych