Thank you ^^

Now I don't have problems with saving weapons on each soldier. \:D

EDIT:
At this Code the engine gives a Crash in main and a Invalid arguments in main error:
function CreateAllModelsP1()
{
SoldierCreateP1 = CntP1Soldiers; //set max-count of soldiers in this var
while(SoldierCreateP1 > 0)
{
you = ent_create("soldier.mdl",vector(0,0,500),Soldier);
you.ID = SoldierCreateP1; //set the number for the soldier
you = ent_create("waffe.mdl",vector(0,0,500),WeaponSword);
you.ID = SoldierCreateP1; //set the number for the weapon
SoldierCreateP1 -= 1;
}
}
function main()
{
video_mode = 8;
level_load("grassland.wmb");
wait(10);
CntP1Soldiers = 10; //set max-count of soldiers
CreateAllModelsP1();
while(1)
{
on_mouse_left = Clicked; //Clicking function
wait(1);
}
}

What I writed wrong?

EDIT: It's done. A bad code in the WeaponSword action was the problem.

Last edited by JokeSpeaker; 05/02/08 16:23.