probelm with foreach +Repp
#2

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); } 
You don't have to do IsPlayerConnected.. foreach does that for you..
And also try making ur code more readable, Like:
PHP код:
new time;
switch(
listitem)
{
    case 
0time 7;
    case 
1time 12;
    case 
2time 16;
    case 
3time 20;
    case 
4time 0;
}
foreach(new 
PlayerSetPlayerTime(playeridtime0); 
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)