The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can_u issue
Author Message
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #1
Can_u issue
Hi everyone, i'am trying to make an item be equipable by all races but im having problem with this:

this is the original script from sphere_item_typedef_equipitem.scp

the problem is when you are playing as a gargoyle...

can_u_none works fine, can_u_all doesnt work, when it's set, for some reason it has conflits with the second gargish check "ELSEIF !(<CanUse>&can_u_gargoyle)" so i get the ""Gargoyles can't wear this." message...

and if i set CanUse=can_u_human|can_u_gargoyle, it has conflits with <canuse>&can_u_human" condition check so i get the "You cannot equip that." message.

is it an script issue? or can_u_all is not working property at all??

PHP Code:
ON=@EquipTest
IF (<CanUse>&can_u_none)
    RETURN 
1
ELSEIF (<CanUse>&can_u_all)
    RETURN 
0
ENDIF
IF (<
SRC.IsPlayer>)
    
//Checking if the item can be equiped by gargoyles, don't uncomment the following 2 checks.
    
IF (<CanUse>&can_u_gargoyle)
        IF !(<
SRC.f_isgarg>)
            
SRC.SYSMESSAGELOC color_text,1111707//"Only gargoyles can wear this."
            
RETURN 1
        
ENDIF
    ELSEIF !(<
CanUse>&can_u_gargoyle)
        IF (<
SRC.f_isgarg>)
            
SRC.SYSMESSAGELOC color_text,1111708//"Gargoyles can't wear this."
            
RETURN 1
        
ENDIF
    ENDIF
    
//If you want every item equipable for every character without checking for race/sex uncomment the next line (return 0).
    //return 0
    
IF ( (<CanUse>&can_u_female) && !(<CanUse>&can_u_male) )     //Female item
        
IF !(<SRC.f_isfemale>)    //must be used by females.
            
SRC.SYSMESSAGELOC color_text,1010388//"Only females can wear this."
            
RETURN 1
        
ENDIF
    ELSEIF ( (<
CanUse>&can_u_male) && !(<CanUse>&can_u_female) )    //male item
        
IF (<SRC.f_isfemale>)    //must be used by males.
            
SRC.SYSMESSAGELOC color_text,1063343//"Only males can wear this."
            
RETURN 1
        
ENDIF
    ENDIF
    IF ( ( (<
CanUse>&can_u_human) && !(<src.f_IsHuman>) ) && !( (<CanUse>&can_u_elf) && (<src.f_IsElf>) ) )
        
SRC.SYSMESSAGELOC color_text,1071936//"You cannot equip that."
        
RETURN 1
    
ELSEIF ( ( (<CanUse>&can_u_elf) && !(<SRC.f_iself>) ) && !( (<CanUse>&can_u_human) && (<src.f_IsHuman>) ) )        //can't be used by elves
            
SRC.SYSMESSAGELOC color_text,1072203//"Only elves may use this."
            
RETURN 1
        
ENDIF
    ENDIF
ENDIF 


Thank you so much ^^
(This post was last modified: 06-03-2014 04:17 AM by kn4tseb.)
06-03-2014 04:15 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #2
RE: Can_u issue
My bad, ELSEIF !(<CanUse>&can_u_gargoyle) should be ELSEIF !(<CanUse>&can_u_all), i'll commit it soon.
06-03-2014 04:33 AM
Find all posts by this user Like Post Quote this message in a reply
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #3
RE: Can_u issue
ok ^^, for Nth time, thanks XuN xDDD... btw

ELSEIF ( !(<CanUse>&can_u_gargoyle) && (<CanUse>&can_u_all) )

seems to fix this problem.
(This post was last modified: 06-03-2014 05:39 AM by kn4tseb.)
06-03-2014 05:26 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)