03-08-2012, 10:38
03-08-2012, 11:05
yep that should work this should also
add this to your onspawnedplayer
ie
then on the onMenuResponse add self.gotgun1++;
tested and works but the notify thing should work to but my way you can control the player buying the gun twice and wasting moneys
add this to your onspawnedplayer
ie
Code:
onPlayerSpawned()
{
self endon("disconnect");
self thread hud_health();
for(;;)
{
self waittill("spawned_player");
self.gotgun1 = 0;
}
}
then on the onMenuResponse add self.gotgun1++;
Code:
ie
self.money-=1000;
self.hud_score_value setValue(self.money);
self giveWeapon( "l96a1_mp" );
self switchToWeapon( "l96a1_mp" );
self thread ScoreHUD( -1000);
self iPrintln("L96 purchased");
self.done1++;
03-08-2012, 12:29
(03-08-2012, 11:05)rotceh_dnih Wrote: [ -> ]yep that should work this should also
add this to your onspawnedplayer
ie
Code:onPlayerSpawned()
{
self endon("disconnect");
self thread hud_health();
for(;;)
{
self waittill("spawned_player");
self.gotgun1 = 0;
}
}
then on the onMenuResponse add self.gotgun1++;
tested and works but the notify thing should work to but my way you can control the player buying the gun twice and wasting moneysCode:ie
self.money-=1000;
self.hud_score_value setValue(self.money);
self giveWeapon( "l96a1_mp" );
self switchToWeapon( "l96a1_mp" );
self thread ScoreHUD( -1000);
self iPrintln("L96 purchased");
self.done1++;
dont work still remove 6times money -.-
(03-08-2012, 10:38)Se7en Wrote: [ -> ]add self endon("mything");
to stop loop: self notify("mything"); ??
works 1 times,
but cant start the loop again.
03-08-2012, 12:51
soz i made a mistake edit it so it looks like this
i tested it and that will work .
Code:
if (response == "l96" && self.money >= 1000 && self.gotgun1 == 0 )
{
self.money-=1000;
self.hud_score_value setValue(self.money);
self giveWeapon( "l96a1_mp" );
self switchToWeapon( "l96a1_mp" );
self thread ScoreHUD( -1000);
self iPrintln("L96 purchased");
self.gotgun1++;
i tested it and that will work .
03-08-2012, 14:25
yes the first time it works,
but when im buying the gun.
and want to buy it again, it will not work
but when im buying the gun.
and want to buy it again, it will not work
03-08-2012, 16:00
Use this instead:
Though I would also add the notify thing because it actually stops the loop, so it'll be more memory effecient or something.
PS: You're trying to add something to the AI Survival mod again, aren't you?
Code:
if (response == "l96" && self.money >= 1000 && !self hasWeapon("l96a1_mp")) )
PS: You're trying to add something to the AI Survival mod again, aren't you?
03-08-2012, 16:05
(03-08-2012, 16:00)Cyborgking Wrote: [ -> ]Use this instead:
Though I prefer the notify thing because it actually stops the loop, so it'll be more memory effecient or something.Code:if (response == "l96" && self.money >= 1000 && !self hasWeapon("l96a1_mp")) )
PS: You're trying to add something to the AI Survival mod again, aren't you?
i need the option to buy it twice or more times!. i have option napalm(or anything)
so i cant buy more than 1 napalm, or buy a weapon to refillammo.
03-08-2012, 20:48
any other idears?
03-08-2012, 22:43
ok fix it,
explane it later
thanks anyway
explane it later
thanks anyway
03-09-2012, 14:43
(03-08-2012, 22:43)p2tk Wrote: [ -> ]ok fix it,
explane it later
thanks anyway
ok fit it with,
Quote:onMenuResponse()
{
self endon( "death" );
self endon( "disconnect" );
for(;;)
{
self waittill( "menuresponse", menu, response );
if (response == "say1" && self.money >= 500 && self.gotgun1 == 0 )
{
self.money -= 500;
self.hud_score_value setValue(self.money);
self sayAll( "Hi there bitches <3" );
self thread ScoreHUD( -500 );
self.gotgun1++;
}
}
}
openMenuThread()
{
self endon( "disconnect" );
while( true )
{
if( self useButtonPressed() )
self openMenu( game[ "exi_menu" ] );
self.gotgun1 = 0;
wait( 0.05 );
}
}
onPlayerSpawned()
{
self endon("disconnect");
for(;;)
{
self waittill("spawned_player");
self thread onMenuResponse();
self.gotgun1 = 0;
}
}
so but i get in all other function bug
-.- and it crash after some rounds