Raised This Month: $ Target: $400
 0% 

name function with double name arg


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 08-03-2010 , 15:17   Re: name function with double name arg
Reply With Quote #1

PHP Code:
    if (nick[0] && !equal(nick"0"))
        
client_cmd(id"name ^"%%s^""get_stat(sid), nick);
    else
        
client_cmd(id"name ^"%%s^""get_stat(sid), glob); 
__________________
hleV is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 08-03-2010 , 18:38   Re: name function with double name arg
Reply With Quote #2

Use setinfo:
Code:
    if (nick[0] && !equal(nick, "0"))         set_user_info(id, "name",  "%s %s", get_stat(sid), nick);     else         set_user_info(id, "name", "%s %s", get_stat(sid), glob);
Seta00 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-03-2010 , 18:48   Re: name function with double name arg
Reply With Quote #3

@Seta, you can't format in set_user_info().

PHP Code:
    new szString[32]
    if (
nick[0] && !equal(nick"0"))
        
formatex(szStringcharsmax(szString), "%s %s"get_stat(sid), nick)
    else
        
formatex(szStringcharsmax(szString), "%s %s"get_stat(sid), glob)
    
set_user_info(id"name"szString
__________________

Last edited by fysiks; 08-03-2010 at 18:51.
fysiks is offline
sparkey
Senior Member
Join Date: May 2010
Old 08-03-2010 , 18:49   Re: name function with double name arg
Reply With Quote #4

Thx for your answer.

That was the function i started with first and tried it just as you wrote but it seems that the function cant handle all that parameters.

gsop.cpp(460) : error 088: number of arguments does not match definition
sparkey is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-03-2010 , 18:54   Re: name function with double name arg
Reply With Quote #5

Quote:
Originally Posted by sparkey View Post
Thx for your answer.

That was the function i started with first and tried it just as you wrote but it seems that the function cant handle all that parameters.

gsop.cpp(460) : error 088: number of arguments does not match definition
See my post above.
__________________
fysiks is offline
sparkey
Senior Member
Join Date: May 2010
Old 08-03-2010 , 18:56   Re: name function with double name arg
Reply With Quote #6

Ah thanks will try it right away
sparkey is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-03-2010 , 18:57   Re: name function with double name arg
Reply With Quote #7

Quote:
Originally Posted by sparkey View Post
Do you have any idea how i could solve this cause it seems that the client_cmd command can not execute that early.
I didn't use client_cmd().
__________________
fysiks is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 08-03-2010 , 18:54   Re: name function with double name arg
Reply With Quote #8

Quote:
Originally Posted by sparkey View Post
Thx for your answer.

That was the function i started with first and tried it just as you wrote but it seems that the function cant handle all that parameters.

gsop.cpp(460) : error 088: number of arguments does not match definition
Use fysiks' code.
Seta00 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 00:14.


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