Raised This Month: $ Target: $400
 0% 

[HELP] find_and_replace function?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
VMAN
Senior Member
Join Date: Oct 2007
Location: California, US
Old 01-19-2009 , 20:28   [HELP] find_and_replace function?
Reply With Quote #1

Hello AlliedModders community ,


I am new to AMXX scripting, but I am familiar with PHP, so I understand what most of the things are doing in AMXX scripts.


My question is regarding the "find_and_replace" function. I noticed it in GHW's icebob2 script. I see how he used it, but I'm not sure which module is required for this function.


If you could help me out that would be great!
Attached Files
File Type: sma Get Plugin or Get Source (GHW_surf_icebob2.sma - 666 views - 8.1 KB)

Last edited by VMAN; 01-19-2009 at 20:32.
VMAN is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-19-2009 , 21:17   Re: [HELP] find_and_replace function?
Reply With Quote #2

Code:
public find_and_replace(model[],type) {     new maxplayers = get_maxplayers()     new temp_entlist[30]     new num = 0;     new Float:origin[3]     new ent = engfunc(EngFunc_FindEntityByString,maxplayers,"model",model)     while(ent)     {         temp_entlist[num] = ent         num++         ent = engfunc(EngFunc_FindEntityByString,ent,"model",model)     }     for(new i=0;i<num;i++)     {         pev(temp_entlist[i],pev_origin,origin)         ent = engfunc(EngFunc_CreateNamedEntity,engfunc(EngFunc_AllocString,"armoury_entity"))         set_pev(ent,pev_classname,"armoury_entity")         engfunc(EngFunc_SetModel,ent,model)         cs_set_armoury_type(ent,type)         set_pev(ent,pev_solid,SOLID_TRIGGER)         set_pev(ent,pev_movetype,MOVETYPE_FLY)         set_pev(ent,pev_flags,512)         engfunc(EngFunc_SetOrigin,ent,origin)         engfunc(EngFunc_RemoveEntity,temp_entlist[i])         dllfunc(DLLFunc_Spawn,ent)     } }

Modules used:
  • Fakemeta
  • Cstrike
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
VMAN
Senior Member
Join Date: Oct 2007
Location: California, US
Old 01-19-2009 , 21:26   Re: [HELP] find_and_replace function?
Reply With Quote #3

Thank you Exolent!
VMAN is offline
Reply


Thread Tools
Display Modes

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 01:49.


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