Problem with variable. [+rep]
#1

for(new i = 1; i < 4; i++)
{
new p[128];
format(p, 128, "Rope%d", i);
if(Player[playerid][p] != 0)
{

}
}

What is the problem here?
Reply
#2

Errors?
Also, if "rope" is a number, use %i.
Reply
#3

...: 1 :...: (lol) %d and %i are for numbers.

Post the errors. Also don't create a variable in a loop.
Reply
#4

using strings in array dimensions shouldnt work..
See this
Reply
#5

No!
I just want to check in the variable enum: Player if the Rope1, Rope2, Rope3.

Player[playerid][Rope1] etc...

-_-
Someone know the problem?!
Reply
#6

#define MAX_ROPES 4

enum pInfo
{
Ropes[MAX_ROPES]
}
Players[MAX_PLAYERS][pInfo];

for(new i = 0; i < MAX_ROPES; i++)
{
if(Player[playerid][Ropes][i] != 0)
{

}
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)