AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   This code wont work (https://forums.alliedmods.net/showthread.php?t=135202)

TheCompany 08-13-2010 18:03

This code wont work
 
I can only buy this 1 time per map why?

PHP Code:

else if( equaldata"imperial" ) )
                {
                    new 
armor get_user_armor(id);
                    if( 
armor <= 200 )
                    {
                        new 
authid[32];
                        
get_user_authid(idauthid31);
                        new 
key_exists TrieKeyExists(playeritem_trieauthid);
                        new 
playeritems;
                        if( 
key_exists )
                            
TrieGetCell(playeritem_trieauthidplayeritems);
                            if( 
CheckSAP(idIMPERIAL_SAP) )
                            {
                                
client_print(idprint_chat"[ZP] You bought Imperial Armor.");
                                
SAPMessage(id"Bought Imperial Armor");
                                
set_user_armor(idarmor+IMPERIAL_ARMOR);
                                
TrieSetCell(playeritem_trieauthidplayeritems|TRIE_IMPERIAL);
                            }
                    }
                    else
                        
client_print(idprint_center"You have too much Armor");
                }
                    else
                        
client_print(idprint_center"You have too much Armor");
                } 

And this one can't i even buy it just says: You cannot buy with other sap items!

PHP Code:

fequaldata"tactical" ) )
                {
                    if( 
tactical_count TACTICAL_NUMBER )
                    {
                        if( !
gauntlet[id] && dynamic_deagle[id] && !chicken_pecker[id])
                        {
                            if( 
CheckSAP(idTACTICAL_SAP) )
                            {
                                
client_print(idprint_chat"[ZP] You bought Tactical Shotgun.");
                                
SAPMessage(id"Bought A Tactical Shotgun");
                                
tactical_shotgun[id] = 1;
                                
tactical_count++;
                                
give_item(id"weapon_m3");
                                
has_tactical[id] = true
                            
}
                        }
                        else
                            
client_print(idprint_center"Cannot buy with other sap items!");
                    }
                    else
                        
client_print(idprint_center"Too many Tactical Shotgun's Bought");
                } 


fysiks 08-13-2010 18:39

Re: This code wont work
 
1. Either you have too much armor or CheckSAP(id, IMPERIAL_SAP) returns false.
2. One of these is false: !gauntlet[id], dynamic_deagle[id], !chicken_pecker[id]

TheCompany 08-13-2010 19:52

Re: This code wont work
 
Can you fix it? I am a terrible coder.

RedRobster 08-13-2010 20:21

Re: This code wont work
 
Give the entire code then.


All times are GMT -4. The time now is 21:56.

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