28.01.2013, 17:50
Is this what you need?
public OnPlayerText(playerid,text[])
{
if((GetTickCount() - GetPVarInt(playerid, "AntiSpam")) > 1)
{
SendClientMessageToAll(-1, text);
SetPVarInt(playerid, "AntiSpam", GetTickCount());
}
else
{
SendClientMessage(playerid, -1, "You must wait 10 seconds before using another Command!");
}
if(text[0] == '#')
{
new string[128]; GetPlayerName(playerid, string, sizeof(string));
format(string, sizeof(string), "[Team Radio] %s: %s", string, text[1]);
printf("%s", string);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && GetPlayerTeam(i) == GetPlayerTeam(playerid)) SendClientMessage(i, GetPlayerColor(playerid), string);
}
return 0;
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
return 1;
}
public OnPlayerText(playerid,text[])
{
if((GetTickCount() - GetPVarInt(playerid, "AntiSpam")) > 1)
{
SendClientMessageToAll(-1, text);
SetPVarInt(playerid, "AntiSpam", GetTickCount());
}
else
{
SendClientMessage(playerid, -1, "You must wait 10 seconds before using another Command!");
}
if(text[0] == '#')
{
new string[128]; GetPlayerName(playerid, string, sizeof(string));
format(string, sizeof(string), "[Team Radio] %s: %s", string, text[1]);
printf("%s", string);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && GetPlayerTeam(i) == GetPlayerTeam(playerid)) SendClientMessage(i, GetPlayerColor(playerid), string);
}
return 0;
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
return 1;
}