Timokha 0 Posted April 6, 2022 Hello, I am adding account ID to the variable by the following scripts: set $MY_VARIABLE[0], getcharid(3); set $MY_VARIABLE[getarraysize($MY_VARIABLE)], getcharid(3); I have a list of values in this variable like: 2000000 2000001 2000002 etc It indicates, that these accounts are participating in the game. If the player fails, I need to delete it from this array, but cannot find the right script. Could you please advise, how can I exclude the player from this variable, if he dies on my map for example? OnPCDieEvent: if (strcharinfo(3) == MY_EVENT_MAP) { ???? dispbottom "Game over."; } Quote Share this post Link to post Share on other sites
0 Hyroshima 18 Posted April 8, 2022 try like this: OnPCDieEvent: if(strcharinfo(3) == MY_EVENT_MAP) { for(set .@i,0; .@i<getarraysize($MY_VARIABLE); set .@i,.@i+1) { if(getcharid(3) == $MY_VARIABLE[.@i]) { deletearray $MY_VARIABLE[.@i],1; dispbottom "Game over."; break; } } } end; 1 Timokha reacted to this Quote Share this post Link to post Share on other sites
Hello,
I am adding account ID to the variable by the following scripts:
set $MY_VARIABLE[0], getcharid(3);
set $MY_VARIABLE[getarraysize($MY_VARIABLE)], getcharid(3);
I have a list of values in this variable like:
2000000
2000001
2000002
etc
It indicates, that these accounts are participating in the game.
If the player fails, I need to delete it from this array, but cannot find the right script.
Could you please advise, how can I exclude the player from this variable, if he dies on my map for example?
OnPCDieEvent:
if (strcharinfo(3) == MY_EVENT_MAP)
{
????
dispbottom "Game over.";
}
Share this post
Link to post
Share on other sites