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
}