Oh... Net Clientside

Spoiler: My Other zandro stuff! (Open)
Code: Select all
int myVar[8]; // supports up to 8 players. Raise it up to whatever amount you deem reasonable for your mod.
[...]
myVar[PlayerNumber()] = CheckInventory("Shell"); // stores the amount of shells the player has
[...]
Print(s:"You have \cd ",i:myVar[PlayerNumber()],s:" \cfshells left!"); // prints to the player activating the script the amount of shells he has
Spoiler: My Other zandro stuff! (Open)
Code: Select all
int i=0;
script 1 open{
i = 30;
print(d:i);
}
script 2 open clientside{
delay(35);
print(d:i);
}
Code: Select all
int i=0;
script 1 open{
i = 30;
acs_execute(3,0,30);
print(d:i);
}
script 2 open clientside{
delay(35);
print(d:i);
}
script 3 (int a) clientside{
i = a;
}
Code: Select all
#include "zcommon.acs"
int MenuOptions[6] = {0,1,2,3,4,5};
Int MenuPlayer[8];
Script 808 (Int Direction) Net
{
MenuPlayer[playernumber()] = CheckActorInventory(1000 + PlayerNumber(),"MenuItem");
If(Direction == 1)
{
TakeInventory("MenuItem",1);
HudMessage(d:MenuPlayer[playernumber()]; HUDMSG_FADEOUT, 1,0,0.5,0.65,3.0);
}
Else If(Direction == 2)
{
GiveInventory("MenuItem",1);
HudMessage(d:MenuPlayer[playernumber()]; HUDMSG_FADEOUT, 1,0,0.5,0.65,3.0);
}
}
script 1 enter
{
Thing_ChangeTID(0, 1000 + PlayerNumber());
}
Spoiler: My Other zandro stuff! (Open)
Have you tried waiting an entire minute before puking 808? There might be a completely different script you haven't posted that's still setting up some values which might mess up the logic of this script.Samuzero15tlh wrote: It's strange, but why it gives me a wrong answer?...The script 808 1 will lower the value and script 808 2 will raise it, but when you want to change the direction, it gives at the first execute the opposite operation and the second gives the correct operation. -.-Code: Select all
#include "zcommon.acs" int MenuOptions[6] = {0,1,2,3,4,5}; Int MenuPlayer[8]; Script 808 (Int Direction) Net { MenuPlayer[playernumber()] = CheckActorInventory(1000 + PlayerNumber(),"MenuItem"); If(Direction == 1) { TakeInventory("MenuItem",1); HudMessage(d:MenuPlayer[playernumber()]; HUDMSG_FADEOUT, 1,0,0.5,0.65,3.0); } Else If(Direction == 2) { GiveInventory("MenuItem",1); HudMessage(d:MenuPlayer[playernumber()]; HUDMSG_FADEOUT, 1,0,0.5,0.65,3.0); } } script 1 enter { Thing_ChangeTID(0, 1000 + PlayerNumber()); }
Code: Select all
Script 808 (Int Direction) Net
{
If(Direction == 1)
{
TakeInventory("MenuItem",1);
MenuPlayer[playernumber()] = CheckActorInventory(1000 + PlayerNumber(),"MenuItem");
HudMessage(d:MenuPlayer[playernumber()]; HUDMSG_FADEOUT, 1,0,0.5,0.65,3.0);
}
Else If(Direction == 2)
{
GiveInventory("MenuItem",1);
MenuPlayer[playernumber()] = CheckActorInventory(1000 + PlayerNumber(),"MenuItem");
HudMessage(d:MenuPlayer[playernumber()]; HUDMSG_FADEOUT, 1,0,0.5,0.65,3.0);
}
}
Code: Select all
MenuPlayer[playernumber()] = CheckActorInventory(1000 + PlayerNumber(),"MenuItem");
Code: Select all
Str MenuOptions[6] = {"A","B","C","D","E","F"};
Int MenuPlayer[8];
Script 808 (Int Direction) Net
{
MenuPlayer[playernumber()] = CheckActorInventory(1000 + PlayerNumber(),"MenuItem");
If(Direction == 1)
{
TakeInventory("MenuItem",1);
If(MenuPlayer[PlayerNumber()] < 1) Giveinventory("MenuItem",5);
MenuPlayer[playernumber()] = CheckActorInventory(1000 + PlayerNumber(),"MenuItem");
HudMessage(s:MenuOptions[MenuPlayer[playernumber()]]; HUDMSG_FADEOUT, 1,0,0.5,0.65,3.0);
}
Else If(Direction == 2)
{
GiveInventory("MenuItem",1);
If(MenuPlayer[PlayerNumber()] > 5) Takeinventory("MenuItem",6);
MenuPlayer[playernumber()] = CheckActorInventory(1000 + PlayerNumber(),"MenuItem");
HudMessage(s:MenuOptions[MenuPlayer[playernumber()]]; HUDMSG_FADEOUT, 1,0,0.5,0.65,3.0);
}
}
script 1 enter
{
Thing_ChangeTID(0, 1000 + PlayerNumber());
}
Spoiler: My Other zandro stuff! (Open)