small issue with duplicate text
#3

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;
}
Reply


Messages In This Thread
small issue with duplicate text - by Phil_Cutcliffe - 28.01.2013, 17:18
Re: small issue with duplicate text - by Roach_ - 28.01.2013, 17:21
Re: small issue with duplicate text - by Phil_Cutcliffe - 28.01.2013, 17:50
Re: small issue with duplicate text - by Phil_Cutcliffe - 28.01.2013, 21:32

Forum Jump:


Users browsing this thread: 1 Guest(s)