forech
#1

How to fix this warring?

Код:
warning 219: local variable "using_deprecated_foreach_syntax" shadows a variable at a preceding level
PHP код:
foreach(Houseshid
Reply
#2

Use this:

PHP код:
for(new hid 0hid Houseshid++)
{
  
// ...

Reply
#3

Why they are given me this error? after put it?
Is there something wrong with your code?
PHP код:
error 017undefined symbol "Houses" 
The code is

PHP код:
CMD:houseinfo(playeridparams[])
{
    for(new 
hid 0hid Houseshid++)
       { 
Reply
#4

Quote:
Originally Posted by Thanks
Посмотреть сообщение
Why they are given me this error? after put it?
Is there something wrong with your code?
PHP код:
error 017undefined symbol "Houses" 
The code is

PHP код:
CMD:houseinfo(playeridparams[])
{
    for(new 
hid 0hid Houseshid++)
       { 
Because houses does not exist.
use:
Код:
#define Houses 1000
Above will loop 1000 times
Reply
#5

Quote:
Originally Posted by kovac
Посмотреть сообщение
Use this:

PHP код:
for(new hid 0hid Houseshid++)
{
  
// ...

Quote:
Originally Posted by jasperschellekens
Посмотреть сообщение
Because houses does not exist.
use:
Код:
#define Houses 1000
Above will loop 1000 times
No. That's completely wrong, iterator is not a number.


This is an old foreach syntax, you need to replace it with the newest one:

PHP код:
foreach(new hid Houses
Reply
#6

Thanks @iKarim
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)