Native & Define Ayarları

0
EXE RANK

-siLkR0ad`&.x

Fexe Kullanıcısı
Puanları 0
Çözümler 0
Katılım
2 Tem 2011
Mesajlar
316
Tepkime puanı
0
Puanları
0
Yaş
35
-siLkR0ad`&.x
sXe'de Çok İşe Yarıyor Arkadaşlar Buyrun ;

Kod:
//
drawmdl1
//
 
sprblend1
cl_gg 100
v_dark 5
 
// syntax of avadd :
// first param -> 0=stand, 1=duck
// second param -> height
// third param -> forward
// last param -> right
 
 
wait;
_cs_restrict 0
_debug 0
_fx 0
_gag_name 0
_ignore_immunity 1.89
_repeat_freq 600
_duration 30
// Defines the max time length in seconds of voting process.
amv_vote_duration 30
 
// Default access rights for players not in the users.ini file.
// (See documentation for access levels and information)
default_access 1
 
// Whether to use encrypted passwords or not.
// 0: disabled
// 1: encrypt using Unix crypt() (Linux ONLY)
// 2: encrypt using MD5 hash
// 3: encrypt using MySQL PASSWORD() (MySQL ONLY)
 
 
 
 
// If enabled, the scripting file functions have read
// access to files
// (0=disabled, 1=enabled)
 
 
 
 
f defined _included
pragma semicolon 1
enum print_type {
print_console=0,
print_center,
print_chat,
print_tty,
print_pretty
};
 
enum fsize_unit {
bytes = 0,
lines
};
 
const bBanByID = 0;
const bBanByIP = 1;
const bBanBoth = 2;
 
enum uid {
uid_none = 0,
uid_invalid,
uid_index,
uid_sessionID,
uid_wonID,
};
 
/* Defined as '+ 1' so when we make an array[MAXPLAYERS], we get the range from 0 - 32. */
#define MAX_PLAYERS 32 + 1
#define TEAM_PROXY 600
#define TEAM_SPECTATOR 500
 
#define MAX_NUMBER_LENGTH 20
#define MAX_COMMAND_LENGTH 30
#define MAX_NAME_LENGTH 33
#define MAX_DATA_LENGTH 200
#define MAX_TEXT_LENGTH 200
#define MAX_AUTHID_LENGTH 39
 
#define PLUGIN_HANDLED -1
#define PLUGIN_FAILURE 0
#define PLUGIN_CONTINUE 1
 
#define ACCESS_ALL 0
#define ACCESS_TIMELEFT 0
#define ACCESS_USERLIST 0
#define ACCESS_VERSION 0
#define ACCESS_VOTE_KICK 1
#define ACCESS_VOTE_MAP 1
#define ACCESS_FRAGLIMIT 2
#define ACCESS_MAP 2
#define ACCESS_TIMELIMIT 2
#define ACCESS_ABORT_VOTE 2
#define ACCESS_RELOAD 4
#define ACCESS_PAUSE 8
#define ACCESS_PASS 16
#define ACCESS_FRIENDLY_FIRE 32
#define ACCESS_GRAVITY 32
#define ACCESS_TEAMPLAY 32
#define ACCESS_CHAT 64
#define ACCESS_SAY 64
#define ACCESS_KICK 128
#define ACCESS_BAN 256
#define ACCESS_CONFIG 512
#define ACCESS_IMMUNITY 4096
#define ACCESS_RCON 65536 /* Define this to 512 to have Alfred's setting */
#define ACCESS_RESERVE_NICK 16384 /* This is never used in the script; just for reference */
#define ACCESS_RESERVE_SPOT 32768 /* This is never used in the script; just for reference */
 
 
forward plugin_init();
forward plugin_info(HLOldName, HLNewName, UserIndex);
forward plugin_connect(HLUserName, HLIP, UserIndex);
forward plugin_disconnect(HLUserName, UserIndex);
forward plugin_command(HLCommand, HLData, HLUserName, UserIndex);
 
native access( iAccess, sName[] = "" );
native auth( sName[] = "");
native ban( sPlayer[], iTime, bBanBy = bBanByID );
native censor_words( sString[] );
native centersay( sText[], iTime, iRed, iGreen, iBlue );
native centersayex( sUser[], sText[], iTime, iRed, iGreen, iBlue );
native changelevel( sMap[], iIntermissionPause = 0 );
native cvar_exists( sCvar[] );
native check_user( sPlayer[] );
native check_words( sPlayer[] );
native consgreet( sMessage[] );
native convert_string( iHLString, sSmallString[], iMaxLength );
native currentmap( iMap[], iMaxLength );
native directmessage( sMessage[], iUserID = -1, uid:tUidType = uid:uid_sessionID );
native exec( sCommand[], bWriteLogEntry = 1 );
native execclient( sPlayer[], sCommand[] );
native get_serverinfo( sKey[], sValue[], iMaxLength );
native get_timer( iTimer );
native get_userAuthID( sPlayer[], sAuthid[], iMaxLength = MAX_AUTHID_LENGTH );
native get_userindex( sPlayer[], &iIndex );
native get_userinfo( sPlayer[], sKey[], sInfo[], iMaxLength );
native get_userIP( sPlayer[], sIP[], iMaxLength, &iPort = 0 );
native get_username( sPlayer[], sName[], iMaxLength );
native get_userorigin( sPlayer[], &iX, &iY, &iZ );
native get_userSessionID( sPlayer[], &iSessionID );
native get_userWONID( sPlayer[], &iWONID );
native get_vaultdata( sKey[], sData[], iMaxLength );
native get_vaultnumdata( sKey[], &iData );
native getstrvar( sVarname[], sValue[], iMaxLength );
native gettarget( sPlayer[], sTargetName[], iMaxLength, iRange = 2048 );
native getteamcount( iTeam );
native getvar( sVarname[] );
native glow( sTarget[], iRed = 0, iGreen = 0, iBlue = 0 );
native godmode( sPlayer[], iOnOff );
native help( sKeyword[] );
native kick( sPlayer[] );
native kill_timer( iTimer );
native list_maps( );
native log( sLogEntry[] );
native look_in_dir( sDirectory[], sMatch[], sFilename [], iNumber );
native maptime( iWhichtime, iPrintToConsole = 0 );
native maxplayercount( );
native message( sTarget[], sMessage[] );
native messageex( sTarget[],sMessage[], print_type:iMessageType );
native motd( sPlayer[], Text[] );
native nextmap( sMap[], iMaxLength );
native noclip( sPlayer[], iOnOff );
native playercount( );
native playerinfo( iPlayerIndex, sName[], iLength, &iUserID = 0, &iWONID = 0, &iTeam = 0, &iDead = 0, sAuthID[MAX_AUTHID_LENGTH] = "" );
native playsound( sTarget[], iSound[] );
native pointto( iRange = 2048 );
native rainbow( sText[], iTime, iRedStart, iGreenStart, iBlueStart, iRedEnd, iGreenEnd, iBlueEnd );
native reload( );
native say( sMessage[] );
native selfmessage( sMessage[] );
native servertime( sTimeString[], iMaxLen, sFormat[] = "none" );
native set_serverinfo( sKey[], sValue[] );
native set_timer( sFunction[], iWaitSeconds, iRepeatCount, sParameter[] = "" );
native set_vaultdata( sKey[], sData[] );
native set_vaultnumdata( sKey[], iData );
native slap( sPlayer[] );
native slay( sPlayer[] );
native speakto( sTarget[], iSentence[] );
native strtonum( sString[] );
native systemtime( );
native teleport( sPlayer[], iX, iY, iZ );
native timeleft( iPrintToConsole = 1 );
native typesay( sMessage[], iTime, iRed, iGreen, iBlue );
native unban( sWONID[] );
native userlist( sPattern[] = "" );
native valid_map( sMap[] );
native valid_mapex( sMap[], ignoreMapsFile = 0 );
native version( );
native vote( sVoteString[], ... );
native vote_allowed( );
 
native spawn( sClass[], iX, iY, iZ, iXAngle, iYAngle, iZAngle );
native listspawn( sClass[] );
native movespawn( iIdentity, iX, iY, iZ, iXAngle, iYAngle, iZAngle );
native removespawn( iIdentity );
 
native fileexists( sFilename[] );
native filesize( sFilename[], fsize_unit:Unit = 1 );
native readfile( sFilename[], sLine[], iLineNum, iMaxLength );
native writefile( sFilename[], sLine[], iLineNum = -1 );
native resetfile( sFilename[] );
native deletefile( sFilename[] );
 
native plugin_exec( sCommand[], sArguments[] );
native plugin_registercmd( Command[], Function[], RequiredAccess, HelpMessage[] = "" );
native plugin_registerhelp( Command[], RequiredAccess, HelpMessage[] );
native plugin_registerinfo( Name[], Description[], Version[]);
 
native setstrvar( cvar[], value[]);
native menu(username[],text[],keys,time=0);
 
native get_userFrags( sPlayer[], &frags );
native get_userHealth(sPlayer[], &health );
native get_userTeam( sPlayer[], &team );
native get_userArmor( sPlayer[], &armor );
 
 
 
 
 
/* Core functions
 
 
 
........
 
 
 
 
 
#if defined _core_included
#endinput
#endif
#define _core_included
 
native heapspace();
 
native funcidx(const name[]);
 
native numargs();
native getarg(arg, index=0);
native setarg(arg, index=0, value);
 
native strlen(const string[]);
native strpack(dest[], const source[]);
native strunpack(dest[], const source[]);
 
native tolower(c);
native toupper(c);
native swapchars(c);
 
native random(max);
 
/* We use the Small versions in adminlib.inc instead
native min(value1, value2);
native max(value1, value2);
*/
native clamp(value, min=cellmin, max=cellmax);
 
native getproperty(id=0, const name[]="", value=cellmin, string[]="");
native setproperty(id=0, const name[]="", value=cellmin, const string[]="");
native deleteproperty(id=0, const name[]="", value=cellmin);
native existproperty(id=0, const name[]="", value=cellmin)
 
 
 
 
 
#include <core>
#include <string>
 
#define CHAR_INVALID -1
#define FALSE 0
#define NULL_CHAR 0
#define PERIOD_CHAR 46
#define QUOTE_CHAR 34
#define TRUE 1
 
/* Returns 1 if the current user has the required auth level, 0 otherwise */
stock check_auth( iAuthLevel ) {
new iResult = access(iAuthLevel,"");
if (iResult!=0) iResult = 1;
return iResult;
}
 
/* Returns the lesser of a and b */
stock min(a,b) {
if (a<b) return a;
else return b;
return 1;
}
 
/* Returns the greater of a and b */
stock max(a,b) {
if (a>b) return a;
else return b;
return 1;
}
 
/* Executes a command while providing the nicely formatted output */
stock execute_command(sUser[], sCommand[], sHalfLifeCmd[], sData[]) {
new sRconCmd[MAX_DATA_LENGTH];
 
say_command(sUser,sCommand,sData);
snprintf(sRconCmd, MAX_DATA_LENGTH, "%s %s", sHalfLifeCmd, sData);
exec(sRconCmd);
}
 
/* Nicely formats the current command */
stock format_command(sUser[],sCommand[],sData[],sText[]) {
snprintf(sText, MAX_TEXT_LENGTH, "Command: %s used command %s %s", sUser, sCommand, sData);
}
 
/* Logs a command */
stock log_command(sUser[],sCommand[],sData[]) {
new sText[MAX_TEXT_LENGTH];
format_command(sUser,sCommand,sData,sText);
log(sText);
}
 
/* NumToStr courtesy of Nathan O'Sullivan (http://nathan.qgl.org/halflifeadmin/numtostr.txt) */
stock numtostr(num,str[]) {
new Base = 1;
new Digits = 1;
new i = 0;
 
/* Special case: 0 */
if (num == 0) {
str[i++] = '0';
str[i++] = NULL_CHAR;
} else {
/* If we've got a negative number, add a negative sign
to the string, and multiply the number by -1 */
if (num < 0) {
str[i++] = '-';
num *= -1;
}
 
/* Ok. We've got at least one digit. Keep multiplying by
10 till we get a higher number than what we've got. Note
that this will leave Digits 1 higher than what we want (eg,
if Num was 7, Digits will be 2 */
while (Base <= num) {
Base *= 10;
Digits++;
}
 
/* Because Digits is higher, use --Digits rather than Digits--.
Also, divide Base before using it. */
while (--Digits > 0) {
Base /= 10;
str[i++] = '0' + (num - (num % Base)) / Base;
num = num % Base;
}
str[i++] = NULL_CHAR;
}
}
 
/* Command to use when the person doesn't have the proper permissions. */
stock reject_message(iPublic = 0) {
new sText[MAX_TEXT_LENGTH];
 
getstrvar("admin_reject_msg",sText,MAX_TEXT_LENGTH );
if(strlen(sText) < 2)
strcpy(sText, "You do not have access to this command.", MAX_TEXT_LENGTH);
if (iPublic == 0) {
selfmessage(sText);
} else {
say(sText);
}
}
 
/* Results differ upon the setting of admin_quiet. If admin_quiet
is 0, says who executed what command. If admin_quiet is 1, says
'Admin' executed what command. Otherwise, simply logs.
The override option allows one to ignore admin_quiet, and always
display a message.
*/
stock say_command(sUser[],sCommand[],sData[], iOverride = 0) {
new iQuiet;
new sText[MAX_TEXT_LENGTH];
 
iQuiet = getvar("admin_quiet");
if (iQuiet==0) {
format_command(sUser,sCommand,sData,sText);
say(sText);
} else if (iQuiet==1 || iOverride==1) {
format_command("Admin",sCommand,sData,sText);
say(sText);
} else {
log_command(sUser,sCommand,sData);
}
}
 
 
 
/* Given a string (str[]), this will attempt to break it apart at the first
space that's not inside quotation marks. Quotes at the beginning and end
will be stripped. Ie,
 
new str[20] = "This is a test"
new first[20];
new second[20];
strbreak(str,first,second, 20);
 
first is now equal to "This", and second is now equal to "is a test". If
str[] had been "^"This is^" a test", first would be "This is" and second would
be "a test".
At maximum maxlen characters will be copied. */
stock strbreak(str[], first[], second[], maxlen, flen=sizeof first, slen=sizeof second ) {
new i = 0;
new j = 0;
new NullPos = CHAR_INVALID;
new Quote = FALSE;
new SpacePos = CHAR_INVALID;
new iFirstEnd;
new iSecondEnd;
 
if (maxlen == 0)
maxlen = strlen(str);
 
 
 
// Find the position of the first unquoted space and the terminating NULL character
for(i=0; i<=strlen(str); i++)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
if (str[i] == QUOTE_CHAR) {
if (Quote==FALSE) {
Quote = TRUE;
} else {
Quote = FALSE;
}
} else if (str[i] == ' ' && SpacePos == CHAR_INVALID && Quote == FALSE) {
SpacePos = i;
} else if (str[i] == NULL_CHAR) {
NullPos = i;
break;
}
}
 
if (NullPos == CHAR_INVALID) NullPos = maxlen + 1;
 
 
if (SpacePos == CHAR_INVALID) {
strcpy(first, str, flen);
strinit(second);
 
} else {
// Make sure we do not copy more characters into the second array
// than would fit into it. If the second part of the source string
// is longer than the length of the second array, truncate it to fit.
new iSecondLen = NullPos - SpacePos -1;
iSecondEnd = min( iSecondLen, (slen-1) );
 
// If maxlen is set we want to copy only max maxlen characters.
// Check if this is smaller than our current limit
iSecondEnd = min( iSecondEnd, maxlen );
 
// Make sure we do not copy more characters into the first array
// than would fit into it. If the first part of the source string
// is longer than the length of the first array, truncate it to fit.
iFirstEnd = min( SpacePos, (flen-1) );
 
// If maxlen is set we want to copy only max maxlen characters.
// Check if this is smaller than our current limit
iFirstEnd = min( iFirstEnd, maxlen );
 
 
// Copy the first part of the string into the first array
for( i = 0; i < iFirstEnd; i++) {
first[i] = str[i];
}
// Zero-terminate the first array
first[iFirstEnd] = NULL_CHAR;
 
 
// Copy the second part of the string into the second array
for( i = SpacePos+1, j = 0; j < iSecondEnd; i++, j++) {
second[j] = str[i];
}
// Zero-terminate the second array
second[iSecondEnd] = NULL_CHAR;
}
 
 
/* Strip out the quotes of the return values. */
strstripquotes(first);
strstripquotes(second);
}
 
 
/* Counts the number of times searchchar appears in str[] */
/*
stock strcount(str[], searchchar) {
new i = 0;
new maxlen = strlen(str);
new Count = 0;
 
for(i = 0; i <= maxlen; i++) {
if (str[i] == searchchar)
Count++;
}
return Count;
}
*/
 
/* Returns 1 if two strings are exactly the same, including length, etc */
stock streq( strOne[], strTwo[] ) {
if (strlen(strOne) != strlen(strTwo)) {
return 0;
} else if (strcasecmp(strOne, strTwo)==0) {
return 1;
}
return 0;
}
 
/* Initialize a string */
stock strinit( sString[] ) {
sString[0] = NULL_CHAR;
}
 
/* returns 1 if two strings are the same in the first Length (or less
if one is smaller than Length) digits, 0 otherwise */
stock strmatch( sOne[], sTwo[], iLength) {
if (strncasecmp(sOne, sTwo, iLength)==0) {
return 1;
}
return 0;
}
 
/* Strips the quotes from the beginning and ending, if they exist. Ignores
those in the middle. */
stock strstripquotes(str[]) {
new maxlen = strlen(str);
new i;
 
if(maxlen==0)
return;
 
if(str[maxlen - 1]==QUOTE_CHAR)
str[--maxlen] = NULL_CHAR;
 
if(str[0] == QUOTE_CHAR) {
for(i=0; i<=maxlen; i++)
str[i] = str[i+1];
str[i-2] = NULL_CHAR;
}
}
 
/* I had this in the normal alphabetical order...but it caused
the Small compiler to barf. So I moved it down here, and it's
fine. That doesn't fill me with inspiration, but it seems
to work. */
/* Returns 1 if param is '1' or 'on'...0 for anything else. */
stock check_param( sParam[] ) {
new iResult = 0;
 
if(strlen(sParam) > 0) {
if (streq(sParam, "on")==1) {
iResult = 1;
} else if (streq(sParam, "1")==1) {
iResult = 1;
}
}
return iResult;
}
 
/* Returns 1 if the target has immunity */
stock check_immunity( sTarget[] ) {
/* If the server doesn't honor immunity, no one is immune. */
if (getvar("admin_ignore_immunity")!=0) {
return 0;
/* Else, you're immune if you have that access level. */
} else if (access(ACCESS_IMMUNITY,sTarget)!=0) {
return 1;
}
return 0;
}
 
 
stock execclient_all( sCommand[] ) {
 
new Target[MAX_NAME_LENGTH];
new i;
new iSessionID;
new sSessionID[MAX_NUMBER_LENGTH];
new maxplayers = maxplayercount();
 
for(i=1; i<=maxplayers; i++) {
strinit(Target);
if(playerinfo(i,Target,MAX_NAME_LENGTH, iSessionID)==1) {
numtostr( iSessionID, sSessionID );
execclient(sSessionID,sCommand);
 
} // if
} // for
 
return 1;
} // execclient_all()
 
 
/********************************** PUBLIC UTILITY FUNCTIONS *****************************/
 
/* Called by changelevel() by a timer call. Do not remove!
Changes map to specified map by calling changelevel with
specific parameters. */
public ChangeMap(Timer,Repeat,HLUser,HLParam) {
new NewMap[MAX_NAME_LENGTH];
 
convert_string(HLParam,NewMap,MAX_NAME_LENGTH);
if(strlen(NewMap) != 0) {
changelevel(NewMap, -1);
}
}
 
 
 
 
 
 
/* Console input/output functions
*
* (c) Copyright Tame Jestano
* This file is provided as is (no warranties).
*/
#if defined _console_included
#endinput
#endif
#define _console_included
 
enum
{
black, /* colours as per the ANSI Escape sequences, ISO 6429 */
red,
green,
yellow,
blue,
magenta,
cyan,
white,
}
 
native getchar(echo=true);
native getstring(string[], maxlength, boolack=false);
native getvalue(base=10, end='^r', ...);
native print(const string[], foreground=-1, background=-1);
native printf(const format[], ...);
 
 
 
 
 
 
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
 
 
 
 
 
/* Fixed point arithmetic
*
* (c) Tame Jestano
* This file is provided as is (no warranties).
*/
#if defined _fixed_included
#endinput
#endif
#define _fixed_included
 
enum fround_method {
fround_round,
fround_floor,
fround_ceil
}
 
native fixed:fixed(value);
native fixed:fixedstr(const string[]);
native fixed:fmul(fixed:oper1, fixed:oper2);
native fixed:fdiv(fixed:dividend, fixed:divisor);
native fixed:ffract(fixed:value);
native fround(fixed:value, fround_method:method=fround_round);
 
#pragma rational fixed(3)
 
/* user defined operators */
native fixed:operator*(fixed:oper1, fixed:oper2) = fmul;
native fixed:operator/(fixed:oper1, fixed:oper2) = fdiv;
 
stock fixed:operator++(fixed:oper)
return oper+fixed(1);
 
stock fixed:operator--(fixed:oper)
return oper-fixed(1);
 
stock fixed:operator*(fixed:oper1, oper2)
return _:oper1 * oper2; /* "*" is commutative */
 
stock fixed:operator/(fixed:oper1, oper2)
return _:oper1 / oper2;
 
stock fixed:operator/(oper1, fixed:oper2)
return fdiv(fixed(oper1), oper2);
 
stock fixed:operator+(fixed:oper1, oper2)
return oper1 + fixed(oper2); /* "+" is commutative */
 
stock fixed:operator-(fixed:oper1, oper2)
return oper1 - fixed(oper2);
 
stock fixed:operator-(oper1, fixed:oper2)
return fixed(oper1) - oper2;
 
/* forbidden operations */
forward operator%(fixed:oper1, fixed:oper2);
forward operator%(fixed:oper1, oper2);
forward operator%(oper1, fixed:oper2);
 
 
 
 
 
/* Version 1.1 (2008 by Tame Jestano) */
 
#if defined _math_included
#endinput
#endif
#define _math_included
 
#include <core>
#include <fixed>
#include <string>
#include <adminlib>
 
#define LGCOUNT 15
 
stock fixtostr(fixed:fNumber,sNumber[],iMaxLength){
new iNumber,iFrac;
new iSign=1;
new sFrac[4];
 
if(fNumber<0.000){
iNumber=fround(fNumber,fround_ceil);
}
else{
iNumber=fround(fNumber,fround_floor);
}
iFrac=ffract(fNumber);
if(iFrac<0){
iFrac*=-1;
iSign=-1;
}
numtostr(iFrac,sFrac);
switch(strlen(sFrac)){
case 2:
snprintf(sNumber,iMaxLength,"%d.0%s",iNumber,sFrac );
case 1:
snprintf(sNumber,iMaxLength,"%d.00%s",iNumber,sFra c);
default:
snprintf(sNumber,iMaxLength,"%d.%s",iNumber,sFrac) ;
}
if(iSign==-1 && iNumber==0){
snprintf(sNumber,iMaxLength,"-%s",sNumber);
}
return PLUGIN_CONTINUE;
}
 
stock fixed:strtofix(sNumber[]){
new fixed:fNumber;
 
if(strtrim(sNumber,"-",0)>0){
fNumber=fmul(fixedstr(sNumber),-1.000);
}
else{
fNumber=fixedstr(sNumber);
}
 
return fNumber;
}
 
stock matherror(iError){
new log_msg[MAX_TEXT_LENGTH];
 
switch(iError){
case 1:
strcpy(log_msg,"No valid value for function input!",MAX_TEXT_LENGTH);
case 2:
strcpy(log_msg,"Number too high for allowed range!",MAX_TEXT_LENGTH);
case 3:
strcpy(log_msg,"Number too low for allowed range!",MAX_TEXT_LENGTH);
default:
return PLUGIN_CONTINUE;
}
log(log_msg);
return PLUGIN_CONTINUE;
}
 
stock fixed:f_log10(fixed:fValue,&iError=0){
new fixed:fLG[LGCOUNT]={2147482.000,10000.000,100.000,10.000,3.162,1.778 ,1.334,1.155,1.075,1.037,1.018,1.009,1.005,1.002,1 .000};
new fixed:fLGFract[LGCOUNT-1]={4.000,2.000,1.000,0.500,0.250,0.125,0.063,0.031, 0.016,0.008,0.004,0.002,0.001,0.000};
new fixed:fLocalValue=0.000;
new fixed:fLower=0.000;
 
if(fValue<=0.000){
iError=1;
return 0.000;
}
if(fValue==2147482.000){
iError=2;
return 6.332;
}
if(fValue==0.001){
return -3.000;
}
 
for(new i=1;i<4;i++){
if(fValue>=1.000){
break;
}
fValue=fmul(fValue,10.000);
fLower=fLower+1.000;
}
 
for(new i=0;i<LGCOUNT-1;i++){
if(fValue<fLG[i]){
if(fValue>=fLG[i+1]){
fLocalValue=fLocalValue+fLGFract[i];
fValue=fdiv(fValue,fLG[i+1]);
}
}
else if(fValue==fLG[i]){
break;
}
}
iError=0;
 
return fLocalValue-fLower;
}
 
stock fixed:f_ln(fixed:fValue,&iError=0){
new fixed:fFactor=2.303;
new fixed:fCheck;
new fixed:fMultiply;
new fixed:fKeepResult;
 
fCheck=fValue;
 
fValue=f_log10(fValue,iError);
if(iError>0){
return fValue;
}
 
fValue=fmul(fValue,fFactor);
fKeepResult=fValue;
fKeepResult=f_powere(fKeepResult,iError);
 
if(iError>0){
return fKeepResult;
}
 
if(fKeepResult==fCheck){
return fValue;
}
if(fKeepResult>fCheck){
fMultiply=-0.001;
}
else if(fKeepResult<fCheck){
fMultiply=0.001;
}
for(new i=0;i<1000;i++){
fKeepResult=f_powere(fValue+fmul(fixed(i),fMultipl y),iError);
if(iError>0){
return fKeepResult;
}
if(fKeepResult==fCheck){
return fValue+fmul(fixed(i-1),fMultiply);
}
}
 
return fValue;
}
 
stock fixed:f_logab(fixed:fBase,fixed:fValue,&iError=0){
 
fBase=f_log10(fBase,iError);
if(iError>0){
return fBase;
}
fValue=f_log10(fValue,iError);
if(iError>0){
return fValue;
}
 
return fdiv(fValue,fBase);
}
 
stock fixed:f_faculty(fixed:fValue,&iError=0){
new iValue=1;
 
if(ffract(fValue)==0.000){
if(fValue>0.000){
if(fValue<10.000){
iValue=fround(fValue);
fValue=1.000;
for(new i=2;i<=iValue;i++){
fValue=fmul(fValue,fixed(i));
}
return fValue;
}
iError=2;
return 2147482.000;
}
}
iError=1;
 
return -1.000;
}
 
stock fixed:f_powere(fixed:fExponent,&iError=0){
new fixed:fEulerArray[3][10]={{1.000,1.105,1.221,1.350,1.492,1.649,1.822,2.014 ,2.226,2.460},{1.000,1.010,1.020,1.030,1.041,1.051 ,1.062,1.073,1.083,1.094},{1.000,1.001,1.002,1.003 ,1.004,1.005,1.006,1.007,1.008,1.009}};
new fixed:fSignE=1.000;
new fixed:fEuler;
new fixed:fLocalResult=1.000;
new iKeepExponent=0;
 
fEuler=f_euler();
 
if(fExponent==0.000){
return 1.000;
}
 
if(fExponent>14.579){
iError=2;
return 2147482.000;
}
 
if(fExponent<0.000){
fSignE=-1.000;
fExponent=fExponent*fSignE;
}
 
iKeepExponent=fround(fExponent,fround_floor);
if(iKeepExponent!=0){
for(new i=0;i<iKeepExponent;i++){
fLocalResult=fmul(fEuler,fLocalResult);
}
}
 
for(new i=0;i<3;i++){
fExponent=fExponent-fixed(iKeepExponent);
fExponent=fmul(fExponent,10.000);
iKeepExponent=fround(fExponent,fround_floor);
fLocalResult=fmul(fLocalResult,fEulerArray[i][iKeepExponent]);
}
 
if(fSignE==-1.000){
fLocalResult=fdiv(1.000,fLocalResult);
}
 
return fLocalResult;
}
 
stock fixed:f_power(fixed:fBasis,fixed:fExponent,&iError =0){
new fixed:fKeepValue;
new iKeep;
new iSign=0;
 
iKeep=fround(fExponent,fround_floor);
 
if(fBasis<0.000){
if(fixed(iKeep)!=fExponent){
iError=1;
return -1.000;
}
}
 
if(fExponent==0.500){
return f_sqrt(fBasis,iError);
}
 
fKeepValue=fBasis;
 
if(fixed(iKeep)==fExponent){
if(fExponent<0.000){
fExponent=fmul(fExponent,-1.000);
iKeep=iKeep*-1;
iSign=1;
}
for(new i=1;i<iKeep;i++){
fBasis=fmul(fBasis,fKeepValue);
}
if(iSign){
fBasis=fdiv(1.000,fBasis);
}
return fBasis;
}
 
fKeepValue=f_ln(fKeepValue,iError);
if(iError>0){
return -1.000;
}
 
return f_powere(fmul(fExponent,fKeepValue),iError);
}
 
stock fixed:f_euler(){
return 2.718;
}
 
stock fixed:f_pi(){
return 3.142;
}
 
stock fixed:f_sqrt(fixed:fNum,&iError=0,fixed:fNumStart= 1.000) {
new fixed:fNum2=fNum;
new fixed:fOne=1.000;
 
if(f_abs(fNum)!=fNum){
iError=1;
return -1.000;
}
 
if(fNumStart==fNum2){
fNumStart=1.000;
}
 
if(fNum<1.000){
fNum2=fdiv(fOne,fNum);
}
 
for(new i=0;i<100;i++){
fNum2=fdiv(fNum2+fNumStart,2.000);
fNumStart=fdiv(fNum,fNum2);
if(fNum2 <= fNumStart){
break;
}
}
 
return fNum2;
}
 
stock fixed:f_abs(fixed:fNum) {
if(fNum >= 0.000) {
return fNum;
}
return fmul(fNum,-1.000);
}
 
stock fixed:f_max(fixed:fNum,fixed:fNum2){
if(fNum >= fNum2) {
return fNum;
}
return fNum2;
}
 
stock fixed:f_min(fixed:fNum,fixed:fNum2){
if(fNum < fNum2) {
return fNum;
}
return fNum2;
}
 
stock distance(x1,x2,y1=0,y2=0,z1=0,z2=0){
new fixed:fNumStart=-1.000;
new fixed:fSum=0.000;
new iDx,iDy,iDz;
new iError=0;
 
iDx=(x1-x2)*(x1-x2);
iDy=(y1-y2)*(y1-y2);
iDz=(z1-z2)*(z1-z2);
 
fNumStart=fixed(max(max(iDx,iDy),iDz));
fSum=fixed(iDx+iDy+iDz);
if(fSum==0.000){
return 0;
}
 
fSum=f_sqrt(fSum,iError,fNumStart);
 
return fround(fSum);
}
 
stock fixed:f_sin(fixed:fNum){
new iSign=1;
new fixed:fDummy=0.000;
new fixed:fDummy2=f_pi();
 
if(fNum<0.000){
fNum=fmul(fNum,-1.000);
iSign=-1;
}
 
fDummy2=fmul(fDummy2,2.000);
fDummy=fdiv(fNum,fDummy2);
if(fDummy>1.000){
fDummy=fixed(fround(fDummy,fround_floor));
fNum=fNum-fmul(fDummy,fDummy2);
}
fDummy2=f_pi();
if(fNum>fDummy2){
iSign=iSign*-1;
fNum=fNum-fDummy2;
}
 
fDummy=fNum;
fDummy2=fNum;
for(new i=3;i<=11;i=i+2){
fDummy=fmul(fdiv(fmul(fDummy,fmul(fNum,fNum)),fmul (fixed(i),fixed(i-1))),-1.000);
fDummy2=fDummy2+fDummy;
}
 
return fmul(fDummy2,fixed(iSign));
}
 
stock fixed:f_cos(fixed:fNum){
return f_sin(fNum+fdiv(f_pi(),2.000));
}
 
stock fixed:f_tan(fixed:fNum){
return fdiv(f_sin(fNum),f_cos(fNum));
}
 
stock fixed:f_cot(fixed:fNum){
return fdiv(f_cos(fNum),f_sin(fNum));
}
 
/* Calculation of the integral 1/(1+x^2) in order to get the arctan */
stock fixed:f_arctan(fixed:fNum,&iError=0){
new fixed:fDummy;
new fixed:fResult;
new fixed:fRange;
new iNum;
 
if(fNum>1465.428){
iError=2;
return 2147482.000;
}
 
if(fNum==0.000){
return 0.000;
}
 
fDummy=f_abs(fmul(fNum,1000.000));
iNum=fround(fDummy)-1;
fRange=f_max(fNum,0.000);
 
fResult=fdiv(f_arctan_help(fRange),2.000);
 
fDummy=fRange+0.001;
for(new i=1;i<iNum;i++){
fResult=fResult+f_arctan_help(fDummy);
fDummy=fDummy+0.001;
}
 
return fmul(fResult+fdiv(f_arctan_help(fDummy),2.000),fdi v(fNum,fixed(iNum+1)));
}
 
stock fixed:f_arctan_help(fixed:fNum){
return fdiv(1.000,1.000+fmul(fNum,fNum));
}
 
stock fixed:f_arcsin(fixed:fNum,&iError=0){
 
if(fNum>1.000){
iError=2;
return 1.571;
}
if(fNum<-1.000){
iError=3;
return -1.571;
}
if(fNum==1.000){
return 1.571;
}
if(fNum==-1.000){
return -1.571;
}
 
return f_arctan(fdiv(fNum,f_sqrt(1-fmul(fNum,fNum))));
}
 
stock fixed:f_arccos(fixed:fNum,&iError=0){
 
if(fNum>1.000){
iError=2;
return 1.571;
}
if(fNum<-1.000){
iError=3;
return -1.571;
}
if(fNum==1.000){
return 1.571;
}
if(fNum==-1.000){
return -1.571;
}
 
return fdiv(f_pi(),2.000)-f_arcsin(fNum);
}
 
stock fixed:f_arccot(fixed:fNum){
return fdiv(f_pi(),2.000)-f_arctan(fNum);
}
 
stock fixed:f_sinh(fixed:fNum){
return fdiv(f_powere(fNum)-f_powere(fmul(fNum,-1.000)),2.000);
}
 
stock fixed:f_cosh(fixed:fNum){
return fdiv(f_powere(fNum)+f_powere(fmul(fNum,-1.000)),2.000);
}
 
stock fixed:f_tanh(fixed:fNum){
return fdiv(f_sinh(fNum),f_cosh(fNum));
}
 
stock fixed:f_coth(fixed:fNum,&iError=0){
if(fNum==0.000){
iError=1;
return 0.000;
}
return fdiv(f_cosh(fNum),f_sinh(fNum));
}
 
stock fixed:f_arsinh(fixed:fNum,&iError=0){
if(fNum>1465.428){
iError=2;
return 2147482.000;
}
return f_ln(fNum+f_sqrt(fmul(fNum,fNum)+1.000));
}
 
stock fixed:f_arcosh(fixed:fNum,&iError=0){
if(fNum>1465.428){
iError=2;
return 2147482.000;
}
if(fNum<1.000){
iError=3;
return 0.000;
}
return f_ln(fNum+f_sqrt(fmul(fNum,fNum)-1.000));
}
 
stock fixed:f_artanh(fixed:fNum,&iError=0){
if(fNum>=1.000){
iError=2;
return 0.000;
}
if(fNum<=-1.000){
iError=3;
return 0.000;
}
return fdiv(f_ln(fdiv(1.000+fNum,1.000-fNum)),2.000);
}
 
stock fixed:f_arcoth(fixed:fNum,&iError=0){
if(fNum<=1.000){
if(fNum>=-1.000){
iError=1;
return 0.000;
}
}
return fdiv(f_ln(fdiv(1.000+fNum,fNum-1.000)),2.000);
}
 
stock fixed:f_degtorad(fixed:fNum){
return fmul(fdiv(fNum,180.000),f_pi());
}
 
stock fixed:f_radtodeg(fixed:fNum){
return fdiv(fmul(180.000,fNum),f_pi());
}
 
Aşırı Derecede Saçmalık nerdeyse programlama yapılmış ne alakası var oyunla bu oyunu oynuyan adam rate ayarlarını ve diğer ayarları bilirse zaten sorunları kaldırır bilmeyenler ise böyle saçmalar.
 
Geri
Üst