From dd8f138892de20862d3bddaa7d8210c345f354f3 Mon Sep 17 00:00:00 2001 From: Steve Dudenhoeffer Date: Fri, 26 Jan 2007 05:56:10 +0000 Subject: [PATCH] Back ported revision 3242 - Every include file now is const correct (am49281) --- plugins/include/amxmisc.inc | 2 +- plugins/include/amxmodx.inc | 41 ++++++++++++------------ plugins/include/csx.inc | 2 +- plugins/include/dodfun.inc | 6 ++-- plugins/include/dodx.inc | 8 ++--- plugins/include/engine.inc | 48 ++++++++++++++--------------- plugins/include/engine_stocks.inc | 14 ++++----- plugins/include/fakemeta.inc | 2 +- plugins/include/fakemeta_stocks.inc | 4 +-- plugins/include/fun.inc | 2 +- plugins/include/geoip.inc | 10 +++--- plugins/include/message_stocks.inc | 2 +- plugins/include/messages.inc | 14 ++++----- plugins/include/ns.inc | 8 ++--- plugins/include/sockets.inc | 6 ++-- plugins/include/sqlx.inc | 2 +- plugins/include/string.inc | 8 ++--- plugins/include/tfcx.inc | 2 +- plugins/include/tsfun.inc | 4 +-- plugins/include/tsx.inc | 4 +-- plugins/include/vector.inc | 16 +++++----- 21 files changed, 102 insertions(+), 103 deletions(-) diff --git a/plugins/include/amxmisc.inc b/plugins/include/amxmisc.inc index 1f2e544b..b7076005 100755 --- a/plugins/include/amxmisc.inc +++ b/plugins/include/amxmisc.inc @@ -181,7 +181,7 @@ stock get_configsdir(name[],len) stock get_datadir(name[],len) return get_localinfo("amxx_datadir",name,len) -stock register_menu(title[],keys,function[],outside=0) +stock register_menu(const title[],keys,const function[],outside=0) register_menucmd(register_menuid(title,outside),keys,function) /* Backwards Compatibility diff --git a/plugins/include/amxmodx.inc b/plugins/include/amxmodx.inc index 1ce74b57..f1a49e5a 100755 --- a/plugins/include/amxmodx.inc +++ b/plugins/include/amxmodx.inc @@ -77,7 +77,7 @@ native precache_model(const name[]); native precache_sound(const name[]); /* Precaches any file. */ -native precache_generic(szFile[]); +native precache_generic(const szFile[]); /* Sets info for player. */ native set_user_info(index,const info[],const value[]); @@ -121,7 +121,7 @@ native console_cmd(id,const cmd[],{Float,Sql,Result,_}:...); * "3!4" - 3rd must be different from 4. * "2&Buy" - 2nd parameter of message must contain "Buy" substring. * "2!Buy" - 2nd parameter of message can't contain "Buy" substring. */ -native register_event(const event[],const function[],const flags[],cond[]="", ... ); +native register_event(const event[],const function[],const flags[],const cond[]="", ... ); /* Registers log event on which the given function will be called * Examples for conditions: @@ -144,7 +144,7 @@ native set_hudmessage(red=200, green=100, blue=0, Float:x=-1.0, Float:y=0.35, ef native show_hudmessage(index,const message[],{Float,Sql,Result,_}:...); /* Displays menu. Keys have bit values (key 1 is (1<<0), key 5 is (1<<4) etc.). */ -native show_menu(index,keys,const menu[], time = -1, title[] = ""); +native show_menu(index,keys,const menu[], time = -1, const title[] = ""); /* Gets value from client messages. * When you are asking for string the array and length is needed (read_data(2,name,len)). @@ -373,7 +373,7 @@ native client_cmd(index,const command[],{Float,Sql,Result,_}:...); * It allows to execute some commands on players and bots. * Function is excellent for forcing to do an action related to a game (not settings!). * The command must stand alone but in arguments you can use spaces. */ -native engclient_cmd(index,const command[],arg1[]="",arg2[]=""); +native engclient_cmd(index,const command[],const arg1[]="",const arg2[]=""); /* Executes command on a server console. */ native server_cmd(const command[],{Float,Sql,Result,_}:...); @@ -450,7 +450,7 @@ native parse_time(const input[],const format[], time = -1); * "b" - loop task. * "c" - do task on time after a map timeleft. * "d" - do task on time before a map timelimit. */ -native set_task(Float:time,const function[],id = 0,parameter[]="",len = 0,flags[]="", repeat = 0); +native set_task(Float:time,const function[],id = 0,const parameter[]="",len = 0,const flags[]="", repeat = 0); /* Removes all tasks with given id. If outside var is * set then a task can be removed also when @@ -476,17 +476,17 @@ native remove_user_flags(index,flags=-1,id=0); /* Registers function which will be called from client console. * Returns the command ID. */ -native register_clcmd(const client_cmd[],const function[],flags=-1, info[]=""); +native register_clcmd(const client_cmd[],const function[],flags=-1, const info[]=""); /* Registers function which will be called from any console. * Returns the command ID. */ -native register_concmd(const cmd[],const function[],flags=-1, info[]=""); +native register_concmd(const cmd[],const function[],flags=-1, const info[]=""); /* Registers function which will be called from server console. * Returns the command ID. */ -native register_srvcmd(const server_cmd[],const function[],flags=-1, info[]=""); +native register_srvcmd(const server_cmd[],const function[],flags=-1, const info[]=""); /* Gets info about client command. */ native get_clcmd(index, command[], len1, &flags, info[], len2, flag); @@ -534,7 +534,7 @@ native get_user_menu(index,&id,&keys); native server_exec(); /* Emits sound. Sample must be precached. */ -native emit_sound(index, channel, sample[], Float:vol, Float:att,flags, pitch); +native emit_sound(index, channel, const sample[], Float:vol, Float:att,flags, pitch); /* Registers new cvar for HL engine. * Returns the cvar pointer for get/set_pcvar functions. @@ -626,14 +626,13 @@ native get_pluginsnum(); * Note: There used to be the b and e flags as well, * which have been deprecated and are no longer used. */ -native pause(flag[], const param1[]="",const param2[]=""); +native pause(const flag[], const param1[]="",const param2[]=""); /* Unpauses function or plugin. * Flags: * "a" - unpause whole plugin. -* "b" - unpause function. * "c" - look outside the plugin (by given plugin name). */ -native unpause(flag[], const param1[]="",const param2[]=""); +native unpause(const flag[], const param1[]="",const param2[]=""); /* Call a function in this / an another plugin by name. * Parameters: @@ -678,7 +677,7 @@ native callfunc_push_floatrf(& Float: value); * which is only kept for special backwards compatibility. */ native callfunc_push_str(const VALUE[], bool:copyback=true); -native callfunc_push_array(VALUE[], array_size, bool:copyback=true); +native callfunc_push_array(const VALUE[], array_size, bool:copyback=true); /* Make the actual call. * Return value of the function called. */ @@ -690,7 +689,7 @@ forward inconsistent_file(id,const filename[], reason[64] ); /* Forces the client and server to be running with the same * version of the specified file ( e.g., a player model ). */ -native force_unmodified(force_type, mins[3] , maxs[3], const filename[]); +native force_unmodified(force_type, const mins[3] , const maxs[3], const filename[]); /* Calculates the md5 keysum of a string */ native md5(const szString[], md5buffer[34]); @@ -775,20 +774,20 @@ native set_float_byref(param, Float:value); // Or copies an array from you to the calling plugin native get_array(param, dest[], size); native get_array_f(param, Float:dest[], size); -native set_array(param, source[], size); -native set_array_f(param, Float:source[], size); +native set_array(param, const source[], size); +native set_array_f(param, const Float:source[], size); /** The new menu natives */ //If you set ml to 1, everything will be preformatted // with the multi-lingual system. //NOTE: ml=1 currently is not enabled. //handler[] will be called when someone presses a key on your menu -native menu_create(title[], handler[], ml=0); +native menu_create(const title[], const handler[], ml=0); //Creates a menu item callback handler. //The callback handler is passed the playerid, menuid, and itemid. //It can return either ITEM_IGNORE, ITEM_ENABLED, or ITEM_DISABLED. -native menu_makecallback(function[]); +native menu_makecallback(const function[]); //Adds an item to a menu. When displayed, the name will be shown. //If the player does not have the access it is disabled. @@ -815,8 +814,8 @@ native menu_find_id(menu, page, key); //Gets/sets info about a menu option native menu_item_getinfo(menu, item, &access, command[], cmdlen, name[]="", namelen=0, &callback); -native menu_item_setname(menu, item, name[]); -native menu_item_setcmd(menu, item, cmd[]); +native menu_item_setname(menu, item, const name[]); +native menu_item_setcmd(menu, item, const cmd[]); native menu_item_setcall(menu, item, callback=-1); //Destroys a menu - invalidates the handle @@ -1049,7 +1048,7 @@ native CreateOneForward(plugin_id, const name[], ...); * prepares an array. use this and pass the result into * ExecuteForward() instead of the array itself. */ -native PrepareArray(array[], size, copyback=0); +native PrepareArray(const array[], size, copyback=0); /** * executes a forward. returns result in ret. diff --git a/plugins/include/csx.inc b/plugins/include/csx.inc index b3746bcd..d92a74f3 100755 --- a/plugins/include/csx.inc +++ b/plugins/include/csx.inc @@ -44,7 +44,7 @@ forward bomb_defused(defuser); /* Custom Weapon Support */ /* function will return index of new weapon */ -native custom_weapon_add( wpnname[],melee = 0,logname[]="" ); +native custom_weapon_add( const wpnname[],melee = 0,const logname[]="" ); /* Function will pass damage done by this custom weapon to stats module and other plugins */ native custom_weapon_dmg( weapon, att, vic, damage, hitplace=0 ); /* Function will pass info about custom weapon shot to stats module */ diff --git a/plugins/include/dodfun.inc b/plugins/include/dodfun.inc index 03ca8760..abcd84ae 100755 --- a/plugins/include/dodfun.inc +++ b/plugins/include/dodfun.inc @@ -59,7 +59,7 @@ native dod_set_user_kills(index,value,refresh=1); native dod_set_user_score(index,value,refresh=1); /* Sets new team name for this player */ -native dod_set_pl_teamname(index,szName[]); +native dod_set_pl_teamname(index,const szName[]); /* Gets player team name */ native dod_get_pl_teamname(index,szName[],len); @@ -122,7 +122,7 @@ native objectives_reinit( player=0 ); native objective_get_data( index, CP_VALUE:key, szValue[]="", len=0 ); /* use this function to change control point's data */ -native objective_set_data( index, CP_VALUE:key , iValue=-1, szValue[]="" ); +native objective_set_data( index, CP_VALUE:key , iValue=-1, const szValue[]="" ); enum CA_VALUE { CA_edict = 1, @@ -140,4 +140,4 @@ enum CA_VALUE { native area_get_data( index, CA_VALUE:key, szValue[]="", len=0 ); /* use this function to change control point's area data */ -native area_set_data( index, CA_VALUE:key , iValue=-1, szValue[]="" ); +native area_set_data( index, CA_VALUE:key , iValue=-1, const szValue[]="" ); diff --git a/plugins/include/dodx.inc b/plugins/include/dodx.inc index 3d091894..a30197fc 100755 --- a/plugins/include/dodx.inc +++ b/plugins/include/dodx.inc @@ -54,7 +54,7 @@ forward dod_client_changeclass(id, class, oldclass); forward dod_client_spawn(id); /* Sets the model for a player */ -native dod_set_model(id, model[]); +native dod_set_model(id, const model[]); /* Sets the model for a player */ native dod_set_body_number(id, bodynumber); @@ -64,7 +64,7 @@ native dod_clear_model(id); /* Custom Weapon Support */ /* function will return index of new weapon */ -native custom_weapon_add( wpnname[], melee = 0, logname[]="" ); +native custom_weapon_add( const wpnname[], melee = 0, const logname[]="" ); /* Function will pass damage done by this custom weapon to stats module and other plugins */ native custom_weapon_dmg( weapon, att, vic, damage, hitplace=0 ); @@ -93,10 +93,10 @@ native xmod_is_custom_wpn(wpnindex); /************* Shared Natives End ********************************/ /* weapon logname to weapon name convertion */ -native dod_wpnlog_to_name(logname[],name[],len); +native dod_wpnlog_to_name(const logname[],name[],len); /* weapon logname to weapon index convertion */ -native dod_wpnlog_to_id(logname[]); +native dod_wpnlog_to_id(const logname[]); native dod_get_map_info( info ); diff --git a/plugins/include/engine.inc b/plugins/include/engine.inc index 35b40335..49c573fd 100755 --- a/plugins/include/engine.inc +++ b/plugins/include/engine.inc @@ -25,13 +25,13 @@ native traceresult(type,{Float,Sql,Result,_}:...); /* Registers a client impulse to a function. Function is passed the ID of the user. */ -native register_impulse(impulse, function[]); +native register_impulse(impulse, const function[]); /* Registers a touch action to a function by classnames. Use * to specify any classname. */ -native register_touch(Touched[], Toucher[], function[]); +native register_touch(const Touched[], const Toucher[], const function[]); /* Registers a think action to a function by classname. */ -native register_think(Classname[], function[]); +native register_think(const Classname[], const function[]); /* NOTE: In old engine versions, this was not the case. Values are now WINDOWS values. * You must pass with the windows offset (e.g. if 230 on windows, pass 230 no matter what) @@ -39,7 +39,7 @@ native register_think(Classname[], function[]); */ /* Precaches an event. */ -native precache_event(type, Name[], {Float,Sql,Result,_}:...); +native precache_event(type, const Name[], {Float,Sql,Result,_}:...); /* set/get a user's speak flags */ native set_speak(iIndex, iSpeakFlags) @@ -62,7 +62,7 @@ native get_global_vector(variable, Float:vector[3]); native get_global_edict(variable); /* Set entity bounds. */ -native entity_set_size(index, Float:mins[3], Float:maxs[3]); +native entity_set_size(index, const Float:mins[3], const Float:maxs[3]); /* Get decal index */ native get_decal_index(const szDecalName[]); @@ -76,7 +76,7 @@ native entity_set_int(iIndex, iKey, iVal); native Float:entity_get_float(iIndex, iKey); native entity_set_float(iIndex, iKey, Float:iVal); native entity_get_vector(iIndex, iKey, Float:vRetVector[3]); -native entity_set_vector(iIndex, iKey, Float:vNewVector[3]); +native entity_set_vector(iIndex, iKey, const Float:vNewVector[3]); native entity_get_edict(iIndex, iKey); native entity_set_edict(iIndex, iKey, iNewIndex); native entity_get_string(iIndex, iKey, szReturn[], iRetLen); @@ -85,17 +85,17 @@ native entity_get_byte(iIndex, iKey); native entity_set_byte(iIndex, iKey, iVal); /* Creates an entity, will return the index of the created entity. ClassName must be valid. */ -native create_entity(szClassname[]); +native create_entity(const szClassname[]); /* Finds an entity in the world, will return 0 if nothing is found */ -native find_ent_by_class(iIndex, szClass[]); +native find_ent_by_class(iIndex, const szClass[]); //optionally you can set a jghg2 type // 1: target, 2:targetname, 0:classname (default) -native find_ent_by_owner(iIndex, szClass[], iOwner, iJghgType=0); -native find_ent_by_target(iIndex, szClass[]); -native find_ent_by_tname(iIndex, szClass[]); -native find_ent_by_model(iIndex, szClass[], szModel[]); -native find_ent_in_sphere(start_from_ent, Float:origin[3], Float:radius); +native find_ent_by_owner(iIndex, const szClass[], iOwner, iJghgType=0); +native find_ent_by_target(iIndex, const szClass[]); +native find_ent_by_tname(iIndex, const szClass[]); +native find_ent_by_model(iIndex, const szClass[], const szModel[]); +native find_ent_in_sphere(start_from_ent, const Float:origin[3], Float:radius); //this will CBaseEntity::Think() or something from the entity native call_think(entity) @@ -104,7 +104,7 @@ native call_think(entity) native is_valid_ent(iIndex); /* Proper origin setting, keeps updated with Half-Life engine. */ -native entity_set_origin(iIndex, Float:fNewOrigin[3]); +native entity_set_origin(iIndex, const Float:fNewOrigin[3]); /* Sets the model of an Entity. */ native entity_set_model(iIndex, const szModel[]); @@ -125,7 +125,7 @@ native fake_touch(entTouched, entToucher); native DispatchKeyValue(...); #endif -native get_keyvalue(entity, szKey[], value[], maxLength); +native get_keyvalue(entity, const szKey[], value[], maxLength); native copy_keyvalue(szClassName[],sizea,szKeyName[],sizeb,szValue[],sizec); @@ -134,24 +134,24 @@ native DispatchSpawn(iIndex); /* Hurts/Kills players in a sphere, like an explosion, Multiplier determines damage. */ #if !defined AMXMOD_BCOMPAT -native radius_damage(Float:fExplodeAt[3], iDamageMultiplier, iRadiusMultiplier); +native radius_damage(const Float:fExplodeAt[3], iDamageMultiplier, iRadiusMultiplier); #endif /* Will return the contents of a point (inside map? in sky? outside map? etc.). */ -native point_contents(Float:fCheckAt[3]); +native point_contents(const Float:fCheckAt[3]); /* Trace a line from Start(X, Y, Z) to End(X, Y, Z), will return the point hit in vReturn[3] * and an entity index if an entity is hit. */ #if !defined AMXMOD_BCOMPAT -native trace_line(iIgnoreEnt, Float:fStart[3], Float:fEnd[3], Float:vReturn[3]); +native trace_line(iIgnoreEnt, const Float:fStart[3], const Float:fEnd[3], Float:vReturn[3]); #endif /* Traces a hull. */ -native trace_hull(Float:origin[3],hull,ignoredent=0,ignoremonsters=0); +native trace_hull(const Float:origin[3],hull,ignoredent=0,ignoremonsters=0); /* Traces a line, and returns the normal to the plane hit in vReturn. * Returns 0 if theres no normal. */ -native trace_normal(iIgnoreEnt, Float:fStart[3], Float:fEnd[3], Float:vReturn[3]); +native trace_normal(iIgnoreEnt, const Float:fStart[3], const Float:fEnd[3], Float:vReturn[3]); /* Gets the ID of a grenade. */ native get_grenade_id(id, model[], len, grenadeid = 0); @@ -169,7 +169,7 @@ native attach_view(iIndex, iTargetIndex); native set_view(iIndex, ViewType); /* Direct copy of PLAYBACK_EVENT_FULL from Metamod/HLSDK. If you don't know how that works, you probably shouldn't be using it. */ -native playback_event(flags,invoker,eventindex,Float:delay,Float:origin[3],Float:angles[3],Float:fparam1,Float:fparam2,iparam1,iparam2,bparam1,bparam2); +native playback_event(flags,invoker,eventindex,Float:delay,const Float:origin[3],const Float:angles[3],Float:fparam1,Float:fparam2,iparam1,iparam2,bparam1,bparam2); /* Gets parameters sent from CmdStart. Note that you will receive modified values if any other plugin have @@ -224,17 +224,17 @@ forward pfn_spawn(entid); * If aroundent is 0 its origin is not used, but origin in 6th parameter. Ie, do not specify 6th parameter (origin) if you specified an entity * in aroundent. */ -native find_sphere_class(aroundent, _lookforclassname[], Float:radius, entlist[], maxents, Float:origin[3] = {0.0, 0.0, 0.0}); +native find_sphere_class(aroundent, const _lookforclassname[], Float:radius, entlist[], maxents, const Float:origin[3] = {0.0, 0.0, 0.0}); /* SDK function - checks if an origin is in an entity's view cone * Set use3d to 1 to do the calculation in 3D. Otherwise it will be in 2D. */ -native is_in_viewcone(entity, Float:origin[3], use3d = 0); +native is_in_viewcone(entity, const Float:origin[3], use3d = 0); //SDK function - checks if an entity is visible to an entity native is_visible(entity, target); //Added at twistedeuphoria's request, see funcwiki for details -native trace_forward(Float:start[3], Float:angle[3], Float:give, ignoreEnt, &Float:hitX, &Float:hitY, &Float:shortestDistance, &Float:shortestDistLow, &Float:shortestDistHigh); +native trace_forward(const Float:start[3], const Float:angle[3], Float:give, ignoreEnt, &Float:hitX, &Float:hitY, &Float:shortestDistance, &Float:shortestDistLow, &Float:shortestDistHigh); #include diff --git a/plugins/include/engine_stocks.inc b/plugins/include/engine_stocks.inc index f8cc25f7..05ac6fa0 100755 --- a/plugins/include/engine_stocks.inc +++ b/plugins/include/engine_stocks.inc @@ -19,7 +19,7 @@ #include #endif -stock fakedamage(idvictim,szClassname[],Float:takedmgdamage,damagetype) +stock fakedamage(idvictim,const szClassname[],Float:takedmgdamage,damagetype) { new entity = create_entity("trigger_hurt") if (entity) @@ -43,7 +43,7 @@ stock fakedamage(idvictim,szClassname[],Float:takedmgdamage,damagetype) } //wrapper for find_ent_by_class -stock find_ent(iStart, szClassname[]) +stock find_ent(iStart, const szClassname[]) { return find_ent_by_class(iStart, szClassname) } @@ -95,7 +95,7 @@ stock get_brush_entity_origin(ent, Float:orig[3]) } /* Remove entity by name */ -stock remove_entity_name(eName[]) +stock remove_entity_name(const eName[]) { new iEntity = find_ent_by_class(-1, eName) while (iEntity > 0) @@ -185,7 +185,7 @@ stock get_entity_visibility(entity) { return !(entity_get_int(entity, EV_INT_effects) & EF_NODRAW) } -stock set_user_velocity(entity, Float:vec[3]) +stock set_user_velocity(entity, const Float:vec[3]) { return entity_set_vector(entity, EV_VEC_velocity, vec) } @@ -197,7 +197,7 @@ stock get_user_velocity(entity, Float:vec[3]) /* Backwards compatible */ /* Hurts/Kills players in a sphere, like an explosion, Multiplier determines damage. */ -stock RadiusDamage(Float:fExplodeAt[3], iDamageMultiplier, iRadiusMultiplier) { +stock RadiusDamage(const Float:fExplodeAt[3], iDamageMultiplier, iRadiusMultiplier) { return radius_damage(fExplodeAt, iDamageMultiplier, iRadiusMultiplier) } /* Gives you a velocity in the direction a player is looking, iVelocity is the multiplier. */ @@ -205,11 +205,11 @@ stock VelocityByAim(iIndex,iVelocity, Float:vRetValue[3]) { return velocity_by_aim(iIndex,iVelocity,vRetValue) } /* Will return the contents of a point (inside map? in sky? outside map? etc.). */ -stock PointContents(Float:fCheckAt[3]) { +stock PointContents(const Float:fCheckAt[3]) { return point_contents(fCheckAt); } -stock set_size(index, Float:mins[3], Float:maxs[3]) { +stock set_size(index, const Float:mins[3], const Float:maxs[3]) { return entity_set_size(index,mins,maxs) } diff --git a/plugins/include/fakemeta.inc b/plugins/include/fakemeta.inc index fa4788b8..40adba96 100755 --- a/plugins/include/fakemeta.inc +++ b/plugins/include/fakemeta.inc @@ -68,7 +68,7 @@ native set_pdata_float(_index,_Offset,Float:_Value,_linuxdiff=5); /* Registers a forward. * Returns an id you can pass to unregister_forward */ -native register_forward(_forwardType,_function[],_post=0); +native register_forward(_forwardType,const _function[],_post=0); /* Unregisters a forward. * The registerId must be from register_forward, and diff --git a/plugins/include/fakemeta_stocks.inc b/plugins/include/fakemeta_stocks.inc index 2facb69b..d3939b3b 100755 --- a/plugins/include/fakemeta_stocks.inc +++ b/plugins/include/fakemeta_stocks.inc @@ -15,9 +15,9 @@ #define _fakemeta_stocks_included // EngFuncs -stock EF_PrecacheModel(string[]) +stock EF_PrecacheModel(const string[]) return engfunc(EngFunc_PrecacheModel, string) -stock EF_PrecacheSound(string[]) +stock EF_PrecacheSound(const string[]) return engfunc(EngFunc_PrecacheSound, string) stock EF_SetModel(const ID, const STRING[]) return engfunc(EngFunc_SetModel, ID, STRING) diff --git a/plugins/include/fun.inc b/plugins/include/fun.inc index 7bf447dc..d1766669 100755 --- a/plugins/include/fun.inc +++ b/plugins/include/fun.inc @@ -39,7 +39,7 @@ native set_user_armor(index, armor); native set_user_health(index, health); /* Move player to origin. */ -native set_user_origin(index, origin[3]); +native set_user_origin(index, const origin[3]); /* Sets player rendering mode. */ native set_user_rendering(index, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16); diff --git a/plugins/include/geoip.inc b/plugins/include/geoip.inc index 947eca83..fdc59f67 100755 --- a/plugins/include/geoip.inc +++ b/plugins/include/geoip.inc @@ -3,7 +3,7 @@ (C)Copyrighted under the GNU General Public License, Version 2 */ -#if defined _geoip_included +#if defined geoip_included #endinput #endif #define _geoip_included @@ -20,10 +20,10 @@ //IP address can contain ports, the ports will be stripped out //get a two character country code (eg US, CA etc) -native geoip_code2(ip[], ccode[3]); +native geoip_code2(const ip[], ccode[3]); -//get a three character country code (eg USA, CAN etc) -native geoip_code3(ip[], result[4]); +//get a three character country code (eg USA, cAN etc) +native geoip_code3(const ip[], result[4]); //get a full country name. max name is 45 chars -native geoip_country(ip[], result[], len=45); +native geoip_country(const ip[], result[], len=45); diff --git a/plugins/include/message_stocks.inc b/plugins/include/message_stocks.inc index 022d9cc5..41fafaf1 100644 --- a/plugins/include/message_stocks.inc +++ b/plugins/include/message_stocks.inc @@ -41,7 +41,7 @@ stock user_silentkill(index) } /* Creates a death message. */ -stock make_deathmsg(killer, victim, headshot, weapon[]) +stock make_deathmsg(killer, victim, headshot, const weapon[]) { message_begin(MSG_ALL, get_user_msgid("DeathMsg"), {0,0,0}, 0); write_byte(killer); diff --git a/plugins/include/messages.inc b/plugins/include/messages.inc index 0999520c..760febc8 100644 --- a/plugins/include/messages.inc +++ b/plugins/include/messages.inc @@ -16,7 +16,7 @@ * You may generate menu, smoke, shockwaves, thunderlights, * intermission and many many others messages. * See HL SDK for more examples. */ -native message_begin(dest, msg_type, origin[3] = {0,0,0}, player = 0); +native message_begin(dest, msg_type, const origin[3] = {0,0,0}, player = 0); native message_end(); native write_byte(x); native write_char(x); @@ -25,7 +25,7 @@ native write_long(x); native write_entity(x); native write_angle(x); native write_coord(x); -native write_string(x[]); +native write_string(const x[]); /* These are the same as above, except that the messages sent * are also sent to all other plugins and Metamod plugins. @@ -35,7 +35,7 @@ native write_string(x[]); * could cause infinite recursion or something just as bad. * NOTE! These natives are experimental. */ -native emessage_begin(dest, msg_type, origin[3] = {0,0,0}, player = 0); +native emessage_begin(dest, msg_type, const origin[3] = {0,0,0}, player = 0); native emessage_end(); native ewrite_byte(x); native ewrite_char(x); @@ -44,7 +44,7 @@ native ewrite_long(x); native ewrite_entity(x); native ewrite_angle(x); native ewrite_coord(x); -native ewrite_string(x[]); +native ewrite_string(const x[]); /* Sets/Gets what engine messages are blocked. */ native set_msg_block(iMessage, iMessageFlags); @@ -56,7 +56,7 @@ native get_msg_block(iMessage); * If you hook a message, the message is stored but not sent. You have the opportunity to * not only execute code, but to get/set the contents of the message, before you choose to * either block it or let it go on its way. The hooked function will be passed a msg_id, msg_dest, and entity index. */ -native register_message(iMsgId, szFunction[]); +native register_message(iMsgId, const szFunction[]); /* The get/set _msg commands will fail if used outside a hooked message scope. * They should never be used unless inside a registered message function. @@ -81,7 +81,7 @@ native get_msg_arg_string(argn, szReturn[], iLength); /* sets the value of argn. */ native set_msg_arg_int(argn, argtype, iValue); native set_msg_arg_float(argn, argtype, Float:fValue); -native set_msg_arg_string(argn, szString[]); +native set_msg_arg_string(argn, const szString[]); /* Gets the origin of a message */ -native get_msg_origin(Float:_Origin[3]); +native get_msg_origin(const Float:_Origin[3]); diff --git a/plugins/include/ns.inc b/plugins/include/ns.inc index 319b1b30..1b29d533 100755 --- a/plugins/include/ns.inc +++ b/plugins/include/ns.inc @@ -31,12 +31,12 @@ forward client_built(idPlayer,idStructure,type,impulse); /* Returns if the map's combat or not. */ native ns_is_combat(); -/* Sends a popup to a player. Set target to 0 to send to everybody. Message length is 188 characters. The last parameter, if set to 1, will only display when the player has cl_autohelp set to 1. */ -native ns_popup(target,szMsg[180],ah=0) +/* Sends a popup to a player. Set target to 0 to send to everybody. Message length is 180 characters. The last parameter, if set to 1, will only display when the player has cl_autohelp set to 1. */ +native ns_popup(target,const szMsg[180],ah=0) /* Sets a player model. Omit the second parameter to return to default. Note: This does *not* change back on death, team switch, gestations, etc. */ -native ns_set_player_model(id,szModel[]=""); +native ns_set_player_model(id,const szModel[]=""); /* Sets a player's skin. Omit second parameter to return to default. Note: This does *not* change back on death, team switch, gestations, etc. */ @@ -73,7 +73,7 @@ native ns_set_mask(id,mask,value); Number is any other value: The index of the #th matching structure is returned. */ -native ns_get_build(classname[],builtOnly=1,Number=0); +native ns_get_build(const classname[],builtOnly=1,Number=0); /* Returns if the player has the weapon or not in their pev->weapons field. set "setweapon" to 0 to turn the bit off, set to 1 to turn it on. Or omit it to just return the value. */ diff --git a/plugins/include/sockets.inc b/plugins/include/sockets.inc index dc8370a4..7eda92b0 100755 --- a/plugins/include/sockets.inc +++ b/plugins/include/sockets.inc @@ -39,7 +39,7 @@ * 3 - couldn't connect to given hostname:port */ -native socket_open(_hostname[], _port, _protocol = SOCKET_TCP, &_error); +native socket_open(const _hostname[], _port, _protocol = SOCKET_TCP, &_error); /* Closes a Socket */ @@ -51,11 +51,11 @@ native socket_recv(_socket, _data[], _length); /* Sends data to the Socket */ -native socket_send(_socket, _data[], _length); +native socket_send(_socket, const _data[], _length); /* Same as socket_send but Data can contain null bytes */ -native socket_send2(_socket, _data[], _length); +native socket_send2(_socket, const _data[], _length); /* This function will return true if the state (buffer content) have changed within the last recieve or * the timeout, where timeout is a value in µSeconds, (1 sec =1000000 µsec). diff --git a/plugins/include/sqlx.inc b/plugins/include/sqlx.inc index 1b8bf284..199686bf 100644 --- a/plugins/include/sqlx.inc +++ b/plugins/include/sqlx.inc @@ -318,7 +318,7 @@ stock Handle:SQL_MakeStdTuple() get_cvar_string("amx_sql_type", set_type, 11) get_cvar_string("amx_sql_db", db, 127) - SQL_GetAffinity(get_type, 11) + SQL_GetAffinity(get_type, 12) if (!equali(get_type, set_type)) { diff --git a/plugins/include/string.inc b/plugins/include/string.inc index 44ded07c..0491bbcf 100755 --- a/plugins/include/string.inc +++ b/plugins/include/string.inc @@ -164,7 +164,7 @@ native strfind(const string[], const sub[], ignorecase=0, pos=0); native strcmp(const string1[], const string2[], ignorecase=0); /* Tests if given string contains only digits. Also, returns false for zero-length strings. */ -stock bool:is_str_num(sString[]) +stock bool:is_str_num(const sString[]) { new i = 0; @@ -179,7 +179,7 @@ stock bool:is_str_num(sString[]) the right output , the max right length, and then the delimiter string. By Suicid3 */ -stock split(szInput[], szLeft[], pL_Max, szRight[], pR_Max, szDelim[]) +stock split(const szInput[], szLeft[], pL_Max, szRight[], pR_Max, const szDelim[]) { new iEnd = contain(szInput, szDelim); new iStart = iEnd + strlen(szDelim); @@ -204,7 +204,7 @@ stock split(szInput[], szLeft[], pL_Max, szRight[], pR_Max, szDelim[]) } /* Removes a path from szFilePath leaving the name of the file in szFile for a pMax length. */ -stock remove_filepath(szFilePath[], szFile[], pMax) +stock remove_filepath(const szFilePath[], szFile[], pMax) { new len = strlen(szFilePath); @@ -219,7 +219,7 @@ stock remove_filepath(szFilePath[], szFile[], pMax) * This ensures that no infinite replacements will take place by * intelligently moving to the next string position each iteration. */ -stock replace_all(string[], len, what[], with[]) +stock replace_all(string[], len, const what[], const with[]) { new pos = 0; diff --git a/plugins/include/tfcx.inc b/plugins/include/tfcx.inc index 632e67d8..1806ed43 100755 --- a/plugins/include/tfcx.inc +++ b/plugins/include/tfcx.inc @@ -42,7 +42,7 @@ forward client_death(killer,victim,wpnindex,hitplace,TK); /* Custom Weapon Support */ /* function will return index of new weapon */ -native custom_weapon_add( wpnname[],melee = 0,logname[]="" ); +native custom_weapon_add( const wpnname[],melee = 0,const logname[]="" ); /* Function will pass damage done by this custom weapon to stats module and other plugins */ native custom_weapon_dmg( weapon, att, vic, damage, hitplace=0 ); /* Function will pass info about custom weapon shot to stats module */ diff --git a/plugins/include/tsfun.inc b/plugins/include/tsfun.inc index 5cb9ded8..f0d04a44 100755 --- a/plugins/include/tsfun.inc +++ b/plugins/include/tsfun.inc @@ -51,10 +51,10 @@ forward client_stunt(id,stunttype,UNAVAILABLE); forward client_powerup(id,powerup,UNAVAILABLE); /* weapon logname to weapon name convertion */ -native ts_wpnlogtoname(logname[],name[],len); +native ts_wpnlogtoname(const logname[],name[],len); /* weapon logname to weapon index convertion */ -native ts_wpnlogtoid(logname[]); +native ts_wpnlogtoid(const logname[]); //UNAVAILABLE IN 1.70 //native Float:ts_getusertime( index ); //! diff --git a/plugins/include/tsx.inc b/plugins/include/tsx.inc index 119c17c6..02c91c34 100755 --- a/plugins/include/tsx.inc +++ b/plugins/include/tsx.inc @@ -43,7 +43,7 @@ forward client_death(killer,victim,wpnindex,hitplace,TK); /* Custom Weapon Support */ /* function will return index of new weapon */ -native custom_weapon_add( wpnname[],melee = 0,logname[]="" ); +native custom_weapon_add( const wpnname[],melee = 0,const logname[]="" ); /* Function will pass damage done by this custom weapon to stats module and other plugins */ native custom_weapon_dmg( weapon, att, vic, damage, hitplace=0 ); /* Function will pass info about custom weapon shot to stats module */ @@ -70,7 +70,7 @@ native xmod_is_custom_wpn(wpnindex); /************* Shared Natives End ********************************/ /* Spawns a Weapon */ -stock ts_weaponspawn(weaponid[], duration[], extraclip[], spawnflags[], Float:Origin[3]) +stock ts_weaponspawn(const weaponid[], const duration[], const extraclip[], const spawnflags[], const Float:Origin[3]) { new ent = create_entity("ts_groundweapon"); diff --git a/plugins/include/vector.inc b/plugins/include/vector.inc index 1a05ef02..2cbc9aa7 100644 --- a/plugins/include/vector.inc +++ b/plugins/include/vector.inc @@ -16,30 +16,30 @@ #define ANGLEVECTOR_UP 3 /* Returns distance between two vectors. */ -native get_distance(origin1[3],origin2[3]); +native get_distance(const origin1[3], const origin2[3]); /* Gets distance between two origins (float). */ -native Float:get_distance_f(Float:Origin1[3], Float:Origin2[3]); +native Float:get_distance_f(const Float:Origin1[3], const Float:Origin2[3]); /* Gives you a velocity in the direction a player is looking, iVelocity is the multiplier. */ native velocity_by_aim(iIndex, iVelocity, Float:vRetValue[3]); /* Changes a vector into an angle vector. */ -native vector_to_angle(Float:fVector[3], Float:vReturn[3]); +native vector_to_angle(const Float:fVector[3], Float:vReturn[3]); /* Changes an angle vector into a vector. */ -native angle_vector(Float:vector[3], FRU, Float:ret[3]); +native angle_vector(const Float:vector[3], FRU, Float:ret[3]); /* Gets the length of a vector (float[3]). */ -native Float:vector_length(Float:vVector[3]); +native Float:vector_length(const Float:vVector[3]); /* Gets the distance between 2 vectors (float[3]). */ -native Float:vector_distance(Float:vVector[3], Float:vVector2[3]); +native Float:vector_distance(const Float:vVector[3], const Float:vVector2[3]); /* Changes an integer vec to a floating vec * This is not a for loop because that's slower */ -stock IVecFVec(IVec[3], Float:FVec[3]) +stock IVecFVec(const IVec[3], Float:FVec[3]) { FVec[0] = float(IVec[0]) FVec[1] = float(IVec[1]) @@ -49,7 +49,7 @@ stock IVecFVec(IVec[3], Float:FVec[3]) } /* Changes a float vec to an integer vec */ -stock FVecIVec(Float:FVec[3], IVec[3]) +stock FVecIVec(const Float:FVec[3], IVec[3]) { IVec[0] = floatround(FVec[0]) IVec[1] = floatround(FVec[1])