Raised This Month: $ Target: $400
 0% 

Deutsche Scripting-Hilfe


  
 
 
Thread Tools Display Modes
|PJ| Shorty
Veteran Member
Join Date: Aug 2005
Location: Bavaria, Germany
Old 01-12-2009 , 16:18   Re: Deutsche Scripting-Hilfe
#111

Quelle: http://www.amxmodx.org/funcwiki.php?go=func&id=123
Code:
Notes: 
Speed is reset on weapon change
 
Users speed is limited by: 
servers max speed cvar - sv_maxspeed 
client side max speed cvars - cl_forwardspeed, cl_backspeed, cl_sidespeed (default for cs is 400.0) 
 
(Max running speed at least for cs is 2000.0)
musst also den weapon change abfangen und danach speed wieder neu setzen.
Code:
 
register_event("CurWeapon", "Event_ChangeWeapon", "be", "1=0")
__________________
There are only 10 types of people in the world:
Those who understand binary, and those who don´t.

Last edited by |PJ| Shorty; 01-12-2009 at 16:33.
|PJ| Shorty is offline
Send a message via ICQ to |PJ| Shorty Send a message via AIM to |PJ| Shorty Send a message via MSN to |PJ| Shorty Send a message via Yahoo to |PJ| Shorty Send a message via Skype™ to |PJ| Shorty
bmp
Senior Member
Join Date: Nov 2007
Location: Berlin, Germany
Old 01-13-2009 , 12:28   Re: Deutsche Scripting-Hilfe
#112

wenn das der beste weg ist, kann ich ja froh sein ;)
das hab ich bei wc3 mir so abgeschaut ... nach stundenlanger sucher *hmpf*

danke dir
bmp is offline
Schlesie
Senior Member
Join Date: May 2005
Location: Wiesbaden
Old 01-19-2009 , 14:37   Re: Deutsche Scripting-Hilfe
#113

Quote:
Originally Posted by |PJ| Shorty View Post
dbi war vor meiner zeit, hier mal ein beispiel mit sqlx.
es fehlt eigentlich nur das "db prune", alles andere sollte funktionieren.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <sqlx>
new Handle:dbc;
new 
g_Cache[1024];
new 
g_authid[33][35]
public 
plugin_init() {
 
register_plugin("FrequentFraggerProgram","4.7","Slurpy [COF]")
 
register_cvar("FreqFragProg""4.7",FCVAR_SERVER)
}
public 
plugin_cfg() {
 
set_task(1.0,"sql_init")
}
public 
sql_init() {
 new 
host[64], username[32], password[32], dbname[32];
 
//no pcvar, only called once at plugin start
 
get_cvar_string("amx_sql_host",host,64);
 
get_cvar_string("amx_sql_user",username,32);
 
get_cvar_string("amx_sql_pass",password,32);
 
get_cvar_string("amx_sql_db",dbname,32);
 
 
SQL_SetAffinity("mysql");
 
dbc SQL_MakeDbTuple(host,username,password,dbname);
 
 
formatex(g_Cache,1023,"CREATE TABLE IF NOT EXISTS `freqfragger` (\
  `lastname` VARCHAR(32) NOT NULL,`steamid` VARCHAR(35) NOT NULL,\
  `connecttime` INT NOT NULL,`totalkills` INT NOT NULL,\
  `totaldeaths` INT NOT NULL,`date` TIMESTAMP NOT NULL, PRIMARY KEY(`steamid`))"
)
 
SQL_ThreadQuery(dbc,"TableHandle",g_Cache); 
}
public 
client_authorized(id) {
 
get_user_authid(id,g_authid[id],charsmax(g_authid[]))
}
public 
client_disconnect(id){  
 if ( 
is_user_bot(id) || is_user_hltv(id) ) 
  return 
PLUGIN_CONTINUE
 
 
new playtime get_user_time (id,1); //1=without connection time
 
 
new player_name[32]
 
get_user_name(id,player_name,31)
 
 new 
deaths=get_user_deaths(id)
 new 
kills=get_user_frags(id)
 
 
formatex(g_Cache,1023,"INSERT INTO freqfragger \
  (lastname, steamid, connecttime, totalkills, totaldeaths, date) \
  values ('%s','%s',%i,%i,%i,NOW()) ON DUPLICATE KEY UPDATE \
  lastname='%s', connecttime=connecttime+%i, totalkills=totalkills+%i, \
  totaldeaths=totaldeaths+%i, date=NOW() \
  WHERE steamid='%s'"
, \
  
player_name,g_authid[id],playtime,kills,deaths, \
  
player_name,playtime,kills,deaths,g_authid[id])
 
 
SQL_ThreadQuery(dbc,"TableHandle",g_Cache);
 return 
PLUGIN_CONTINUE
}
public 
TableHandle(FailState,Handle:Query,Error[],Errcode,Data[],DataSize,Float:QueryTime)
{
 
// lots of error checking
 
if(FailState == TQUERY_CONNECT_FAILED)
  return 
log_amx("Could not connect to SQL database.");
 else if(
FailState == TQUERY_QUERY_FAILED)
  return 
log_amx("SQL Table Query failed.");
 if(
Errcode)
  return 
log_amx("SQL Error on table query: %s",Error);
 
 return 
PLUGIN_CONTINUE;
}
public 
plugin_end() {
 
SQL_FreeHandle(dbc)

Nochmal danke für die Hilfe, bin nun endlich dazu gekommen es zu testen. Datenbank wird nun angelegt, aber es werden keine Daten eingetragen.
__________________
Schlesie is offline
Send a message via ICQ to Schlesie
|PJ| Shorty
Veteran Member
Join Date: Aug 2005
Location: Bavaria, Germany
Old 01-19-2009 , 17:35   Re: Deutsche Scripting-Hilfe
#114

irgendwelche error meldungen?
mysql server muss min. v4.1 sein
__________________
There are only 10 types of people in the world:
Those who understand binary, and those who don´t.
|PJ| Shorty is offline
Send a message via ICQ to |PJ| Shorty Send a message via AIM to |PJ| Shorty Send a message via MSN to |PJ| Shorty Send a message via Yahoo to |PJ| Shorty Send a message via Skype™ to |PJ| Shorty
Schlesie
Senior Member
Join Date: May 2005
Location: Wiesbaden
Old 01-20-2009 , 05:19   Re: Deutsche Scripting-Hilfe
#115

nein nichts, weder in den amxx-logs, noch in den normalen. Mysql hab ich Version 5.0.32.

Edit: hab jetzt doch was gefunden

L 01/19/2009 - 23:40:45: [stammie.amxx] SQL Table Query failed.

Das wars aber auch schon, trotz "debug" gibts keine weiteren Meldungen
__________________

Last edited by Schlesie; 01-20-2009 at 05:23.
Schlesie is offline
Send a message via ICQ to Schlesie
|PJ| Shorty
Veteran Member
Join Date: Aug 2005
Location: Bavaria, Germany
Old 01-20-2009 , 15:45   Re: Deutsche Scripting-Hilfe
#116

scheint der query nicht zu passen, probier den mal manuell aus in phpmyadmin z.b.
__________________
There are only 10 types of people in the world:
Those who understand binary, and those who don´t.
|PJ| Shorty is offline
Send a message via ICQ to |PJ| Shorty Send a message via AIM to |PJ| Shorty Send a message via MSN to |PJ| Shorty Send a message via Yahoo to |PJ| Shorty Send a message via Skype™ to |PJ| Shorty
Schlesie
Senior Member
Join Date: May 2005
Location: Wiesbaden
Old 01-21-2009 , 13:48   Re: Deutsche Scripting-Hilfe
#117

Code:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\ (lastname, steamid, connecttime, totalkills, totaldeaths, date) \ valu' at line 1
__________________
Schlesie is offline
Send a message via ICQ to Schlesie
|PJ| Shorty
Veteran Member
Join Date: Aug 2005
Location: Bavaria, Germany
Old 01-21-2009 , 15:46   Re: Deutsche Scripting-Hilfe
#118

ersetz mal entsprechenden code mit dem:
PHP Code:
formatex(g_Cache,1023,"INSERT INTO freqfragger \ 
  (lastname, steamid, connecttime, totalkills, totaldeaths, date) \ 
  values ('%s','%s',%i,%i,%i,NOW()) ON DUPLICATE KEY UPDATE \ 
  lastname='%s', connecttime=connecttime+%i, totalkills=totalkills+%i, \ 
  totaldeaths=totaldeaths+%i, date=NOW()"
,  
  
player_name,g_authid[id],playtime,kills,deaths,  
  
player_name,playtime,kills,deaths
__________________
There are only 10 types of people in the world:
Those who understand binary, and those who don´t.
|PJ| Shorty is offline
Send a message via ICQ to |PJ| Shorty Send a message via AIM to |PJ| Shorty Send a message via MSN to |PJ| Shorty Send a message via Yahoo to |PJ| Shorty Send a message via Skype™ to |PJ| Shorty
Schlesie
Senior Member
Join Date: May 2005
Location: Wiesbaden
Old 01-23-2009 , 11:06   Re: Deutsche Scripting-Hilfe
#119

danke funktioniert
__________________
Schlesie is offline
Send a message via ICQ to Schlesie
bmp
Senior Member
Join Date: Nov 2007
Location: Berlin, Germany
Old 01-24-2009 , 08:05   Re: Deutsche Scripting-Hilfe
#120

in der console tauchen ständig meldungen wie diese auf:

Code:
S_LoadSound: Couldn't load /vox/wav.wav
S_LoadSound: Couldn't load /zombie_plague/_period.wav
S_LoadSound: Couldn't load /ambience/_period.wav
S_LoadSound: Couldn't load /ambience/_period.wav
die letzten 3 hab ich einfach mal aus den steam-sounds (*.gfc) auf den server raufkopiert, allerdings ohne den gewünschten erfolg. mit dem ersten sound kann ich absolut nix anfangen. weiß jemand welches plugin darauf versucht zuzugreifen?

Code:
WARNING! zombie_plague/zombie_pain4.wav is causing runtime sample conversion
ich glaub, der sound wird dennoch abgespielt. aber was genau passiert da? wie kann ich das korrigieren/reparieren?

bin für jede anregung dankbar

Last edited by bmp; 01-25-2009 at 05:45.
bmp is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:59.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode