AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   loop command (https://forums.alliedmods.net/showthread.php?t=5940)

Kurai-Domi 09-17-2004 06:50

loop command
 
i want to repeat a command as long is recieve a specified value how can i do that?

i tried:

for(new i=1;i<300;i++)
{
if (ent_get_int(i,ENT_INT_modelindex) = 180)
{
client_print(id,print_center,"Did it!"
}
}

but it doesn't work plz help me

johnjg75 09-17-2004 10:03

try changing
Code:
client_print(id,print_center,"Did it!"
to
Code:
client_print(id,print_center,"Did it!")

Kurai-Domi 09-19-2004 09:59

thats not the prob i just made a mistake...
i can't build that in a
public name(id)
because it says in console "command not found"

i need to put it in a task, but i see many plugins that use that kind of command in a normal (id) thingy how can i do that too?

BillyTheKid 09-22-2004 23:00

Quote:

Originally Posted by Kurai-Domi
thats not the prob i just made a mistake...
i can't build that in a
public name(id)
because it says in console "command not found"

i need to put it in a task, but i see many plugins that use that kind of command in a normal (id) thingy how can i do that too?

I like while statements better!!!!!! I'm not a big for fan.

Try a while statement

BAILOPAN 09-22-2004 23:03

You're looping between random entities.

You should first check if the entity is even valid before trying to extrapolate data from it.


All times are GMT -4. The time now is 17:11.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.