Raised This Month: $ Target: $400
 0% 

Split 2 simple codes


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ardonicek
Senior Member
Join Date: Feb 2013
Location: My home
Old 08-25-2013 , 13:12   Split 2 simple codes
Reply With Quote #1

Hello, i want you to add this
PHP Code:
{
        if(
cs_get_user_money(id)>10000)
        {
            
bank[id]+= cs_get_user_money(id) - 10000
            cs_set_user_money
(id,10000)
        }
        if(
cs_get_user_money(id)<10000)
        {
            if(
bank[id] < 10000 cs_get_user_money(id))
            {
                
cs_set_user_money(id,cs_get_user_money(id)+bank[id])
                
bank[id]=0
            
}
            else
            {
                
bank[id]-=  10000 cs_get_user_money(id)
                
cs_set_user_money(id,10000)
            }
        }
        
set_hudmessage(025500.70.8706.00.10.10.2next_hudchannel(id) )
        
show_hudmessage(id,"%L",id,"MSG_BANK",bank[id])

To this:

PHP Code:
public ShowHud(id

    new 
szText[555 char
    if(
Level[id] == 200
    { 
         
formatex(szTextsizeof(szText) -1"[%s]^n[Dalsi Level: %s]^n[XP : %i]^n[Kupenie XP = /buyxp]"Prefix[Level[id]], Prefix[Level[id] +1], eXP[id])  
    } 
    else 
    { 
        
formatex(szTextsizeof(szText) -1"Verzia: 1.3.3^n^n[%s]^n[XP : %i / %i]^n[Money: COSKORO] [Kupenie XP = /buyxp]"Prefix[Level[id]], eXP[id], LevelsLevel[id]]) 
    } 
    
set_hudmessage(128185110.010.2002.05.02.0_1)
    
show_hudmessage(idszText)

__________________
Latest plugin: dHUD Round | Timeleft

Last edited by Ardonicek; 08-25-2013 at 13:27.
Ardonicek is offline
Send a message via ICQ to Ardonicek Send a message via Skype™ to Ardonicek
devilicioux
Veteran Member
Join Date: Jun 2013
Location: Delhi,India
Old 08-25-2013 , 13:21   Re: Split 2 simple codes
Reply With Quote #2

Wrong arguments in both the Show_hudmessage functions..
__________________
You keep bringing ANTICHRISTUS down .. He will rise again and kick asses !

#RespectList ANTICHRISTUS fysiks Bugsy

Most Common Errors You Can Encounter Every Now and Then
devilicioux is offline
Ardonicek
Senior Member
Join Date: Feb 2013
Location: My home
Old 08-25-2013 , 13:28   Re: Split 2 simple codes
Reply With Quote #3

Edited. Btw. i just need to implement it into hudmsg in second code and make it work.
__________________
Latest plugin: dHUD Round | Timeleft
Ardonicek is offline
Send a message via ICQ to Ardonicek Send a message via Skype™ to Ardonicek
devilicioux
Veteran Member
Join Date: Jun 2013
Location: Delhi,India
Old 08-25-2013 , 13:42   Re: Split 2 simple codes
Reply With Quote #4

Quote:
Originally Posted by Ardonicek View Post
Edited. Btw. i just need to implement it into hudmsg in second code and make it work.
Still Wrong .. U dint pass the String in the first code and u are passing "id" 2 times in the second one ..
__________________
You keep bringing ANTICHRISTUS down .. He will rise again and kick asses !

#RespectList ANTICHRISTUS fysiks Bugsy

Most Common Errors You Can Encounter Every Now and Then
devilicioux is offline
Ardonicek
Senior Member
Join Date: Feb 2013
Location: My home
Old 08-25-2013 , 14:02   Re: Split 2 simple codes
Reply With Quote #5

Is it okay now?


PHP Code:

public cpt(id)
{
        if(
cs_get_user_money(id)>10000)
        {
            
bank[id]+= cs_get_user_money(id) - 10000
            cs_set_user_money
(id,10000)
        }
        if(
cs_get_user_money(id)<10000)
        {
            if(
bank[id] < 10000 cs_get_user_money(id))
            {
                
cs_set_user_money(id,cs_get_user_money(id)+bank[id])
                
bank[id]=0
            
}
            else
            {
                
bank[id]-=  10000 cs_get_user_money(id)
                
cs_set_user_money(id,10000)
            }
        }
        
set_hudmessage(025500.70.8706.00.10.10.2next_hudchannel(id) )
        
show_hudmessage(id,"%L",id,"MSG_BANK",bank[id])

__________________
Latest plugin: dHUD Round | Timeleft
Ardonicek is offline
Send a message via ICQ to Ardonicek Send a message via Skype™ to Ardonicek
devilicioux
Veteran Member
Join Date: Jun 2013
Location: Delhi,India
Old 08-26-2013 , 04:39   Re: Split 2 simple codes
Reply With Quote #6

First Code

PHP Code:
show_hudmessage(id,"%L",id,"MSG_BANK",bank[id]) 


PHP Code:
show_hudmessage(id"%L"LANG_PLAYER"MSG_BANK"bank[id]) 


Second Code



PHP Code:
show_hudmessage(idszText





PHP Code:
show_hudmessage(id"%s"szText
__________________
You keep bringing ANTICHRISTUS down .. He will rise again and kick asses !

#RespectList ANTICHRISTUS fysiks Bugsy

Most Common Errors You Can Encounter Every Now and Then

Last edited by devilicioux; 08-26-2013 at 04:40. Reason: Forgot tags as usual :/
devilicioux is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-26-2013 , 10:20   Re: Split 2 simple codes
Reply With Quote #7

Quote:
Originally Posted by devilicioux View Post
First Code

PHP Code:
show_hudmessage(id,"%L",id,"MSG_BANK",bank[id]) 


PHP Code:
show_hudmessage(id"%L"LANG_PLAYER"MSG_BANK"bank[id]) 


Wrong, original is correct


Quote:
Second Code
Quote:


PHP Code:
show_hudmessage(idszText





PHP Code:
show_hudmessage(id"%s"szText
Wrong, original is correct
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
devilicioux
Veteran Member
Join Date: Jun 2013
Location: Delhi,India
Old 08-26-2013 , 12:59   Re: Split 2 simple codes
Reply With Quote #8

Where am i wrong Yami .. Please explain me how that worked ?
__________________
You keep bringing ANTICHRISTUS down .. He will rise again and kick asses !

#RespectList ANTICHRISTUS fysiks Bugsy

Most Common Errors You Can Encounter Every Now and Then
devilicioux is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-26-2013 , 13:05   Re: Split 2 simple codes
Reply With Quote #9

Quote:
Originally Posted by devilicioux View Post
Where am i wrong Yami .. Please explain me how that worked ?
LANG_PLAYER is only supposed to be used if you are sending the message to everyone at one, such as
Code:
show_hudmessage(0, "%L", LANG_PLAYER, "MSG_BANK", bank[id])
If you are only sending to 1 user, use their index



This
Code:
show_hudmessage(id, szText)
works just fine, there is no reason to format it and force additional native calls when it is not needed
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).

Last edited by YamiKaitou; 08-26-2013 at 13:05.
YamiKaitou is offline
devilicioux
Veteran Member
Join Date: Jun 2013
Location: Delhi,India
Old 08-27-2013 , 04:33   Re: Split 2 simple codes
Reply With Quote #10

Okay ty for the great explanation ..
__________________
You keep bringing ANTICHRISTUS down .. He will rise again and kick asses !

#RespectList ANTICHRISTUS fysiks Bugsy

Most Common Errors You Can Encounter Every Now and Then
devilicioux is offline
Reply



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 18:48.


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