Results 1 to 5 of 5
  1. #1
    Yamato's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    839
    Reputation
    13
    Thanks
    152
    My Mood
    Amazed

    Is this code correct?

    I am trying to do a random weapon box(like WaW zombies), I made a small part and I saw some other in another forum, at the end I got this:

    Code:
    CreateRandomWeaponBox(O,T){
    B=spawn("script_model",O);B setModel("com_plasticcase_friendly");B Solid();B CloneBrushmodelToScriptmodel(level.airDropCrateCollision);
    W=spawn("script_model",O);W Solid();
    RM=randomint(9999);I=[];X=[];
    I[0]="glock_akimbo_fmj_mp";X[0]=10;
    I[1]="mg4_fmj_grip_mp";X[1]=8;
    I[2]="aa12_fmj_xmags_mp";X[2]=10;
    I[3]="model1887_akimbo_fmj_mp";X[3]=12;
    I[4]="ranger_akimbo_fmj_mp";X[4]=12;
    I[5]="spas12_fmj_grip_mp";X[5]=14;
    I[6]="m1014_fmj_xmags_mp";X[6]=20;
    I[7]="uzi_akimbo_xmags_mp";X[7]=12;
    I[8]="ak47_mp";X[8]=10;
    I[9]="m4_acog_mp";X[9]=10;
    I[10]="fal_mp";X[10]=8;
    I[11]="mp5k_fmj_silencer_mp";X[11]=8;
    I[12]="deserteaglegold_mp";X[12]=5;
    Y=0;for(V=0;V
    for(;Wink{
    foreach(P in level.players){
    wait 0.01;
    if(IsDefined(T)&&P.pers["team"]!=T)continue;
    R=distance(O,P.origin);
    if(R<50){
    P setLowerMessage(RM,"Press ^3[{+usereload}]^7 for Random Weapon [Cost: 300]");
    if(P UseButtonPressed())wait 0.1;
    if(P UseButtonPressed()){
    P clearLowerMessage(RM,1);
    if(P.bounty>299){P.bounty-=400;P notify("doCash");
    RW="";J=0;G=randomint(Y);for(V=0;VG)break;}
    W setModel(getWeaponModel(RW));
    W MoveTo(O+(0,0,25),1);
    wait 0.2;
    if(P GetWeaponsListPrimaries().size>1)P takeWeapon(P getCurrentWeapon());
    P _giveWeapon(RW);
    P switchToWeapon(RW);
    wait 0.6;
    W MoveTo(O,1);
    wait 0.2;
    W setModel("");
    }else{
    P iPrintlnBold("^1You DO NOT Have Enough Cash!");
    wait 0.05;
    }
    }
    }else{
    P clearLowerMessage(RM,1);
    }
    }
    }
    Is it correct?(with ffviewer no sintax errors)

  2. #2
    [WhA]4FunPlayinBackup's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    28
    Reputation
    10
    Thanks
    1
    My Mood
    Bitchy

  3. #3
    Yamato's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    839
    Reputation
    13
    Thanks
    152
    My Mood
    Amazed
    Quote Originally Posted by [WhA]4FunPlayinBackup View Post
    But it is from WaW, some models and stuff are not the same.

  4. #4
    [WhA]4FunPlayinBackup's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    28
    Reputation
    10
    Thanks
    1
    My Mood
    Bitchy
    Those models don't exist in WaW they were custom models (mod support) just look how he did it.

  5. #5
    Yamato's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    839
    Reputation
    13
    Thanks
    152
    My Mood
    Amazed
    Quote Originally Posted by [WhA]4FunPlayinBackup View Post
    Those models don't exist in WaW they were custom models (mod support) just look how he did it.
    ok, thanks