zufallswaffe für alle Spieler auf dem Server

Oi!mel
Hallo,
Ich hab mal eine Script-Frage. Mein Ziel ist es, ein Script zu schreiben das bewirkt dass alle Spieler auf dem Server die gleiche Waffe haben. Diese soll zufällig ausgewählt werden. Allerdings stehe ich aktuell vor dem Problem dass jeder Spieler zwar eine Zufalls-Waffe hat, aber jeder eine andere.
Das ist mein Script:

Code einblendenCode angehängt. Klicke hier zum Ein-/Ausblenden

code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
main() {
thread onNewConnection();
}

onNewConnection() {

for(;;) {
level waittill("connected", player);
player weaponswitch/weapons::setupWeaponsPerSpawn();
}
}


Code einblendenCode angehängt. Klicke hier zum Ein-/Ausblenden

code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
276:
277:
278:
279:
280:
281:
282:
283:
284:
285:
286:
287:
288:
289:
290:
291:
292:
293:
294:
295:
296:
297:
298:
299:
300:
301:
302:
303:
304:
305:
306:
307:
308:
309:
310:
311:
312:
313:
314:
315:
316:
317:
318:
319:
320:
321:
322:
323:
324:
325:
326:
327:
328:
329:
330:
331:
332:
333:
334:
335:
336:
337:
338:
339:
340:
341:
342:
343:
344:
345:
346:
347:
348:
349:
350:
351:
352:
353:
354:
355:
356:
357:
358:
359:
360:
361:
362:
363:
364:
365:
366:
367:
368:
369:
370:
371:
372:
373:
374:
375:
376:
377:
378:
379:
380:
381:
382:
383:
384:
385:
386:
387:
388:
389:
390:
391:
392:
393:
394:
395:
396:
397:
398:
399:
400:
401:
402:
403:
404:
405:
406:
407:
408:
409:
410:
411:
412:
413:
414:
415:
416:
417:
418:
419:
420:
421:
422:
423:
424:
425:
426:
427:
428:
429:
430:
431:
432:
433:
434:
435:
436:
437:
438:
439:
440:
441:
442:
443:
444:
445:
446:
447:
448:
449:
450:
451:
452:
453:
454:
455:
456:
457:
458:
459:
460:
461:
462:
463:
464:
465:
466:
467:
468:
469:
470:
471:
472:
473:
474:
475:
476:
477:
478:
479:
480:
481:
482:
483:
484:
485:
486:
487:
488:
489:
490:
491:
492:
493:
494:
495:
496:
497:
498:
499:
500:
501:
502:
503:
504:
505:
506:
507:
508:
509:
510:
511:
512:
513:
514:
515:
516:
517:
518:
519:
520:
521:
522:
523:
setupWeaponsPerSpawn(){
random = randomintrange( 1, 30 );
switch( random )
{
case 1: ak47_mp();
break;
case 2: ak47_gl_mp();
break;
case 3: ak74u_mp();
break;
case 4: ak47_mp();
break;
case 5: barrett_mp();
break;
case 6: beretta_mp();
break;
case 7: deserteaglegold_mp();
break;
case 8: colt45_mp();
break;
case 9: deserteagle_mp();
break;
case 10: deserteaglegold_mp();
break;
case 11: g3_silencer_mp();
break;
case 12: g36c_reflex_mp();
break;
case 13: m1014_grip_mp();
break;
case 14: m14_mp();
break;
case 15: m16_mp();
break;
case 16: m4_reflex_mp();
break;
case 17: m21_mp();
break;
case 18: m40a3_mp();
break;
case 19: m60e4_reflex_mp();
break;
case 20: mp44_mp();
break;
case 21: mp5_mp();
break;
case 22: p90_mp();
break;
case 23: remington700_mp();
break;
case 24: rpd_mp();
break;
case 25: p90_mp();
break;
case 26: saw_grip_mp();
break;
case 27: skorpion_silencer_mp();
break;
case 28: usp_mp();
break;
case 29: uzi_silencer_mp();
break;
case 30: winchester1200_mp();
break;
default: break;
}
}

ak47_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("ak47_mp");
self GiveMaxAmmo("ak47_mp");
wait 0.5;
self SwitchToWeapon("ak47_mp");
}
}

ak47_gl_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("ak47_gl_mp");
self GiveMaxAmmo("ak47_gl_mp");
wait 0.5;
self SwitchToWeapon("ak47_gl_mp");
}
}

ak74u_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("ak74u_mp");
self GiveMaxAmmo("ak74u_mp");
wait 0.5;
self SwitchToWeapon("ak74u_mp");
}
}

knife_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("beretta_mp");
self GiveMaxAmmo("beretta_mp");
wait 0.5;
self SwitchToWeapon("beretta_mp");
self setweaponammostock("beretta_mp", 0);
self setweaponammoclip("beretta_mp", 0);
}
}

barrett_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("barrett_mp");
self GiveMaxAmmo("barrett_mp");
wait 0.5;
self SwitchToWeapon("barrett_mp");
}
}

beretta_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("beretta_mp");
self GiveMaxAmmo("beretta_mp");
wait 0.5;
self SwitchToWeapon("beretta_mp");
}
}

c4_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("c4_mp");
self GiveMaxAmmo("c4_mp");
wait 0.5;
self SwitchToWeapon("c4_mp");
self setweaponammostock("c4_mp", 8);
self setweaponammoclip("c4_mp", 8);
}
}

colt45_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("colt45_mp");
self GiveMaxAmmo("colt45_mp");
wait 0.5;
self SwitchToWeapon("colt45_mp");
}
}

deserteagle_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("deserteagle_mp");
self GiveMaxAmmo("deserteagle_mp");
wait 0.5;
self SwitchToWeapon("deserteagle_mp");
}
}

deserteaglegold_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("deserteaglegold_mp");
self GiveMaxAmmo("deserteaglegold_mp");
wait 0.5;
self SwitchToWeapon("deserteaglegold_mp");
}
}

g3_silencer_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("g3_silencer_mp");
self GiveMaxAmmo("g3_silencer_mp");
wait 0.5;
self SwitchToWeapon("g3_silencer_mp");
}
}

g36c_reflex_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("g36c_reflex_mp");
self GiveMaxAmmo("g36c_reflex_mp");
wait 0.5;
self SwitchToWeapon("g36c_reflex_mp");
}
}

m1014_grip_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("m1014_grip_mp");
self GiveMaxAmmo("m1014_grip_mp");
wait 0.5;
self SwitchToWeapon("m1014_grip_mp");
}
}

m14_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("m14_mp");
self GiveMaxAmmo("m14_mp");
wait 0.5;
self SwitchToWeapon("m14_mp");
}
}

m16_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("m16_mp");
self GiveMaxAmmo("m16_mp");
wait 0.5;
self SwitchToWeapon("m16_mp");
}
}

m4_reflex_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("m4_reflex_mp");
self GiveMaxAmmo("m4_reflex_mp");
wait 0.5;
self SwitchToWeapon("m4_reflex_mp");
}
}

m21_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("m21_mp");
self GiveMaxAmmo("m21_mp");
wait 0.5;
self SwitchToWeapon("m21_mp");
}
}

m40a3_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("m40a3_mp");
self GiveMaxAmmo("m40a3_mp");
wait 0.5;
self SwitchToWeapon("m40a3_mp");
}
}

m60e4_reflex_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("m60e4_reflex_mp");
self GiveMaxAmmo("m60e4_reflex_mp");
wait 0.5;
self SwitchToWeapon("m60e4_reflex_mp");
}
}

mp44_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("mp44_mp");
self GiveMaxAmmo("mp44_mp");
wait 0.5;
self SwitchToWeapon("mp44_mp");
}
}

mp5_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("mp5_mp");
self GiveMaxAmmo("mp5_mp");
wait 0.5;
self SwitchToWeapon("mp5_mp");
}
}

p90_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("p90_mp");
self GiveMaxAmmo("p90_mp");
wait 0.5;
self SwitchToWeapon("p90_mp");
}
}

remington700_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("remington700_mp");
self GiveMaxAmmo("remington700_mp");
wait 0.5;
self SwitchToWeapon("remington700_mp");
}
}

rpd_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("rpd_mp");
self GiveMaxAmmo("rpd_mp");
wait 0.5;
self SwitchToWeapon("rpd_mp");
}
}

rpg_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("rpg_mp");
self GiveMaxAmmo("rpg_mp");
wait 0.5;
self SwitchToWeapon("rpg_mp");
self setweaponammostock("rpg_mp", 2);
self setweaponammoclip("rpg_mp", 8);
}
}

saw_grip_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("saw_grip_mp");
self GiveMaxAmmo("saw_grip_mp");
wait 0.5;
self SwitchToWeapon("saw_grip_mp");
}
}

skorpion_silencer_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("skorpion_silencer_mp");
self GiveMaxAmmo("skorpion_silencer_mp");
wait 0.5;
self SwitchToWeapon("skorpion_silencer_mp");
}
}

usp_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("usp_mp");
self GiveMaxAmmo("usp_mp");
wait 0.5;
self SwitchToWeapon("usp_mp");
}
}

uzi_silencer_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("uzi_silencer_mp");
self GiveMaxAmmo("uzi_silencer_mp");
wait 0.5;
self SwitchToWeapon("uzi_silencer_mp");
}
}

winchester1200_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon("winchester1200_mp");
self GiveMaxAmmo("winchester1200_mp");
wait 0.5;
self SwitchToWeapon("winchester1200_mp");
}
}



Mir ist klar das das ganze etwas unvorteilhaft gecoded ist und viel einfacher wäre, darüber hab ich mir aber jetzt noch keinen Kopf gemacht.

level waittill("connected", player);
player weaponswitch\weapons::setupWeaponsPerSpawn();
Diese Zeilen bewirken dass jeder Spieler die Zufallsauswahl eigenständig vornimmt. Deshalb hat jeder eine andere Waffe. Beim Versuch den Server einen Zufallsauswahl treffen zu lassen und den Spieler die Waffe dann zu geben bin ich bislang gescheitert. Dieses Script zeigt meinen Versuch:

Code einblendenCode angehängt. Klicke hier zum Ein-/Ausblenden

code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
main() {
thread onNewConnection();
}

onNewConnection() {

for(;;) {
//level waittill("connected", player);
thread weaponswitch/weapons::setupWeaponsPerSpawn();
}
}


Code einblendenCode angehängt. Klicke hier zum Ein-/Ausblenden

code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
276:
277:
278:
279:
280:
281:
282:
283:
284:
285:
286:
287:
288:
289:
290:
291:
292:
293:
294:
295:
296:
297:
298:
299:
300:
301:
302:
303:
304:
305:
306:
307:
308:
309:
310:
311:
312:
313:
314:
315:
316:
317:
318:
319:
320:
321:
322:
323:
324:
325:
326:
327:
328:
329:
330:
331:
332:
333:
334:
335:
336:
337:
338:
339:
340:
341:
342:
343:
344:
345:
346:
347:
348:
349:
350:
351:
352:
353:
354:
355:
356:
357:
358:
359:
360:
361:
362:
363:
364:
365:
366:
367:
368:
369:
370:
371:
372:
373:
374:
375:
376:
377:
378:
379:
380:
381:
382:
383:
384:
385:
386:
387:
388:
389:
390:
391:
392:
393:
394:
395:
396:
397:
398:
399:
400:
401:
402:
403:
404:
405:
406:
407:
408:
409:
410:
411:
412:
413:
414:
415:
416:
417:
418:
419:
420:
421:
422:
423:
424:
425:
426:
427:
428:
429:
430:
431:
432:
433:
434:
435:
436:
437:
438:
439:
440:
441:
442:
443:
444:
445:
446:
447:
448:
449:
450:
451:
452:
453:
454:
455:
456:
457:
458:
459:
460:
461:
462:
463:
464:
465:
466:
467:
468:
469:
470:
471:
472:
473:
474:
475:
476:
477:
478:
479:
480:
481:
482:
483:
484:
485:
486:
487:
488:
489:
490:
491:
492:
493:
494:
495:
496:
497:
498:
499:
500:
501:
502:
503:
504:
505:
506:
507:
508:
509:
510:
511:
512:
513:
514:
515:
516:
517:
518:
519:
520:
521:
522:
523:
524:
setupWeaponsPerSpawn(){
random = randomintrange( 1, 30 );
level waittill("connected", player);
switch( random )
{
case 1: player ak47_mp();
break;
case 2: player ak47_gl_mp();
break;
case 3: player ak74u_mp();
break;
case 4: player ak47_mp();
break;
case 5: player barrett_mp();
break;
case 6: player beretta_mp();
break;
case 7: player deserteaglegold_mp();
break;
case 8: player colt45_mp();
break;
case 9: player deserteagle_mp();
break;
case 10: player deserteaglegold_mp();
break;
case 11: player g3_silencer_mp();
break;
case 12: player g36c_reflex_mp();
break;
case 13: player m1014_grip_mp();
break;
case 14: player m14_mp();
break;
case 15: player m16_mp();
break;
case 16: player m4_reflex_mp();
break;
case 17: player m21_mp();
break;
case 18: player m40a3_mp();
break;
case 19: player m60e4_reflex_mp();
break;
case 20: player mp44_mp();
break;
case 21: player mp5_mp();
break;
case 22: player p90_mp();
break;
case 23: player remington700_mp();
break;
case 24: player rpd_mp();
break;
case 25: player p90_mp();
break;
case 26: player saw_grip_mp();
break;
case 27: player skorpion_silencer_mp();
break;
case 28: player usp_mp();
break;
case 29: player uzi_silencer_mp();
break;
case 30: player winchester1200_mp();
break;
default: break;
}
}

ak47_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("ak47_mp";);
self GiveMaxAmmo("ak47_mp";);
wait 0.5;
self SwitchToWeapon("ak47_mp";);
}
}

ak47_gl_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("ak47_gl_mp";);
self GiveMaxAmmo("ak47_gl_mp";);
wait 0.5;
self SwitchToWeapon("ak47_gl_mp";);
}
}

ak74u_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("ak74u_mp";);
self GiveMaxAmmo("ak74u_mp";);
wait 0.5;
self SwitchToWeapon("ak74u_mp";);
}
}

knife_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("beretta_mp";);
self GiveMaxAmmo("beretta_mp";);
wait 0.5;
self SwitchToWeapon("beretta_mp";);
self setweaponammostock("beretta_mp", 0);
self setweaponammoclip("beretta_mp", 0);
}
}

barrett_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("barrett_mp";);
self GiveMaxAmmo("barrett_mp";);
wait 0.5;
self SwitchToWeapon("barrett_mp";);
}
}

beretta_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("beretta_mp";);
self GiveMaxAmmo("beretta_mp";);
wait 0.5;
self SwitchToWeapon("beretta_mp";);
}
}

c4_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("c4_mp";);
self GiveMaxAmmo("c4_mp";);
wait 0.5;
self SwitchToWeapon("c4_mp";);
self setweaponammostock("c4_mp", 8);
self setweaponammoclip("c4_mp", 8);
}
}

colt45_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("colt45_mp";);
self GiveMaxAmmo("colt45_mp";);
wait 0.5;
self SwitchToWeapon("colt45_mp";);
}
}

deserteagle_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("deserteagle_mp";);
self GiveMaxAmmo("deserteagle_mp";);
wait 0.5;
self SwitchToWeapon("deserteagle_mp";);
}
}

deserteaglegold_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("deserteaglegold_mp";);
self GiveMaxAmmo("deserteaglegold_mp";);
wait 0.5;
self SwitchToWeapon("deserteaglegold_mp";);
}
}

g3_silencer_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("g3_silencer_mp";);
self GiveMaxAmmo("g3_silencer_mp";);
wait 0.5;
self SwitchToWeapon("g3_silencer_mp";);
}
}

g36c_reflex_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("g36c_reflex_mp";);
self GiveMaxAmmo("g36c_reflex_mp";);
wait 0.5;
self SwitchToWeapon("g36c_reflex_mp";);
}
}

m1014_grip_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("m1014_grip_mp";);
self GiveMaxAmmo("m1014_grip_mp";);
wait 0.5;
self SwitchToWeapon("m1014_grip_mp";);
}
}

m14_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("m14_mp";);
self GiveMaxAmmo("m14_mp";);
wait 0.5;
self SwitchToWeapon("m14_mp";);
}
}

m16_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("m16_mp";);
self GiveMaxAmmo("m16_mp";);
wait 0.5;
self SwitchToWeapon("m16_mp";);
}
}

m4_reflex_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("m4_reflex_mp";);
self GiveMaxAmmo("m4_reflex_mp";);
wait 0.5;
self SwitchToWeapon("m4_reflex_mp";);
}
}

m21_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("m21_mp";);
self GiveMaxAmmo("m21_mp";);
wait 0.5;
self SwitchToWeapon("m21_mp";);
}
}

m40a3_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("m40a3_mp";);
self GiveMaxAmmo("m40a3_mp";);
wait 0.5;
self SwitchToWeapon("m40a3_mp";);
}
}

m60e4_reflex_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("m60e4_reflex_mp";);
self GiveMaxAmmo("m60e4_reflex_mp";);
wait 0.5;
self SwitchToWeapon("m60e4_reflex_mp";);
}
}

mp44_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("mp44_mp";);
self GiveMaxAmmo("mp44_mp";);
wait 0.5;
self SwitchToWeapon("mp44_mp";);
}
}

mp5_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("mp5_mp";);
self GiveMaxAmmo("mp5_mp";);
wait 0.5;
self SwitchToWeapon("mp5_mp";);
}
}

p90_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("p90_mp";);
self GiveMaxAmmo("p90_mp";);
wait 0.5;
self SwitchToWeapon("p90_mp";);
}
}

remington700_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("remington700_mp";);
self GiveMaxAmmo("remington700_mp";);
wait 0.5;
self SwitchToWeapon("remington700_mp";);
}
}

rpd_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("rpd_mp";);
self GiveMaxAmmo("rpd_mp";);
wait 0.5;
self SwitchToWeapon("rpd_mp";);
}
}

rpg_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("rpg_mp";);
self GiveMaxAmmo("rpg_mp";);
wait 0.5;
self SwitchToWeapon("rpg_mp";);
self setweaponammostock("rpg_mp", 2);
self setweaponammoclip("rpg_mp", 8);
}
}

saw_grip_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("saw_grip_mp";);
self GiveMaxAmmo("saw_grip_mp";);
wait 0.5;
self SwitchToWeapon("saw_grip_mp";);
}
}

skorpion_silencer_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("skorpion_silencer_mp";);
self GiveMaxAmmo("skorpion_silencer_mp";);
wait 0.5;
self SwitchToWeapon("skorpion_silencer_mp";);
}
}

usp_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("usp_mp";);
self GiveMaxAmmo("usp_mp";);
wait 0.5;
self SwitchToWeapon("usp_mp";);
}
}

uzi_silencer_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("uzi_silencer_mp";);
self GiveMaxAmmo("uzi_silencer_mp";);
wait 0.5;
self SwitchToWeapon("uzi_silencer_mp";);
}
}

winchester1200_mp()
{
self endon( "disconnect" );
for(;;)
{
self waittill("spawned_player";);
self takeAllWeapons();
self ClearPerks();
self giveWeapon("winchester1200_mp";);
self GiveMaxAmmo("winchester1200_mp";);
wait 0.5;
self SwitchToWeapon("winchester1200_mp";);
}
}



Allerdings hängt das Spiel bei ca. einem sechstel des Ladebalkens komplett.
Kann mir jemand helfen wie ich das Script zu ändern habe?

Dankeschön =)
wgs./w@Lly
Hast du dir den Modus "Oldschool" mal angeschaut? Dort spawnen ja auch Waffen an festen Stellen, allerdings meines Wissens auch random. Aber vielleicht bringt dich das ein bisschen weiter.
Oi!mel
Danke, aber hat mir leider nix gebracht, da ja bei Oldschool auch lauter verschiedene Waffen spawnen. Ich bräuchte ja für jeden die gleiche.
Oi!mel
Mittlerweile funktioniert es. Weiß jemand wie ich das Menü welches zur Waffen- und Klassenauswahl dient entfernt? Man wählt Team und kann sofort spielen?
Nightwing
Sauber, wie hast Du es jetzt gelöst?
Für die Teamauswahl müsstest Du mal in die _oldschool.gsc schauen, da bei Oldschool der Teameintritt so funktioniert, wie von Dir beschrieben (falls ich mich nicht irre).

ToM
Oi!mel
Ich habs nicht gelöst, das war _DanTheMan_.

Code einblendenCode angehängt. Klicke hier zum Ein-/Ausblenden

code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
setupWeaponsPerSpawn(){

weapons = [];
weapons[0] = "ak47_mp";
weapons[1] = "ak47_gl_mp";
weapons[2] = "ak74u_mp";
weapons[3] = "barrett_mp";
weapons[4] = "beretta_mp";
weapons[5] = "colt45_mp";
weapons[6] = "deserteagle_mp";
weapons[7] = "deserteaglegold_mp";
weapons[8] = "g3_silencer_mp";
weapons[9] = "g36c_reflex_mp";
weapons[10] = "m1014_grip_mp";
weapons[11] = "m14_mp";
weapons[12] = "m16_mp";
weapons[13] = "m4_reflex_mp";
weapons[14] = "m21_mp";
weapons[15] = "m40a3_mp";
weapons[16] = "m60e4_reflex_mp";
weapons[17] = "mp44_mp";
weapons[18] = "mp5_mp";
weapons[19] = "p90_mp";
weapons[20] = "remington700_mp";
weapons[21] = "rpd_mp";
weapons[22] = "p90_mp";
weapons[23] = "saw_grip_mp";
weapons[24] = "skorpion_silencer_mp";
weapons[25] = "uzi_silencer_mp";
weapons[26] = "winchester1200_mp";

if(!isDefined(level.modCurrRound))
{
level.modCurrRound = game["roundsplayed"];
level.randWeapon = weapons[randomInt(27)];
}

if(level.modCurrRound != game["roundsplayed"])
{
int = randomInt(27);
tempWeap = level.randWeapon;
newWeap = weapons[int];
if(tempWeap == newWeap)
newWeap = weapons[int + (1*(int < 26)) - (1*(int > 0))];
level.randWeapon = newWeap;
}

self waittill("spawned_player");
self takeAllWeapons();
self ClearPerks();
self giveWeapon(level.randWeapon);
self GiveMaxAmmo(level.randWeapon);
wait 0.5;
self SwitchToWeapon(level.randWeapon);
}



Mit der _oldschool.gsc komm ich nicht klar. Ich hab einiges ausprobiert und bin nun soweit dass man sobal man die Waffe wechselt garkeine mehr in der Hand hat.
OLD MAN WITH GUN

Zitat:

Original von Nightwing
Sauber, wie hast Du es jetzt gelöst?
Für die Teamauswahl müsstest Du mal in die _oldschool.gsc schauen, da bei Oldschool der Teameintritt so funktioniert, wie von Dir beschrieben (falls ich mich nicht irre).
Da wird er vergeblich suchen Augenzwinkern , denn die Funktion, die für den unterschiedlichen Spielstart (oldschool oder nicht), steht nicht in der _oldschool.gsc sondern in der _globallogic.gsc (in der Funktion SpawnPlayer)

Code einblendenCode angehängt. Klicke hier zum Ein-/Ausblenden

code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
	if ( level.oldschool )
	{
		assert( !isDefined( self.class ) );
		self maps\mp\gametypes\_oldschool::giveLoadout();
		self maps\mp\gametypes\_class::setClass( level.defaultClass );
	}
	else
	{
		assert( isValidClass( self.class ) );
		
		self maps\mp\gametypes\_class::setClass( self.class );
		self maps\mp\gametypes\_class::giveLoadout( self.team, self.class );
	}

Oi!mel
Um ehrlich zu sein komm ich nicht klar damit.

Code einblendenCode angehängt. Klicke hier zum Ein-/Ausblenden

code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
init()
{
game["menu_team"] = "team_marinesopfor";
game["menu_class_allies"] = "class_marines";
game["menu_changeclass_allies"] = "changeclass_marines_mw";
game["menu_class_axis"] = "class_opfor";
game["menu_changeclass_axis"] = "changeclass_opfor_mw";
game["menu_class"] = "class";
game["menu_changeclass"] = "changeclass_mw";
game["menu_changeclass_offline"] = "changeclass_offline";

game["menu_callvote"] = "callvote";
game["menu_muteplayer"] = "muteplayer";
precacheMenu(game["menu_callvote"]);
precacheMenu(game["menu_muteplayer"]);

// game summary popups
game["menu_eog_unlock"] = "popup_unlock";
game["menu_eog_summary"] = "popup_summary";
game["menu_eog_unlock_page1"] = "popup_unlock_page1";
game["menu_eog_unlock_page2"] = "popup_unlock_page2";

precacheMenu(game["menu_eog_unlock"]);
precacheMenu(game["menu_eog_summary"]);
precacheMenu(game["menu_eog_unlock_page1"]);
precacheMenu(game["menu_eog_unlock_page2"]);

precacheMenu("scoreboard");
precacheMenu(game["menu_team"]);
precacheMenu(game["menu_class_allies"]);
precacheMenu(game["menu_changeclass_allies"]);
precacheMenu(game["menu_class_axis"]);
precacheMenu(game["menu_changeclass_axis"]);
precacheMenu(game["menu_class"]);
precacheMenu(game["menu_changeclass"]);
precacheMenu(game["menu_changeclass_offline"]);
precacheString( &"MP_HOST_ENDED_GAME" );
precacheString( &"MP_HOST_ENDGAME_RESPONSE" );

level thread onPlayerConnect();
}

onPlayerConnect()
{
for(;;)
{
level waittill("connecting", player);

player setClientDvar("ui_3dwaypointtext", "1");
player.enable3DWaypoints = true;
player setClientDvar("ui_deathicontext", "1");
player.enableDeathIcons = true;
player.classType = undefined;
player.selectedClass = false;

player thread onMenuResponse();
}
}

onMenuResponse()
{
self endon("disconnect");

for(;;)
{
self waittill("menuresponse", menu, response);

println( self getEntityNumber() + " menuresponse: " + menu + " " + response );

if ( response == "back" )
{
self closeMenu();
self closeInGameMenu();
if ( menu == "changeclass" && self.pers["team"] == "allies" )
{
self openMenu( game["menu_changeclass_allies"] );
}
else if ( menu == "changeclass" && self.pers["team"] == "axis" )
{
self openMenu( game["menu_changeclass_axis"] );
}
continue;
}

if( getSubStr( response, 0, 7 ) == "loadout" )
{
self mapsmpgametypes_modwarfare::processLoadoutResponse( response );
continue;
}

if( response == "changeteam" )
{
self closeMenu();
self closeInGameMenu();
//self openMenu(game["menu_team"]);
}

if( response == "changeclass_marines" )
{
self closeMenu();
self closeInGameMenu();
//self openMenu( game["menu_changeclass_allies"] );
continue;
}

if( response == "changeclass_opfor" )
{
self closeMenu();
self closeInGameMenu();
//self openMenu( game["menu_changeclass_axis"] );
continue;
}

if( response == "endgame" )
{
continue;
}

if( menu == game["menu_team"] )
{
switch(response)
{
case "allies":
self closeMenu();
self closeInGameMenu();
self [[level.allies]]();
break;

case "axis":
self closeMenu();
self closeInGameMenu();
self [[level.axis]]();
break;

case "autoassign":
self closeMenu();
self closeInGameMenu();
self [[level.autoassign]]();
break;

case "spectator":
//self closeMenu();
//self closeInGameMenu();
self [[level.spectator]]();
break;
}
} // the only responses remain are change class events
else if( menu == game["menu_changeclass_allies"] || menu == game["menu_changeclass_axis"] )
{
if ( !self mapsmpgametypes_modwarfare::verifyClassChoice( self.pers["team"], response ) )
continue;

self mapsmpgametypes_modwarfare::setClassChoice( response );
self closeMenu();
self closeInGameMenu();
self openMenu( game["menu_changeclass"] );
continue;
}
else if( menu == game["menu_changeclass"] )
{
self closeMenu();
self closeInGameMenu();

self.selectedClass = true;
self mapsmpgametypes_modwarfare::menuAcceptClass();
}
else if ( !level.console )
{
if(menu == game["menu_quickcommands"])
mapsmpgametypes_quickmessages::quickcommands(response);
else if(menu == game["menu_quickstatements"])
mapsmpgametypes_quickmessages::quickstatements(response);
else if(menu == game["menu_quickresponses"])
mapsmpgametypes_quickmessages::quickresponses(response);
}

}
}



Diese paar Änderungen in der _menus.gsc brachten mich ans Ziel.
Oi!mel
Ich musste leider feststellen dass die Änderungen zur Folge haben dass alle Spieler unsichtbar sind und unsterblich. Kann mir jemand helfen?