ItsMods

Full Version: Need Help To Make My 1st Code!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
(03-31-2012, 20:23)VerifyerModderz Wrote: [ -> ]Thankz orange , and thankz Yamato <3
Yamato: Yo quiero que cada 3 segundos caiga una care package y diga Care Package Spawned , y esto:
CarePackage = Spawn("script_model",(0,0,0));
CarePackage SetModel("com_plasticcase_friendly");

Solo me spawnea una care package , pero no caen cada 3 segundos con eso , me podes decir el code para que caigan care packages cada 3 segundos porfavor?

The previous code did so, the problem is that you are spawning all in the coordinate ( 0, 0, 0 ). Change it for example to: self.origin

Code:
CarePackagezz()
{
self endon( "discconect" );
self endon( "death" );
while(1)
{
CarePackage = Spawn("script_model",(0,0,0));
CarePackage SetModel("com_plasticcase_friendly");
self iPrintlnBold("Care Package Spawned!");
wait 3;
}
}
So Like This:

CarePackagezz()
{
self endon( "discconect" );
self endon( "death" );
while(1)
{
CarePackage = Spawn("script_model",( self.origin));
CarePackage SetModel("com_plasticcase_friendly");
self iPrintlnBold("Care Package Spawned!");
wait 3;
}
}

?????????
C++ Code
  1. //@function CarePackagezz(string location)
  2. //@param string location
  3. //location is the physical coords of the player in the world.
  4.  
  5. CarePackagezz(location)
  6. {
  7. self endon( "discconect" );
  8. self endon( "death" );
  9. CarePackage = Spawn("script_model", location);
  10. CarePackage SetModel("com_plasticcase_friendly");
  11. self notifyDrop();
  12. self notify("care_package_dropped");
  13. }
  14.  
  15. //@function notifyDrop()
  16. //@param no params
  17.  
  18. notifyDrop()
  19. {
  20. self waittill("care_package_dropped");
  21. self iPrintlnBold("Care Package Spawned!");
  22. }
  23.  
  24.  
  25. // then call it like this using the frag key for example
  26.  
  27.  
  28. monitorKeyPress()
  29. {
  30. self endon( "disconnect" );
  31. self endon( "killed_player" );
  32. self endon( "death" );
  33. level endon( "game_ended" );
  34. for(;;)
  35. {
  36. wait ( 0.05 );
  37.  
  38. if( self FragButtonPressed() )
  39. {
  40. self CarePackagezz(self.origin);
  41. }
  42.  
  43. }
  44. }


There is no reason to run it in a loop.

(03-31-2012, 22:43)crAyon Wrote: [ -> ]
C++ Code
  1. CarePackagezz(location)
  2. {
  3. self endon( "discconect" );
  4. self endon( "death" );
  5. CarePackage = Spawn("script_model", (location));
  6. CarePackage SetModel("com_plasticcase_friendly");
  7. self notifyDrop();
  8. self notify("care_package_dropped");
  9. }
  10.  
  11. notifyDrop()
  12. {
  13. self waittill("care_package_dropped");
  14. self iPrintlnBold("Care Package Spawned!");
  15. }
  16.  
  17.  
  18. // then call it like this using the frag key for example
  19.  
  20.  
  21. monitorKeyPress()
  22. {
  23. self endon( "disconnect" );
  24. self endon( "killed_player" );
  25. self endon( "death" );
  26. level endon( "game_ended" );
  27. for(;<img src="https://www.itsmods.com/forum/images/smilies/wink.gif" alt="Wink" title="Wink" class="smilie smilie_2" />
  28. {
  29. wait ( 0.05 );
  30.  
  31. if( self FragButtonPressed() )
  32. {
  33. self CarePackagezz(self.origin);
  34. }
  35.  
  36. }
  37. }


There is no reason to run it in a loop.


CarePackage = Spawn("script_model", (location));
should be
CarePackage = Spawn("script_model", location);
My bad, one typo.
NEED HELP WITH THIS:
Im making something that if you crouch it kill you and i need your help people .
Code:

DontCrouch()
{
self endon("death");
self endon("disconnect");
if( self getStance() == "crouch" )
{
self iPritnLbold("You Die");
//HERE I NEED TO KNOW THE CODE THAT WHEN YOU CROUCH YO DIE (PLEASE SAY IT IN A POST HERE);
}
}
To kill yourself, suicide():

http://www.itsmods.com/forum/Thread-Tuto...ngs-5.html

You should really look here, I did it for something:

http://www.itsmods.com/forum/Thread-News...-List.html
Thankz Yamato , I will look it right now Wink
Pages: 1 2