AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Print Message (https://forums.alliedmods.net/showthread.php?t=232294)

Groven 12-28-2013 13:16

Print Message
 
Hello. Im new to scripting and I tried to do something with
PHP Code:

%

but it wont work in someway, I dont even know if it is the correct script function for it.

But here's the full code. For some reason %n dosent work and just prints out
PHP Code:



I want it to print out the persons name.

PHP Code:

BCM_Print(id"%n has been given %s $!"property); 


wickedd 12-28-2013 13:24

Re: Print Message
 
What game?

Edit: %s is for strings

Groven 12-28-2013 14:01

Re: Print Message
 
%s works fine but not %n, Is %n for name? Like "Sprite has been given 40"

neverminde 12-28-2013 15:31

Re: Print Message
 
Quote:

Originally Posted by Groven (Post 2077627)
%s works fine but not %n, Is %n for name? Like "Sprite has been given 40"

never seen before this qualifier. seems this stuff dont work in pawn.
Look at this c++ code

#include <stdio.h>
int main(void)
{
int count;
printf ("this%n is a test\n", &count);
printf ("%d", count);
return 0;
}
print "this is a test" after "4". Do you really need this ? :shock:

fysiks 12-28-2013 15:36

Re: Print Message
 
Quote:

Originally Posted by Groven (Post 2077627)
Is %n for name?

. . . where did you get this idea? If it is posted here somewhere then it needs to be removed.

Groven 12-29-2013 05:26

Re: Print Message
 
Quote:

Originally Posted by fysiks (Post 2077679)
. . . where did you get this idea? If it is posted here somewhere then it needs to be removed.

I asked a random person but it seems he's wrong aswell hehe :P. But how do I make so the player names print?

Backstabnoob 12-29-2013 06:04

Re: Print Message
 
Code:
new szName[ 32 ] get_user_name( id, szName, charsmax( szName ) ) client_print( id, print_chat, "Your name is %s", szName )

Groven 12-29-2013 06:49

Re: Print Message
 
Thank you. will try that.

YamiKaitou 01-03-2014 12:15

Re: Print Message
 
%n only works for SourceMod, not AMXX


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

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