Advertisement
crashz33

VSCRIPT - PICKUP

Mar 1st, 2016
476
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.85 KB | None | 0 0
  1. if( GetDeveloperLevel() > 0 )
  2.     printl( "Initializing pickup_script.nut" );
  3.  
  4. // The state of Pickup [0 = ON // 1 = OFF]
  5. PickedUp    <- 0;
  6.  
  7. deagle01 <- null;
  8.  
  9. function OnPostSpawn()
  10. {
  11.     deagle01 = Entities.FindByName(deagle01, "deagle");
  12. }
  13.  
  14. function CheckPickup()
  15. {
  16.     // Do stuff when gun is picked up!
  17.    
  18.     // Check the state of the button.
  19.     if (PickedUp == 0) {
  20.    
  21.         // The pickup is enabled, so let's turn it OFF!
  22.        
  23.         // Send a message to the chat.
  24.         ScriptPrintMessageChatAll("Pickup has been disabled!");
  25.        
  26.         // Change the variable to 1 (ON)
  27.         PickedUp = 1;
  28.        
  29.     } else if (PickedUp == 1) {
  30.        
  31.         // Send a message to the chat.
  32.         ScriptPrintMessageChatAll("Pickup is not allowed");
  33.        
  34.         // Kill the entity.
  35.         deagle01.Destroy();
  36.     }
  37.     // Send a message to the console. (useful for debugging!)
  38.     printl("PickedUp() has been executed!")
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement