AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   What's %s and others. (https://forums.alliedmods.net/showthread.php?t=159898)

Guppy488 06-23-2011 07:09

What's %s and others.
 
hi, i'm wondering what's % ,%s , %d and %L, how do i use them?
also if i'm to log a player msg's msg when he type /log <msg> it'll log down that specific player msg to a file. so if he didn't type /log <his msg> it wont log down his message :D is that possible?

byetovice 06-23-2011 07:19

Re: What's %s and others.
 
For your first question
%s - string
%d - integer
%i - integer
%L - string from multilanguage file

client_print(id,print_chat," Your level is : %d Your class is : %s", 25, "BlackSpider")

Guppy488 06-23-2011 07:29

Re: What's %s and others.
 
so how does %s , %d works?

DjOptimuS 06-23-2011 07:52

Re: What's %s and others.
 
http://wiki.alliedmods.net/Pawn_Tutorial

A quick sample

PHP Code:

new integer 5;
new 
string[] = "This is string number";

client_print(0print_chat"%s %i"stringinteger); 

This will output
Code:

This is string number 5

Guppy488 06-23-2011 08:09

Re: What's %s and others.
 
Quote:

Originally Posted by DjOptimuS (Post 1494102)
http://wiki.alliedmods.net/Pawn_Tutorial

A quick sample

PHP Code:

new integer 5;
new 
string[] = "This is string number";

client_print(0print_chat"%s %i"stringinteger); 

This will output
Code:

This is string number 5

how can i log a player message when he type /log <his own message> it'll log it into a file.

Schwabba 06-23-2011 11:36

Re: What's %s and others.
 
log_to_file

nikhilgupta345 06-23-2011 11:55

Re: What's %s and others.
 
Register command 'say' and if the first 4 characters in the string said are /log, then you can use 'parse' to split it up. Then log the text to a file.


All times are GMT -4. The time now is 23:33.

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