Raised This Month: $51 Target: $400
 12% 

The message is not displayed in the console.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
onioncode
New Member
Join Date: Jan 2019
Old 01-21-2019 , 12:42   The message is not displayed in the console.
Reply With Quote #1

Hello, I try to write my first plugin, but I got problem

PHP Code:
#pragma semicolon 1
#include <sourcemod>
#pragma newdecls required

public Plugin myinfo =
{
    
name "My First Plugin",
    
author "Me",
    
description "My first plugin ever",
    
version "1.0",
    
url "http://www.sourcemod.net/"
};
 
public 
void OnPluginStart()
{
    
HookEvent("player_death"Event_PlayerDeath);  
}

public 
void Event_PlayerDeath(Event hEvent, const char[] sEvNamebool bDontBroadcast)
{
    
int iUserID hEvent.GetInt("userid");
    
PrintToServer("userid: %iUserID"iUserID);

Mesage isn't displayed. Why?
Another question is what is inside hEvent?
onioncode is offline
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 01-21-2019 , 14:02   Re: The message is not displayed in the console.
Reply With Quote #2

Maybe you looking for message in chat, Not server concole. Not even error?

Last edited by Indarello; 01-21-2019 at 14:12.
Indarello is offline
farawayf
Senior Member
Join Date: Jan 2019
Old 01-21-2019 , 14:08   Re: The message is not displayed in the console.
Reply With Quote #3

PHP Code:
public void Event_PlayerDeath(Event hEvent, const char[] sEvNamebool bDontBroadcast

    
int iUserID hEvent.GetInt("userid"); 
    
PrintToConsole("userid: %iUserID"iUserID); 


Last edited by farawayf; 01-21-2019 at 14:09.
farawayf is offline
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 01-21-2019 , 14:11   Re: The message is not displayed in the console.
Reply With Quote #4

resource\modevents.res
You can find this file in vpk
For list of events and arguments

Last edited by Indarello; 01-21-2019 at 14:12.
Indarello is offline
Whai
Senior Member
Join Date: Jul 2018
Old 01-21-2019 , 15:02   Re: The message is not displayed in the console.
Reply With Quote #5

PHP Code:
public void Event_PlayerDeath(Event hEvent, const char[] sEvNamebool bDontBroadcast)  
{  
    
int iUserID hEvent.GetInt("userid");  
    
PrintToConsole("userid: %i"iUserID);  

%i or %d for integers value, check this wiki to know for others like string or float Format Class Functions

Also, PrintToConsole if for print the text into client console and not server console,
PrintToServer is for print the text into the server console,
and PrintToChat is for print the text into the chat to the client

For events, you can find in Game Events
For the player_death event : General Game Events player_death

hEvent is the handle for the event.
__________________
Whai 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 23:51.


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