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

Problem z pluginem Daj Fragipomoc z pluginem Daj Fragi


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

#1 Szary322

    Życzliwy

  • Użytkownik

Reputacja: 3
Nowy

  • Postów:34
  • GG:
  • Lokalizacja:Białystok
Offline

Napisano 03.02.2010 16:07

Witam ,mam nie lada problem a mianowicie chodzi o przerobienie pluginu "Cash Transger" na "Daj Fragi" ,probowalem recznie cos przekomplikowac ale cus mi nie wyszlo ,proszę o pomoc : oto moj plugin :
#include <amxmod> 
#include <amxmisc> 
#include <fun>

public plugin_init() {  
	register_plugin("Dawanie Fragow","1","ghn")  
	register_concmd("say","handle_say",ADMIN_USER) 
	register_concmd("say_team","handle_say",ADMIN_USER) 
	register_cvar("set_user_frags","1",0) 
	register_cvar("set_user_deaths","1",0) 
	register_cvar("set_user_score","1",0) 
	return PLUGIN_CONTINUE  
} 

public handle_say(id) { 

new said[31] 
new cmd[10] 
new target[9] 
new amount[7] 
new rest[5] 
		 
read_args(said, 30) 
replace(said, 30, "^"", "") 
parse(said, cmd,9, target,8, amount,6, rest,4) 

new player = cmd_target(id,target,8) 
new name[33] 
new name2[33] 
get_user_name(id,name,32) 
get_user_name(player,name2,32)		
new team[32] 
new team2[32] 
get_user_team(id,team,32) 
get_user_team(player,team2,32) 

if (equal(cmd, "/dajfragi", 9)) { 
	newFrags = set_user_frags(id) 
	newFrags2 = set_user_frags(player) 
	new frag = str_to_num(amount) 
	new bool:NoCantDo
	NoCantDo=false

	if (!is_user_alive(id)) { 
		if (get_cvar_num("set_user_frags")==0) { 
			client_print(id,print_center,"Nie mozesz dac fragow gdy niezyjesz")
			NoCantDo=true
		} 
	} 
	if (!is_user_alive(player)) { 
		if (get_cvar_num("set_user_frags")==0) {
				client_print(id,print_center,"Nie mozesz dac fragow dla niezywych")
				NoCantDo=true
		} 
	} 
	if (equal(name, name2)) { 
				client_print(id,print_center,"Nie mozesz dac sobie fragow")
				NoCantDo=true
		} 
	if (!equal(team, team2)) { 
		if (get_cvar_num("set_user_frags")==0) { 
				client_print(id,print_center,"Nie mozesz dac Fragow dla przeciwnej druzyny")
				NoCantDo=true
		} 
	} 
	if ((frags2 + frag) > 16000) { 
				client_print(id,print_center,"%s nie moze przyjac tylu fragow")
				NoCantDo=true
			} 
	if (frags < frag) { 
				client_print(id,print_center,"Nie masz tylu Fragow") 
				NoCantDo=true
			} 
	if (frag < 0) { 
		if (get_cvar_num("set_user_frags")==0) {
				client_print(id,print_center,"Nie mozesz Ukrasc %s's frags",name2)
				NoCantDo=true
			} 
	}
	if (!NoCantDo) {
		
		set_user_frags(id, frag - frag,1) 
		set_user_frags(player, frags2 + frag,1) 
		client_print(0,print_chat,"[AMX] %s dal %i $ dla %s. Podziekuj mu",name,frag,name2) 
		engclient_cmd(id,"say Dziekuje ci %s",name) 
		}
	} 
return PLUGIN_CONTINUE 
}


w tym pluginie chodzi o to aby mozna bylo przesylac swoje fragi dla kogos z twojej druzyny ,i w momencie przesylania ,fragi gracza ktory wysyla maleja ,a rosna dla osoba ktora wybierze : np. /dajfragi ghn 15
  • +
  • -
  • 0

#2 G[o]Q

    I'm G[o]Q

  • Przyjaciel

Reputacja: 1 344
Godlike

  • Postów:3 563
  • Steam:steam
  • Imię:Krzysiek
  • Lokalizacja:C: / program Files / Valve / Cstrike / G[o]Q.dem
Offline

Napisano 03.02.2010 19:03

a moze jakis log kompilatora?? osobiscie wydaje mi sie ze wywolanie funkcji komenda say w consoli nie powinno przyniesc zadanego efektu ale moge sie mylic :D
  • +
  • -
  • 0
Manual ponad wszystko, konsola ponad manual :D :&

Chcesz wysłać do mnie PW ? użyj nazwy GoQ zamiast G[o]Q
Chcesz Kupić moduł płatności via Pukawka,Tserwery, Gamesol, Zabijaka do mojego sklepu? napisz PW cena to tylko 10 zł/sztuka

GG:6022845 (nie pomagam za free osobom ponizej rangi MoD) :D

#3 Szary322

    Życzliwy

  • Autor tematu
  • Użytkownik

Reputacja: 3
Nowy

  • Postów:34
  • GG:
  • Lokalizacja:Białystok
Offline

Napisano 03.02.2010 21:42

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/home/groups/amxmodx/tmp3/phpRkQRMJ.sma(38) : error 017: undefined symbol "newFrags"
/home/groups/amxmodx/tmp3/phpRkQRMJ.sma(38) : error 088: number of arguments does not match definition
/home/groups/amxmodx/tmp3/phpRkQRMJ.sma(39) : error 017: undefined symbol "newFrags2"
/home/groups/amxmodx/tmp3/phpRkQRMJ.sma(39) : error 088: number of arguments does not match definition
/home/groups/amxmodx/tmp3/phpRkQRMJ.sma(66) : error 017: undefined symbol "frags2"
/home/groups/amxmodx/tmp3/phpRkQRMJ.sma(70) : error 017: undefined symbol "frags"
/home/groups/amxmodx/tmp3/phpRkQRMJ.sma(82) : error 088: number of arguments does not match definition
/home/groups/amxmodx/tmp3/phpRkQRMJ.sma(83) : error 017: undefined symbol "frags2"
/home/groups/amxmodx/tmp3/phpRkQRMJ.sma(83) : warning 215: expression has no effect
/home/groups/amxmodx/tmp3/phpRkQRMJ.sma(83) : warning 215: expression has no effect
/home/groups/amxmodx/tmp3/phpRkQRMJ.sma(83) : error 001: expected token: ";", but found ")"
/home/groups/amxmodx/tmp3/phpRkQRMJ.sma(83) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp3/phpRkQRMJ.sma(83) : fatal error 107: too many error messages on one line

Compilation aborted.
11 Errors.
wiem ze zle zakodowalem ale naprawdę nie mam pojecia jak to naprawic :/

juz 3 bledy poprawilem i teraz wyglada tak : plugin :
#include <amxmod> 
#include <amxmisc> 
#include <fun>

public plugin_init() {  
	register_plugin("Dawanie Fragow","1","ghn")  
	register_concmd("say","handle_say",ADMIN_USER) 
	register_concmd("say_team","handle_say",ADMIN_USER) 
	register_cvar("set_user_frags","1",0) 
	register_cvar("set_user_deaths","1",0) 
	register_cvar("set_user_score","1",0) 
	return PLUGIN_CONTINUE  
} 

public handle_say(id) { 

new said[31] 
new cmd[10] 
new target[9] 
new amount[7] 
new rest[5] 
		 
read_args(said, 30) 
replace(said, 30, "^"", "") 
parse(said, cmd,9, target,8, amount,6, rest,4) 

new player = cmd_target(id,target,8) 
new name[33] 
new name2[33] 
get_user_name(id,name,32) 
get_user_name(player,name2,32)		
new team[32] 
new team2[32] 
get_user_team(id,team,32) 
get_user_team(player,team2,32) 

if (equal(cmd, "/dajfragi", 9)) { 
	new Frags = set_user_frags(id) 
	new Frags2 = set_user_frags(player) 
	new frag = str_to_num(amount) 
	new bool:NoCantDo
	NoCantDo=false

	if (!is_user_alive(id)) { 
		if (get_cvar_num("set_user_frags")==0) { 
			client_print(id,print_center,"Nie mozesz dac fragow gdy niezyjesz")
			NoCantDo=true
		} 
	} 
	if (!is_user_alive(player)) { 
		if (get_cvar_num("set_user_frags")==0) {
				client_print(id,print_center,"Nie mozesz dac fragow dla niezywych")
				NoCantDo=true
		} 
	} 
	if (equal(name, name2)) { 
				client_print(id,print_center,"Nie mozesz dac sobie fragow")
				NoCantDo=true
		} 
	if (!equal(team, team2)) { 
		if (get_cvar_num("set_user_frags")==0) { 
				client_print(id,print_center,"Nie mozesz dac Fragow dla przeciwnej druzyny")
				NoCantDo=true
		} 
	} 
	if ((frags2 + frag) > 16000) { 
				client_print(id,print_center,"%s nie moze przyjac tylu fragow")
				NoCantDo=true
			} 
	if (frags < frag) { 
				client_print(id,print_center,"Nie masz tylu Fragow") 
				NoCantDo=true
			} 
	if (frag < 0) { 
		if (get_cvar_num("set_user_frags")==0) {
				client_print(id,print_center,"Nie mozesz Ukrasc %s's frags",name2)
				NoCantDo=true
			} 
	}
	if (!NoCantDo) {
		
		set_user_frags(id, frag - frag,1) 
		set_user_frags(player, frags2 + frag,1) 
		client_print(0,print_chat,"[AMX] %s dal %i $ dla %s. Podziekuj mu",name,frag,name2) 
		engclient_cmd(id,"say Dziekuje ci %s",name) 
		}
	} 
return PLUGIN_CONTINUE 
}

a z komplikatora :
home/groups/amxmodx/tmp3/phpShinB2.sma(38) : error 088: number of arguments does not match definition
/home/groups/amxmodx/tmp3/phpShinB2.sma(39) : error 088: number of arguments does not match definition
/home/groups/amxmodx/tmp3/phpShinB2.sma(66) : error 017: undefined symbol "frags2"
/home/groups/amxmodx/tmp3/phpShinB2.sma(70) : error 017: undefined symbol "frags"
/home/groups/amxmodx/tmp3/phpShinB2.sma(82) : error 088: number of arguments does not match definition
/home/groups/amxmodx/tmp3/phpShinB2.sma(83) : error 017: undefined symbol "frags2"
/home/groups/amxmodx/tmp3/phpShinB2.sma(83) : warning 215: expression has no effect
/home/groups/amxmodx/tmp3/phpShinB2.sma(83) : warning 215: expression has no effect
/home/groups/amxmodx/tmp3/phpShinB2.sma(83) : error 001: expected token: ";", but found ")"
/home/groups/amxmodx/tmp3/phpShinB2.sma(83) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp3/phpShinB2.sma(83) : fatal error 107: too many error messages on one line

Compilation aborted.
9 Errors.
Done.

ok sory za ewentualny spam ... ;/ ale zalezy mi na tym pluginie ... i juz zrobilem do 4 bledow tylko :) plugin :
#include <amxmod> 
#include <amxmisc> 
#include <fun>

public plugin_init() {  
	register_plugin("Dawanie Fragow","1","ghn")  
	register_concmd("say","handle_say",ADMIN_USER) 
	register_concmd("say_team","handle_say",ADMIN_USER) 
	register_cvar("set_user_frags","1",0) 
	register_cvar("set_user_deaths","1",0) 
	register_cvar("set_user_score","1",0) 
	return PLUGIN_CONTINUE  
} 

public handle_say(id) { 

new said[31] 
new cmd[10] 
new target[9] 
new amount[7] 
new rest[5] 
		 
read_args(said, 30) 
replace(said, 30, "^"", "") 
parse(said, cmd,9, target,8, amount,6, rest,4) 

new player = cmd_target(id,target,8) 
new name[33] 
new name2[33] 
get_user_name(id,name,32) 
get_user_name(player,name2,32)		
new team[32] 
new team2[32] 
get_user_team(id,team,32) 
get_user_team(player,team2,32) 

if (equal(cmd, "/dajfragi", 9)) { 
	new frags = set_user_frags(id) 
	new frags2 = set_user_frags(player) 
	new frag = str_to_num(amount) 
	new bool:NoCantDo
	NoCantDo=false

	if (!is_user_alive(id)) { 
		if (get_cvar_num("set_user_frags")==0) { 
			client_print(id,print_center,"Nie mozesz dac fragow gdy niezyjesz")
			NoCantDo=true
		} 
	} 
	if (!is_user_alive(player)) { 
		if (get_cvar_num("set_user_frags")==0) {
				client_print(id,print_center,"Nie mozesz dac fragow dla niezywych")
				NoCantDo=true
		} 
	} 
	if (equal(name, name2)) { 
				client_print(id,print_center,"Nie mozesz dac sobie fragow")
				NoCantDo=true
		} 
	if (!equal(team, team2)) { 
		if (get_cvar_num("set_user_frags")==0) { 
				client_print(id,print_center,"Nie mozesz dac Fragow dla przeciwnej druzyny")
				NoCantDo=true
		} 
	} 
	if ((frags2 + frag) > 16000) { 
				client_print(id,print_center,"%s nie moze przyjac tylu fragow")
				NoCantDo=true
			} 
	if (frags < frag) { 
				client_print(id,print_center,"Nie masz tylu Fragow") 
				NoCantDo=true
			} 
	if (frag < 0) { 
		if (get_cvar_num("set_user_frags")==0) {
				client_print(id,print_center,"Nie mozesz Ukrasc %s's frags",name2)
				NoCantDo=true
			} 
	}
	if (!NoCantDo) {
		
		set_user_frags(id, frag - frag,1) 
		set_user_frags(player, frags2 + frag,1) 
		client_print(0,print_chat,"[AMX] %s dal %i $ dla %s. Podziekuj mu",name,frag,name2) 
		engclient_cmd(id,"say Dziekuje ci %s",name) 
		}
	} 
return PLUGIN_CONTINUE 
}

kompilator :
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/home/groups/amxmodx/tmp3/phpZlmcat.sma(38) : error 088: number of arguments does not match definition
/home/groups/amxmodx/tmp3/phpZlmcat.sma(39) : error 088: number of arguments does not match definition
/home/groups/amxmodx/tmp3/phpZlmcat.sma(82) : error 088: number of arguments does not match definition
/home/groups/amxmodx/tmp3/phpZlmcat.sma(83) : error 088: number of arguments does not match definition

4 Errors.
Could not locate output file /home/groups/amxmodx/public_html/websc3/phpZlmcat.amx (compile failed).


839159 successful compiles to date.
604367 failed compiles to date.
Old compiler: 101980 compiles before decommission.
This tool by: David "BAILOPAN" Anderson.

Użytkownik Szary322 edytował ten post 03.02.2010 20:17

  • +
  • -
  • 0

#4 Miczu

    Godlike

  • Przyjaciel

Reputacja: 657
Wszechmogący

  • Postów:2 862
Offline

Napisano 03.02.2010 22:23

new frags = set_user_frags(id) 
new frags2 = set_user_frags(player)

Jak chcesz pobrac dane to chyba get a nie set - set pozatym uzywa wiekszej ilosci argumentow, co jest w errorach wyswietlane...
  • +
  • -
  • 0

#5 Szary322

    Życzliwy

  • Autor tematu
  • Użytkownik

Reputacja: 3
Nowy

  • Postów:34
  • GG:
  • Lokalizacja:Białystok
Offline

Napisano 03.02.2010 23:29

poprawilem z "set" na "get" ale mimo wszystko wyskakuja 2 bledy :
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/home/groups/amxmodx/tmp3/phpgqDudB.sma(82) : error 088: number of arguments does not match definition
/home/groups/amxmodx/tmp3/phpgqDudB.sma(83) : error 088: number of arguments does not match definition

2 Errors.
Could not locate output file /home/groups/amxmodx/public_html/websc3/phpgqDudB.amx (compile failed).


839270 successful compiles to date.
604411 failed compiles to date.
Old compiler: 101980 compiles before decommission.
This tool by: David "BAILOPAN" Anderson.

dopiero sie ucze pisac ;/ wiec jakos jeszcze dokonca tego nie lapie ,ale idzie mi coraz lepiej :)

a tutaj to co teraz mam z pluginu :
#include <amxmod> 
#include <amxmisc> 
#include <fun>

public plugin_init() {  
	register_plugin("Dawanie Fragow","1","ghn")  
	register_concmd("say","handle_say",ADMIN_USER) 
	register_concmd("say_team","handle_say",ADMIN_USER) 
	register_cvar("get_user_frags","1",0) 
	register_cvar("get_user_deaths","1",0) 
	register_cvar("get_user_score","1",0) 
	return PLUGIN_CONTINUE  
} 

public handle_say(id) { 

new said[31] 
new cmd[10] 
new target[9] 
new amount[7] 
new rest[5] 
		 
read_args(said, 30) 
replace(said, 30, "^"", "") 
parse(said, cmd,9, target,8, amount,6, rest,4) 

new player = cmd_target(id,target,8) 
new name[33] 
new name2[33] 
get_user_name(id,name,32) 
get_user_name(player,name2,32)		
new team[32] 
new team2[32] 
get_user_team(id,team,32) 
get_user_team(player,team2,32) 

if (equal(cmd, "/dajfragi", 9)) { 
	new frags = get_user_frags(id) 
	new frags2 = get_user_frags(player) 
	new frag = str_to_num(amount) 
	new bool:NoCantDo
	NoCantDo=false

	if (!is_user_alive(id)) { 
		if (get_cvar_num("get_user_frags")==0) { 
			client_print(id,print_center,"Nie mozesz dac fragow gdy niezyjesz")
			NoCantDo=true
		} 
	} 
	if (!is_user_alive(player)) { 
		if (get_cvar_num("get_user_frags")==0) {
				client_print(id,print_center,"Nie mozesz dac fragow dla niezywych")
				NoCantDo=true
		} 
	} 
	if (equal(name, name2)) { 
				client_print(id,print_center,"Nie mozesz dac sobie fragow")
				NoCantDo=true
		} 
	if (!equal(team, team2)) { 
		if (get_cvar_num("get_user_frags")==0) { 
				client_print(id,print_center,"Nie mozesz dac Fragow dla przeciwnej druzyny")
				NoCantDo=true
		} 
	} 
	if ((frags2 + frag) > 16000) { 
				client_print(id,print_center,"%s nie moze przyjac tylu fragow")
				NoCantDo=true
			} 
	if (frags < frag) { 
				client_print(id,print_center,"Nie masz tylu Fragow") 
				NoCantDo=true
			} 
	if (frag < 0) { 
		if (get_cvar_num("get_user_frags")==0) {
				client_print(id,print_center,"Nie mozesz Ukrasc %s's frags",name2)
				NoCantDo=true
			} 
	}
	if (!NoCantDo) {
		
		get_user_frags(id, frag - frag,1) 
		get_user_frags(player, frags2 + frag,1) 
		client_print(0,print_chat,"[AMX] %s dal %i $ dla %s. Podziekuj mu",name,frag,name2) 
		engclient_cmd(id,"say Dziekuje ci %s",name) 
		}
	} 
return PLUGIN_CONTINUE 
}

moglby ktos mniej wiecej pokazac w ktorym miejscu robie blad ? ;/
  • +
  • -
  • 0

#6 Miczu

    Godlike

  • Przyjaciel

Reputacja: 657
Wszechmogący

  • Postów:2 862
Offline

Napisano 04.02.2010 00:21

get_user_frags(id, frag - frag,1) 
get_user_frags(player, frags2 + frag,1)

Tutaj chiales uzyc set, bo ustalasz nowe wartosci fragow graczy.
Poza tym set_user_frags ma tylko 2 parametry a nie 3 - id gracza i nowa liczba fragow.
  • +
  • -
  • 0

#7 Szary322

    Życzliwy

  • Autor tematu
  • Użytkownik

Reputacja: 3
Nowy

  • Postów:34
  • GG:
  • Lokalizacja:Białystok
Offline

Napisano 04.02.2010 00:43

czyli mam to :
get_user_frags(id, frag - frag,1) 
		get_user_frags(player, frags2 + frag,1)

zamienic na :
get_user_frags(id, frag,1) 
		get_user_frags(player, frags2,1)
????
bo juz nie rozumiem ;ppp
  • +
  • -
  • 0

#8 Miczu

    Godlike

  • Przyjaciel

Reputacja: 657
Wszechmogący

  • Postów:2 862
Offline

Napisano 04.02.2010 00:59

get_user_frags(id, frag - frag,1) 
get_user_frags(player, frags2 + frag,1)

na

set_user_frags(id, frag - frag) 
set_user_frags(player, frags2 + frag)

  • +
  • -
  • 1




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

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