AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [REQ] %s - Hud Message PLZZZ (https://forums.alliedmods.net/showthread.php?t=173531)

NiceGuyx 12-06-2011 16:00

[REQ] %s - Hud Message PLZZZ
 
Hello, i have this:

PHP Code:

new g_rank[33][33]

public 
rank(id)
{
       
g_rank[id] = "Member"
}

set_hudmessage(00255, -1.0, -1.021.09.00.010.110)
show_hudmessage(0"Rank: %s"g_rank[id]) 

Why it's not working
I want a hud message who show: Rank: Member (But with the %s)

Thk!

kramesa 12-06-2011 16:07

Re: [REQ] %s - Hud Message PLZZZ
 
try

PHP Code:

new g_rank[33][33]

public 
rank(id)
{
       
g_rank[id] = "Member"

       
set_hudmessage(00255, -1.0, -1.021.09.00.010.110)
       
show_hudmessage(0"Rank: %s"g_rank[id])



NiceGuyx 12-06-2011 16:17

Re: [REQ] %s - Hud Message PLZZZ
 
Try but not works :(

hleV 12-06-2011 16:18

Re: [REQ] %s - Hud Message PLZZZ
 
PHP Code:

g_rank[id] = "Member" 

->
PHP Code:

copy(g_rank[id], charsmax(g_rank[]), "Member"


Erox902 12-06-2011 16:31

Re: [REQ] %s - Hud Message PLZZZ
 
@NiceGuyx

Also remember:
Only post in scripting help if you need help.
Only post in request if you're requesting something.

Do not create new topics in both.
Seems really weird, many people have been doing this lately :?

And since this actually is a request ( even tagged with [REQ] )
Post in the correct section next time.

Edit
Sorry what I meant to say was:
Quote:

Originally Posted by Erox902 (Post 1608808)
And since this actually is a request ( even tagged with [REQ] )
Post only in the correct section next time.


NiceGuyx 12-06-2011 17:48

Re: [REQ] %s - Hud Message PLZZZ
 
Not working :s
I have Rank :
I don't have: "Member"

TheArmagedon 12-06-2011 18:25

Re: [REQ] %s - Hud Message PLZZZ
 
This should work...
PHP Code:

new iRank[33];
enum {
    
MEMBER,
    
OTHER
}

function(
id)
{
    
iRank[id] = MEMBER;
        
    switch(
iRank[id])
    {
        case 
MEMBER:
        {
            
set_hudmessage(00255, -1.0, -1.021.09.00.010.110)
            
show_hudmessage(0"Rank: Member")
        }
        default:
        {
            
        }
        
// bla bla bla ..
    
}
    
// if you dont want multiple things only use:
    
    
if(iRank[id] == MEMBER
    {
        
set_hudmessage(00255, -1.0, -1.021.09.00.010.110)
        
show_hudmessage(0"Rank: Member")
    }



fysiks 12-06-2011 21:31

Re: [REQ] %s - Hud Message PLZZZ
 
Quote:

Originally Posted by TheArmagedon (Post 1608844)
This should work...
PHP Code:

new iRank[33];
enum {
    
MEMBER,
    
OTHER
}

function(
id)
{
    
iRank[id] = MEMBER;
        
    switch(
iRank[id])
    {
        case 
MEMBER:
        {
            
set_hudmessage(00255, -1.0, -1.021.09.00.010.110)
            
show_hudmessage(0"Rank: Member")
        }
        default:
        {
            
        }
        
// bla bla bla ..
    
}
    
// if you dont want multiple things only use:
    
    
if(iRank[id] == MEMBER
    {
        
set_hudmessage(00255, -1.0, -1.021.09.00.010.110)
        
show_hudmessage(0"Rank: Member")
    }



It would be more appropriate to use a dynamic HUD message like the OP is trying to do unless there is an absolute need to do more than just print the info. If only trying to print that info then you waste a lot of time making a case for each rank.

NiceGuyx 12-07-2011 15:30

Re: [REQ] %s - Hud Message PLZZZ
 
show_hudmessage(0, "Rank: Member")

I told you that i want use: Rank: %s (Not Rank: Member)

NiceGuyx 12-07-2011 15:31

Re: [REQ] %s - Hud Message PLZZZ
 
My plugin:

http://pastebin.com/raw.php?i=ts8GwKue


All times are GMT -4. The time now is 12:02.

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