@Анатолий)))))))), Может так?
PHP:
#pragma semicolon 1
#include <sourcemod>
#include <easy_hudmessage>
new Handle:TimerPlayer[MAXPLAYERS+1];
new g_iAdvert[MAXPLAYERS + 1];
public OnPluginStart()
{
HookEvent("player_death", Event_PlayerDeath);
HookEvent("player_spawn", Event_PlayerSpawn);
}
public Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
TimerPlayer[client] = CreateTimer(7.0, Adverts, client, TIMER_REPEAT);
}
public Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if (TimerPlayer[client] != INVALID_HANDLE)
{
KillTimer(TimerPlayer[client]);
TimerPlayer[client] = INVALID_HANDLE;
}
}
public OnClientDisconnect(client)
{
if (TimerPlayer[client] != INVALID_HANDLE)
{
KillTimer(TimerPlayer[client]);
TimerPlayer[client] = INVALID_HANDLE;
}
}
public Action:Adverts(Handle:timer, any:client)
{
decl String:buffer[128];
switch (g_iAdvert[client])
{
case 0: FormatEx(buffer, sizeof(buffer), "сообщение1");
case 1: FormatEx(buffer, sizeof(buffer), "сообщение2");
case 2: FormatEx(buffer, sizeof(buffer), "сообщение3");
case 3: FormatEx(buffer, sizeof(buffer), "сообщение4");
}
SendHudMessage(client, 1, -0.007998, -0.879999, 0x00F2FFFF, 0xF2FF00FF, 2, 0.1, 5.1,1.0, 5.0, buffer);
if (++g_iAdvert[client] > 3)
g_iAdvert[client] = 0;
}
Последнее редактирование: