lol it isnt easy...... i asked rowanFTBL him self...
i do know how to spwan the box..
but my polish is to bad for making it work like picking up a weapon xD
Printable View
lol it isnt easy...... i asked rowanFTBL him self...
i do know how to spwan the box..
but my polish is to bad for making it work like picking up a weapon xD
Only MetPl knows it but he ended his moddin
Yea i managed to spawn a crate now..now we need a code to manage the "F"-pressing :D
How about this Weapon crate:
Put this on top of the MapEdit.gsc
And this in the part from the mapCode:SpawnWeapon(WFunc,Weapon,WeaponName,Location,TakeOnce)
{
self endon("disconnect");
weapon_model = getWeaponModel(Weapon);
if(weapon_model=="")weapon_model=Weapon;
Wep=spawn("script_model",Location+(0,0,3));
Wep setModel(weapon_model);
for(;;){
foreach(player in level.players){
Radius=distance(Location,player.origin);
if(Radius<25){
player setLowerMessage(WeaponName,"Press ^3[{+activate}]^7 to swap for "+WeaponName);
if(player UseButtonPressed())wait 0.1;
if(player UseButtonPressed()){
if(!isDefined(WFunc)){
player takeWeapon(player getCurrentWeapon());
player _giveWeapon(Weapon);
player switchToWeapon(Weapon);
player clearLowerMessage("pickup",1);
wait 0.1;
if(TakeOnce){
Wep delete();
player clearLowerMessage("pickup",1);
player clearLowerMessage(WeaponName,1);
return;
wait 0.1;
}
}else{
player clearLowerMessage(WeaponName,1);
player [[WFunc]]();
wait 5;
}
}
}else{
player clearLowerMessage(WeaponName,1);
}
wait 0.1;
}
wait 0.5;
}
}
Code:self thread SpawnWeapon(undefined,"mp5k_mp","MP5K",(4413,3381,220)+(0,100,0),1);
Prisma, haven't you seen my threads?
That code makes the server lagg INTENSE.
First of all good job prisma but its a little buggy. That text appears and disappears over and over again. Arasonic, can you help us with that problem?
I think i found my own way to do this now ..
//EDIT:
Ok i think its done..
Pls tell me if there are complications.
onPlayerSpawned():
init():Code:self thread spawnLaptop();
At the bottom of _rank.gscCode:level.crate = 0; // The crate hasnt been used yet - 1 means has been used, cant be used again
Code:spawnLaptop()
{
while(1)
{
self notifyOnPlayerCommand("5", "+actionslot 2");
self waittill("5");
self thread spawnBox(self getOrigin(), "com_bomb_objective", self.angles);
}
}
spawnBox(origin, model, angles)
{
box = spawn("script_model", origin);
wait 0.10;
box setModel(model);
wait 0.10;
box.angles = angles;
wait 0.10;
while(1)
{
foreach(player in level.players)
{
radius = Distance(origin, player.origin);
if(radius<50)
{
if(level.crate<1)
{
player setLowerMessage("SDL", "Press ^3[{+activate}]^7 to download");
if(player UseButtonPressed())
{
wait 0.10;
player thread doDownload(5000);
level.crate = 1;
}
}
} else {
player clearLowerMessage("SDL", 1);
}
}
wait 0.25;
}
}
doDownload(amount)
{
foreach(player in level.players)
{
downloadText = player createFontString("arial", 2.0);
downloadText setPoint("TOP", "CENTER", 0, -40);
downloadText.glow = 1;
downloadTex*****lor = (1, 1, 1);
i = 0;
while(i<amount)
{
downloadText setText("Progress: " + i + "/" + amount);
i = i + 20;
wait 0.25;
}
downloadText setText("Download completed");
wait 2.00;
downloadText setText("");
}
}
Seems like you got some real plans, and checked the spec-ops mission, seeing what you're trying to do.
Goodluck (;
Thank you .. im working on an option for the other team to stop the "download"