probelm with foreach +Repp
#3

Quote:
Originally Posted by khRamin78
Посмотреть сообщение
sry guys but why this happeing for me ?

Код:
C:\Users\KaTA\Desktop\samp training\Test\gamemodes\Test.pwn(2812) : error 017: undefined symbol "foreach"
C:\Users\KaTA\Desktop\samp training\Test\gamemodes\Test.pwn(2812) : error 029: invalid expression, assumed zero
C:\Users\KaTA\Desktop\samp training\Test\gamemodes\Test.pwn(2812) : error 017: undefined symbol "i"
C:\Users\KaTA\Desktop\samp training\Test\gamemodes\Test.pwn(2812) : fatal error 107: too many error messages on one line
And This Is The Line's :

PHP код:
//This Is Line 2812  if(listitem == 0) {foreach(new i : Player)if(IsPlayerConnected(i))SetPlayerTime(i,7,0);}
               
if(listitem == 1) {foreach(new Player)if(IsPlayerConnected(i))SetPlayerTime(i,12,0);}
               if(
listitem == 2) {foreach(new Player)if(IsPlayerConnected(i))SetPlayerTime(i,16,0);}
               if(
listitem == 3) {foreach(new Player)if(IsPlayerConnected(i))SetPlayerTime(i,20,0);}
               if(
listitem == 4) {foreach(new Player)if(IsPlayerConnected(i))SetPlayerTime(i,0,0); } 
PHP код:
 if(listitem == 1) {
      foreach(new 
Player) { // <- Add it {
         
if(IsPlayerConnected(i)) SetPlayerTime(i,12,0);
      }

Note: In cycles "for, while" it is always better to put {. Example: for () { ... }
Reply


Messages In This Thread
probelm with foreach +Repp - by khRamin78 - 29.08.2015, 20:33
Re: probelm with foreach +Repp - by Ahmad45123 - 29.08.2015, 20:37
Re: probelm with foreach +Repp - by Logofero - 29.08.2015, 20:40
Re: probelm with foreach +Repp - by khRamin78 - 29.08.2015, 20:44
Re: probelm with foreach +Repp - by jlalt - 29.08.2015, 20:44
Re: probelm with foreach +Repp - by Ahmad45123 - 29.08.2015, 20:52
Re: probelm with foreach +Repp - by Crayder - 29.08.2015, 21:13
Re: probelm with foreach +Repp - by khRamin78 - 30.08.2015, 04:24
Re: probelm with foreach +Repp - by Crayder - 30.08.2015, 04:34

Forum Jump:


Users browsing this thread: 1 Guest(s)