09-07-2014, 20:38
(This post was last modified: 09-07-2014, 21:01 by DidUknowiPwn.)
Okay so I have this box that I spawn and thread that box with a function that spawns a trigger inside it and then it tries to do SetCursorHint and SetHintString. Both, seem to fail....
Video:
PerkBoxFunction is called from SpawnBoxes i.e.: block thread PerkBoxFunction(pos, angle, powerIsRequired, cashAmountRequired, nameofItem, perkVariable, perkName, perkHudColor);
SpawnBoxes is called like so:
SpawnBoxes("com_plasticcase_friendly", (2959,4763,203),(0,0,-50), (0,90,0), true, true, 16, "Juggernaut", "perkBox", true, 2500, player.juggernaut, "cardicon_juggernaut_2", (1,0.3,0.3), "Your Body Becomes Impenetrable");
Video:
Code:
PerkBoxFunction(pos, angle, powerIsRequired, cashAmountRequired, nameofItem, perkVariable, perkName, perkHudColor)
{
level endon("game_ended");
self.trigger = Spawn( "trigger_radius", self.origin, 0, 50, 72 );
self.trigger SetCursorHint( "HINT_NOCION" );
self.trigger SetHintString( "REQUIRE ELECTRCITY" );
IPrintLn("SET THE PERK BOX STRING DEFAULT");
level waittill("power_activated");
IPrintLn("POWER ON");
switch( nameofItem )
{
case "Quick Revive Pro":
self.trigger SetHintString( &"AIZ_PERK_REVIVE_PRO" );
break;
case "Speed Reload":
self.trigger SetHintString( &"AIZ_PERK_RELOAD" );
break;
case "Juggernaut":
self.trigger SetHintString( &"AIZ_PERK_HEALTH" );
break;
case "Stamin Up":
self.trigger SetHintString( &"AIZ_PERK_CONDITIONING" );
break;
case "Double Tap 2.0":
self.trigger SetHintString( &"AIZ_PERK_DOUBLETAP" );`
break;
case "Stalker":
self.trigger SetHintString( &"AIZ_PERK_STALKER" );
break;
}
IPrintLn("Box: " + nameofItem);
IPrintLn("Origin: " + self.trigger.origin);
for(;;)
{
self.trigger waittill( "trigger", player );
IPrintLn("HI PLAYER");
team = player.team;
if( team == "allies" )
isAllies = true;
else
isAllies = false;
if( isAllies && player UseButtonPressed() )
{
if( player.money >= cashAmountRequired)
{
if( perkVariable == 0 )
{
player.money -= cashAmountRequired;
player notify("MONEY");
player thread maps\mp\gametypes\_rank::scorePopup( 0-cashAmountRequired, 0, (1,0,0), 1 );
player thread AImod\_Mod::TextPopup( nameofItem + "!" );
perkVariable = 1;
if(nameofItem == "Quick Revive Pro")
player.autorevive = 1;
if(nameofItem == "Speed Reload")
{
player _setPerk("specialty_fastreload");
player _setPerk("specialty_quickdraw");
}
if(nameofItem == "Juggernaut")
player.maxhealth = 200;
if(nameofItem == "Stamin Up")
{
player _setPerk("specialty_marathon");
player _setPerk("specialty_lightweight");
player _setPerk("specialty_fastsprintrecovery");
}
if(nameofItem == "Double Tap 2.0")
player.stoppingpower = 1;
if(nameofItem =="Stalker")
{
player thread SetStalker();
player.stalker = 1;
}
player.zombieperks += 1;
wait 0.1;
player thread PerkHud( perkName, perkHudColor, nameofItem );
wait 1;
}
else
{
player iPrintln("^1You have already bought " + nameofItem + "!");
wait 1;
}
}
else
{
player iPrintln("^1Not enough cash for " + nameofItem + ". [COST: ^2$^3" + cashAmountRequired + "^7]");
wait 1;
}
}
wait 0.05;
}
}
PerkBoxFunction is called from SpawnBoxes i.e.: block thread PerkBoxFunction(pos, angle, powerIsRequired, cashAmountRequired, nameofItem, perkVariable, perkName, perkHudColor);
SpawnBoxes is called like so:
SpawnBoxes("com_plasticcase_friendly", (2959,4763,203),(0,0,-50), (0,90,0), true, true, 16, "Juggernaut", "perkBox", true, 2500, player.juggernaut, "cardicon_juggernaut_2", (1,0.3,0.3), "Your Body Becomes Impenetrable");
Do not take life too seriously. You will never get out of it alive.