pc_readglobalreg with array

raPalooza~

New member
Messages
76
Points
0
Age
36
Location
Innovation
Emulator
Is it possible to get an array with pc_readglobalreg? if so, is it possible to getarraysize of an array from pc_readglobalreg?

Trying to create a plugin to set an effect on mobs from an array ( like mobs to kill in a quest )

Simple but haven't found it anywhere ;]

EDIT: this doesn't work :[

Code:
for (i = 0; i <= 10; ++i) {
		sprintf(output,"mob2kill[%d]",i);
		mob = pc_readglobalreg(sd, script->add_str(output));
 
Last edited by a moderator:
Heard of this awesome thing!

But what i want is specialeffect a range of mob_ids from a players array. ( mobs2kill[0] for example )

I'm doing this by post plugin hooking at clif_getareachar_unit

but as i mention pc_readglobalreg seems to not handle array functions. x_X

 
I still don't understand why you have to do it from plugin... You do know you can iterate over an array from scripts, right?

.@size = getarraysize(mob2kill[0]);

for (.@i = 0; .@i < .@size; ++.@i) {
specialeffect(EF_HIT1, SELF, mob2kill[.@i], playerattached());
}




If you insist on using a plugin, look at the source of copyarray()

 
Last edited by a moderator:
Back
Top