This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

[QUESTION] hud messages using stock written by jopmako


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Rav3n!
Junior Member
Join Date: May 2007
Location: UK
Old 05-07-2007 , 11:33   [QUESTION] hud messages using stock written by jopmako
Reply With Quote #1

hello everyone,

a quick questions from a new guy,

jopmako wrote a hud message stock which looks like this

Code:
// Stock written by jopmako
stock SendMsg_TextMsg(client, type, const String:szMsg[], any:...)
{
   if (strlen(szMsg) > 191){
      LogError("Disallow string len(%d) > 191", strlen(szMsg));
      return;
   }

   decl String:buffer[192];
   VFormat(buffer, sizeof(buffer), szMsg, 4);

   new Handle:hBf;
   if (!client)
      hBf = StartMessageAll("TextMsg");
   else hBf = StartMessageOne("TextMsg", client);

   if (hBf != INVALID_HANDLE)
   {
      BfWriteByte(hBf, type);
      BfWriteString(hBf, buffer);
      EndMessage();
   }
}
and i came across it when looking in sslice's script for a c4 countdown, where in the centre of the screen it counts down the last 5 seconds, and well i was new to scripting and thought i might have a go with printing a message on screen for when a ingame event occurs. the one i used was the common headshot event. but i now have a problem cause when i compile the plugin im running into 3 errors (run using the web compiler)

the code i have used is as follows and was wondering if anyone can point me in the direction of were i have gone wrong many thanks to anyone that can help

Code:
#include <sourcemod>

(then the above code from jopmako)

public OnPluginStart()
{
    HookEvent("headshot", event_headshot, EventHookMode_Pre);
}

public event_headshot(Handle:event, const String:name[], bool:dontBroadcast)
(
    SendMsg_TextMsg(0, TEXTMSG_PRINTCENTER, "Headshot");
    
    return Plugin_Continue
}
Rav3n! is offline
 



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 14:10.


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