Raised This Month: $ Target: $400
 0% 

Make button to door


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
stupok
Veteran Member
Join Date: Feb 2006
Old 02-11-2007 , 18:25   Re: Make button to door
Reply With Quote #2

Try the code below. You shouldn't mix fakemeta and engine. Also, you passed 32 where it should be 31. (0, 1, 2, ..., 31) Target and targetname are strings, not numbers.

Code:
switch(key) {     case 0:     {         new classname[32]         entity_get_string(hisaim, EV_SZ_classname, classname, 31)                 if(hisaim == extrastuffb[id])         {             client_print(id, print_chat, "[Nican] An object can not be a door and a button at the same time!")         }         else if(!equal(classname, "func_door", 9) /*&& !equal(classname, "func_door_rotating", 18)*/)         {             //what about func_door_rotating?             client_print(id, print_chat, "[Nican] This item is not a valid door")         }         else         {             extrastuff[id] = hisaim         }     }     case 1:     {         if(hisaim == extrastuff[id])         {             client_print(id, print_chat, "[Nican] An object can not be a door and a button at the same time!")         }         else if(!hisaim)         {             client_print(id, print_chat, "[Nican] This item is not a valid button")         }         else         {             extrastuffb[id] = hisaim         }     }     case 2:     {         if(extrastuff[id] == 0 || extrastuffb[id] == 0)         {             client_print(id, print_chat, "[Nican] Please do steps 1 and 2 first")         }         else         {             new classname[32]             entity_get_string(extrastuffb[id], EV_SZ_classname, classname, 31)                         if(!equal(classname, "func_rot_button"))             {                 entity_set_string(extrastuffb[id], EV_SZ_classname, "func_rot_button")             }                         //you have to come up with a way to create a new string every time             //so you'll probably want to store the number of buttons created             //random numbers may be repeated, so I don't advise that             entity_set_string(extrastuff[id], EV_SZ_targetname, "string")             entity_set_string(extrastuffb[id], EV_SZ_target, "string")                       }     } }
stupok is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:36.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode