AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] find_and_replace function? (https://forums.alliedmods.net/showthread.php?t=84062)

VMAN 01-19-2009 20:28

[HELP] find_and_replace function?
 
1 Attachment(s)
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!

Exolent[jNr] 01-19-2009 21:17

Re: [HELP] find_and_replace function?
 
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

VMAN 01-19-2009 21:26

Re: [HELP] find_and_replace function?
 
Thank you Exolent!


All times are GMT -4. The time now is 01:49.

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